Hello community,

here is the log from the commit of package rubygem-gettext-setup for 
openSUSE:Factory checked in at 2017-04-20 20:58:36
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-gettext-setup (Old)
 and      /work/SRC/openSUSE:Factory/.rubygem-gettext-setup.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "rubygem-gettext-setup"

Thu Apr 20 20:58:36 2017 rev:9 rq:489045 version:0.21

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/rubygem-gettext-setup/rubygem-gettext-setup.changes  
    2017-04-17 10:27:23.001104596 +0200
+++ 
/work/SRC/openSUSE:Factory/.rubygem-gettext-setup.new/rubygem-gettext-setup.changes
 2017-04-20 20:58:38.018771150 +0200
@@ -1,0 +2,6 @@
+Thu Apr 13 04:30:41 UTC 2017 - co...@suse.com
+
+- updated to version 0.21
+  no changelog found
+
+-------------------------------------------------------------------

Old:
----
  gettext-setup-0.20.gem

New:
----
  gettext-setup-0.21.gem

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ rubygem-gettext-setup.spec ++++++
--- /var/tmp/diff_new_pack.OGRpJo/_old  2017-04-20 20:58:38.746668209 +0200
+++ /var/tmp/diff_new_pack.OGRpJo/_new  2017-04-20 20:58:38.750667643 +0200
@@ -24,7 +24,7 @@
 #
 
 Name:           rubygem-gettext-setup
-Version:        0.20
+Version:        0.21
 Release:        0
 %define mod_name gettext-setup
 %define mod_full_name %{mod_name}-%{version}

++++++ gettext-setup-0.20.gem -> gettext-setup-0.21.gem ++++++
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/tasks/gettext.rake new/lib/tasks/gettext.rake
--- old/lib/tasks/gettext.rake  2017-03-30 00:23:16.000000000 +0200
+++ new/lib/tasks/gettext.rake  2017-04-08 00:27:08.000000000 +0200
@@ -2,56 +2,12 @@
 # puts File.absolute_path('Gemfile', Dir.pwd)
 # Bundler.read_file(File.absolute_path('Gemfile', Dir.pwd))
 #
-require 'open3'
 require_relative '../gettext-setup/gettext_setup'
+require_relative 'task_helper.rb'
 #
 # GettextSetup.initialize(File.absolute_path('locales', Dir.pwd))
 
 namespace :gettext do
-  def locale_path
-    GettextSetup.locales_path
-  end
-
-  def text_domain
-    FastGettext.text_domain
-  end
-
-  def files_to_translate
-    files = GettextSetup.config['source_files'].map do |p|
-      Dir.glob(p)
-    end.flatten
-    # check for optional list of files to exclude from string
-    # extraction
-    exclusions = (GettextSetup.config['exclude_files'] || []).map do |p|
-      Dir.glob(p)
-    end.flatten
-
-    # if file is a directory, take it out of the array. directories
-    # cause rxgettext to error out.
-    (files - exclusions).reject { |file| File.directory?(file) }
-  end
-
-  def pot_file_path
-    File.join(locale_path, GettextSetup.config['project_name'] + '.pot')
-  end
-
-  def generate_new_pot
-    config = GettextSetup.config
-    package_name = config['package_name']
-    project_name = config['project_name']
-    bugs_address = config['bugs_address']
-    copyright_holder = config['copyright_holder']
-    # Done this way to allow the user to enter an empty string in the config.
-    comments_tag = config.key?('comments_tag') ? config['comments_tag'] : 
'TRANSLATORS'
-    version = `git describe`
-    system("rxgettext -o locales/#{project_name}.pot --no-wrap --sort-by-file 
" \
-           "--add-comments#{comments_tag.to_s == '' ? '' : '=' + comments_tag} 
--msgid-bugs-address '#{bugs_address}' " \
-           "--package-name '#{package_name}' " \
-           "--package-version '#{version}' " \
-           "--copyright-holder='#{copyright_holder}' 
--copyright-year=#{Time.now.year} " +
-           files_to_translate.join(' '))
-  end
-
   desc 'Generate a new POT file and replace old if strings changed'
   task :update_pot do
     if !File.exist? pot_file_path
@@ -61,18 +17,12 @@
       old_pot = pot_file_path + '.old'
       File.rename(pot_file_path, old_pot)
       generate_new_pot
-      begin
-        _, stderr, status = Open3.capture3("msgcmp --use-untranslated 
'#{old_pot}' '#{pot_file_path}'")
-        if status == 1 || /this message is not used/.match(stderr)
-          File.delete(old_pot)
-          puts 'String changes detected, replacing with updated POT file'
-        else
-          puts 'No string changes detected, keeping old POT file'
-          File.rename(old_pot, pot_file_path)
-        end
-      rescue IOError
-        # Ignore; probably means msgcmp isn't installed.
+      if string_changes?(old_pot, pot_file_path)
         File.delete(old_pot)
+        puts 'String changes detected, replacing with updated POT file'
+      else
+        puts 'No string changes detected, keeping old POT file'
+        File.rename(old_pot, pot_file_path)
       end
     end
   end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/tasks/task_helper.rb new/lib/tasks/task_helper.rb
--- old/lib/tasks/task_helper.rb        1970-01-01 01:00:00.000000000 +0100
+++ new/lib/tasks/task_helper.rb        2017-04-08 00:27:08.000000000 +0200
@@ -0,0 +1,58 @@
+require 'open3'
+
+def locale_path
+  GettextSetup.locales_path
+end
+
+def text_domain
+  FastGettext.text_domain
+end
+
+def files_to_translate
+  files = GettextSetup.config['source_files'].map do |p|
+    Dir.glob(p)
+  end.flatten
+  # check for optional list of files to exclude from string
+  # extraction
+  exclusions = (GettextSetup.config['exclude_files'] || []).map do |p|
+    Dir.glob(p)
+  end.flatten
+
+  # if file is a directory, take it out of the array. directories
+  # cause rxgettext to error out.
+  (files - exclusions).reject { |file| File.directory?(file) }
+end
+
+def pot_file_path
+  File.join(locale_path, GettextSetup.config['project_name'] + '.pot')
+end
+
+def generate_new_pot
+  config = GettextSetup.config
+  package_name = config['package_name']
+  project_name = config['project_name']
+  bugs_address = config['bugs_address']
+  copyright_holder = config['copyright_holder']
+  # Done this way to allow the user to enter an empty string in the config.
+  comments_tag = config.key?('comments_tag') ? config['comments_tag'] : 
'TRANSLATORS'
+  version = `git describe`
+  system("rxgettext -o locales/#{project_name}.pot --no-wrap --sort-by-file " \
+         "--add-comments#{comments_tag.to_s == '' ? '' : '=' + comments_tag} 
--msgid-bugs-address '#{bugs_address}' " \
+         "--package-name '#{package_name}' " \
+         "--package-version '#{version}' " \
+         "--copyright-holder='#{copyright_holder}' 
--copyright-year=#{Time.now.year} " +
+         files_to_translate.join(' '))
+end
+
+def string_changes?(old_pot, new_pot)
+  # Warnings will be in another language if locale is not set to en_US
+  _, stderr, status = Open3.capture3("LANG=en_US msgcmp --use-untranslated 
'#{old_pot}' '#{new_pot}'")
+  if status.exitstatus == 1 || /this message is not used/.match(stderr) || 
/this message is used but not defined/.match(stderr)
+    return true
+  end
+  return false
+rescue IOError
+  # probably means msgcmp is not present on the system
+  # so return true to be on the safe side
+  return true
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata        2017-03-30 00:23:16.000000000 +0200
+++ new/metadata        2017-04-08 00:27:08.000000000 +0200
@@ -1,14 +1,14 @@
 --- !ruby/object:Gem::Specification
 name: gettext-setup
 version: !ruby/object:Gem::Version
-  version: '0.20'
+  version: '0.21'
 platform: ruby
 authors:
 - Puppet
 autorequire: 
 bindir: bin
 cert_chain: []
-date: 2017-03-29 00:00:00.000000000 Z
+date: 2017-04-07 00:00:00.000000000 Z
 dependencies:
 - !ruby/object:Gem::Dependency
   name: fast_gettext
@@ -204,6 +204,7 @@
 - lib/gettext-setup.rb
 - lib/gettext-setup/gettext_setup.rb
 - lib/tasks/gettext.rake
+- lib/tasks/task_helper.rb
 - locales/config-sample.yaml
 - spec/fixtures/alt_locales/alt_locales.pot
 - spec/fixtures/alt_locales/config.yaml
@@ -211,8 +212,14 @@
 - spec/fixtures/locales/config.yaml
 - spec/fixtures/locales/de/sinatra-i18n.po
 - spec/fixtures/locales/sinatra-i18n.pot
+- spec/fixtures/pot_update/add.pot
+- spec/fixtures/pot_update/change.pot
+- spec/fixtures/pot_update/non_string_changes.pot
+- spec/fixtures/pot_update/old.pot
+- spec/fixtures/pot_update/remove.pot
 - spec/lib/gettext_setup_spec.rb
 - spec/spec_helper.rb
+- spec/tasks/update_pot_spec.rb
 homepage: https://github.com/puppetlabs/gettext-setup-gem
 licenses:
 - Apache-2.0
@@ -233,7 +240,7 @@
       version: '0'
 requirements: []
 rubyforge_project: 
-rubygems_version: 2.5.1
+rubygems_version: 2.5.2
 signing_key: 
 specification_version: 4
 summary: A gem to ease internationalization with fast_gettext
@@ -244,6 +251,11 @@
 - spec/fixtures/locales/config.yaml
 - spec/fixtures/locales/de/sinatra-i18n.po
 - spec/fixtures/locales/sinatra-i18n.pot
+- spec/fixtures/pot_update/add.pot
+- spec/fixtures/pot_update/change.pot
+- spec/fixtures/pot_update/non_string_changes.pot
+- spec/fixtures/pot_update/old.pot
+- spec/fixtures/pot_update/remove.pot
 - spec/lib/gettext_setup_spec.rb
 - spec/spec_helper.rb
-has_rdoc: 
+- spec/tasks/update_pot_spec.rb
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/spec/fixtures/pot_update/add.pot 
new/spec/fixtures/pot_update/add.pot
--- old/spec/fixtures/pot_update/add.pot        1970-01-01 01:00:00.000000000 
+0100
+++ new/spec/fixtures/pot_update/add.pot        2017-04-08 00:27:08.000000000 
+0200
@@ -0,0 +1,33 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) 2016 Puppet Labs, LLC.
+# This file is distributed under the same license as the Sinatra i18n demo 
package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2016.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: Sinatra i18n demo init-11-ga552a06\n"
+"\n"
+"Report-Msgid-Bugs-To: d...@puppetlabs.com\n"
+"POT-Creation-Date: 2016-06-07 17:38-0500\n"
+"PO-Revision-Date: 2016-06-07 17:38-0500\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <l...@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
+
+#. GettextSetup.initialize(File::join(File::dirname(File::dirname(__FILE__)), 
'fixtures'))
+#: ../../lib/gettext_setup_spec.rb:25
+msgid "Hello, world!"
+msgstr ""
+
+#: ../../lib/gettext_setup_spec.rb:25
+msgid "Goodbye, world!"
+msgstr ""
+
+#: ../../lib/gettext_setup_spec.rb:25
+msgid "new string"
+msgstr ""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/spec/fixtures/pot_update/change.pot 
new/spec/fixtures/pot_update/change.pot
--- old/spec/fixtures/pot_update/change.pot     1970-01-01 01:00:00.000000000 
+0100
+++ new/spec/fixtures/pot_update/change.pot     2017-04-08 00:27:08.000000000 
+0200
@@ -0,0 +1,29 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) 2016 Puppet Labs, LLC.
+# This file is distributed under the same license as the Sinatra i18n demo 
package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2016.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: Sinatra i18n demo init-11-ga552a06\n"
+"\n"
+"Report-Msgid-Bugs-To: d...@puppetlabs.com\n"
+"POT-Creation-Date: 2016-06-07 17:38-0500\n"
+"PO-Revision-Date: 2016-06-07 17:38-0500\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <l...@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
+
+#. GettextSetup.initialize(File::join(File::dirname(File::dirname(__FILE__)), 
'fixtures'))
+#: ../../lib/gettext_setup_spec.rb:25
+msgid "Hello, world!"
+msgstr ""
+
+#: ../../lib/gettext_setup_spec.rb:25
+msgid "changed string"
+msgstr ""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/spec/fixtures/pot_update/non_string_changes.pot 
new/spec/fixtures/pot_update/non_string_changes.pot
--- old/spec/fixtures/pot_update/non_string_changes.pot 1970-01-01 
01:00:00.000000000 +0100
+++ new/spec/fixtures/pot_update/non_string_changes.pot 2017-04-08 
00:27:08.000000000 +0200
@@ -0,0 +1,29 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) 2016 Puppet Labs, LLC.
+# This file is distributed under the same license as the Sinatra i18n demo 
package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2016.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: Sinatra i18n demo init-11-ga552a06\n"
+"\n"
+"Report-Msgid-Bugs-To: d...@puppetlabs.com\n"
+"POT-Creation-Date: 2017-04-17 17:38-0500\n"
+"PO-Revision-Date: 2017-04-17 17:38-0500\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <l...@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
+
+#. GettextSetup.initialize(File::join(File::dirname(File::dirname(__FILE__)), 
'fixtures'))
+#: ../../lib/gettext_setup_spec.rb:25
+msgid "Hello, world!"
+msgstr ""
+
+#: ../../lib/different_file.rb:25
+msgid "Goodbye, world!"
+msgstr ""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/spec/fixtures/pot_update/old.pot 
new/spec/fixtures/pot_update/old.pot
--- old/spec/fixtures/pot_update/old.pot        1970-01-01 01:00:00.000000000 
+0100
+++ new/spec/fixtures/pot_update/old.pot        2017-04-08 00:27:08.000000000 
+0200
@@ -0,0 +1,29 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) 2016 Puppet Labs, LLC.
+# This file is distributed under the same license as the Sinatra i18n demo 
package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2016.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: Sinatra i18n demo init-11-ga552a06\n"
+"\n"
+"Report-Msgid-Bugs-To: d...@puppetlabs.com\n"
+"POT-Creation-Date: 2016-06-07 17:38-0500\n"
+"PO-Revision-Date: 2016-06-07 17:38-0500\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <l...@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
+
+#. GettextSetup.initialize(File::join(File::dirname(File::dirname(__FILE__)), 
'fixtures'))
+#: ../../lib/gettext_setup_spec.rb:25
+msgid "Hello, world!"
+msgstr ""
+
+#: ../../lib/gettext_setup_spec.rb:25
+msgid "Goodbye, world!"
+msgstr ""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/spec/fixtures/pot_update/remove.pot 
new/spec/fixtures/pot_update/remove.pot
--- old/spec/fixtures/pot_update/remove.pot     1970-01-01 01:00:00.000000000 
+0100
+++ new/spec/fixtures/pot_update/remove.pot     2017-04-08 00:27:08.000000000 
+0200
@@ -0,0 +1,25 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) 2016 Puppet Labs, LLC.
+# This file is distributed under the same license as the Sinatra i18n demo 
package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2016.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: Sinatra i18n demo init-11-ga552a06\n"
+"\n"
+"Report-Msgid-Bugs-To: d...@puppetlabs.com\n"
+"POT-Creation-Date: 2016-06-07 17:38-0500\n"
+"PO-Revision-Date: 2016-06-07 17:38-0500\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <l...@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
+
+#. GettextSetup.initialize(File::join(File::dirname(File::dirname(__FILE__)), 
'fixtures'))
+#: ../../lib/gettext_setup_spec.rb:25
+msgid "Hello, world!"
+msgstr ""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/spec/lib/gettext_setup_spec.rb 
new/spec/lib/gettext_setup_spec.rb
--- old/spec/lib/gettext_setup_spec.rb  2017-03-30 00:23:16.000000000 +0200
+++ new/spec/lib/gettext_setup_spec.rb  2017-04-08 00:27:08.000000000 +0200
@@ -1,6 +1,8 @@
 require 'rspec/expectations'
 require_relative '../spec_helper'
 
+require_relative '../../lib/gettext-setup'
+
 describe GettextSetup do
   before(:each) do
     GettextSetup.initialize(File.join(File.dirname(File.dirname(__FILE__)), 
'fixtures', 'locales'))
@@ -50,8 +52,13 @@
       expect(GettextSetup.default_locale).to eq('en')
       expect(GettextSetup.candidate_locales).to include('en')
       GettextSetup.clear
-      ENV['LANG'] = 'de_DE'
-      expect(GettextSetup.candidate_locales).to eq('de_DE,de,en')
+      begin
+        old_locale = ENV['LANG']
+        ENV['LANG'] = 'de_DE'
+        expect(GettextSetup.candidate_locales).to eq('de_DE,de,en')
+      ensure
+        ENV['LANG'] = old_locale
+      end
     end
   end
   context 'multiple locales' do
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/spec/spec_helper.rb new/spec/spec_helper.rb
--- old/spec/spec_helper.rb     2017-03-30 00:23:16.000000000 +0200
+++ new/spec/spec_helper.rb     2017-04-08 00:27:08.000000000 +0200
@@ -3,4 +3,10 @@
   add_filter '/spec/'
 end
 
-require_relative '../lib/gettext-setup'
+def msgcmp_present?
+  # Try to call out to msgcmp, if it doesn't error, we have the tool
+  `msgcmp`
+  return true
+rescue IOError
+  return false
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/spec/tasks/update_pot_spec.rb 
new/spec/tasks/update_pot_spec.rb
--- old/spec/tasks/update_pot_spec.rb   1970-01-01 01:00:00.000000000 +0100
+++ new/spec/tasks/update_pot_spec.rb   2017-04-08 00:27:08.000000000 +0200
@@ -0,0 +1,28 @@
+require 'rspec/expectations'
+require_relative '../spec_helper.rb'
+
+require_relative '../../lib/tasks/task_helper.rb'
+
+describe 'string_changes?', if: msgcmp_present? do
+  old_pot = File.absolute_path('../fixtures/pot_update/old.pot', 
File.dirname(__FILE__))
+
+  it 'should detect string addition' do
+    new_pot = File.absolute_path('../fixtures/pot_update/add.pot', 
File.dirname(__FILE__))
+    expect(string_changes?(old_pot, new_pot)).to eq(true)
+  end
+
+  it 'should detect string removal' do
+    new_pot = File.absolute_path('../fixtures/pot_update/remove.pot', 
File.dirname(__FILE__))
+    expect(string_changes?(old_pot, new_pot)).to eq(true)
+  end
+
+  it 'should detect string changes' do
+    new_pot = File.absolute_path('../fixtures/pot_update/change.pot', 
File.dirname(__FILE__))
+    expect(string_changes?(old_pot, new_pot)).to eq(true)
+  end
+
+  it 'should not detect non-string changes' do
+    new_pot = 
File.absolute_path('../fixtures/pot_update/non_string_changes.pot', 
File.dirname(__FILE__))
+    expect(string_changes?(old_pot, new_pot)).to eq(false)
+  end
+end


Reply via email to