Hello community,
here is the log from the commit of package rubygem-gettext-setup for
openSUSE:Factory checked in at 2020-03-07 21:38:11
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-gettext-setup (Old)
and /work/SRC/openSUSE:Factory/.rubygem-gettext-setup.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-gettext-setup"
Sat Mar 7 21:38:11 2020 rev:13 rq:773764 version:0.34
Changes:
--------
---
/work/SRC/openSUSE:Factory/rubygem-gettext-setup/rubygem-gettext-setup.changes
2019-06-18 14:57:51.405348235 +0200
+++
/work/SRC/openSUSE:Factory/.rubygem-gettext-setup.new.26092/rubygem-gettext-setup.changes
2020-03-07 21:38:12.788271120 +0100
@@ -1,0 +2,6 @@
+Mon Feb 10 14:40:22 UTC 2020 - Stephan Kulow <[email protected]>
+
+- updated to version 0.34
+ no changelog found
+
+-------------------------------------------------------------------
Old:
----
gettext-setup-0.30.gem
New:
----
gettext-setup-0.34.gem
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ rubygem-gettext-setup.spec ++++++
--- /var/tmp/diff_new_pack.eSHkM9/_old 2020-03-07 21:38:14.424272224 +0100
+++ /var/tmp/diff_new_pack.eSHkM9/_new 2020-03-07 21:38:14.424272224 +0100
@@ -1,7 +1,7 @@
#
# spec file for package rubygem-gettext-setup
#
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -12,7 +12,7 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
@@ -24,7 +24,7 @@
#
Name: rubygem-gettext-setup
-Version: 0.30
+Version: 0.34
Release: 0
%define mod_name gettext-setup
%define mod_full_name %{mod_name}-%{version}
@@ -32,7 +32,7 @@
BuildRequires: %{ruby >= 1.9.2}
BuildRequires: %{rubygem gem2rpm}
BuildRequires: ruby-macros >= 5
-Url: https://github.com/puppetlabs/gettext-setup-gem
+URL: https://github.com/puppetlabs/gettext-setup-gem
Source: https://rubygems.org/gems/%{mod_full_name}.gem
Source1: gem2rpm.yml
Summary: A gem to ease internationalization with fast_gettext
++++++ gettext-setup-0.30.gem -> gettext-setup-0.34.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/README.md new/README.md
--- old/README.md 2018-02-12 19:21:38.000000000 +0100
+++ new/README.md 2020-01-10 10:19:22.000000000 +0100
@@ -67,7 +67,7 @@
Pluralization rules vary across languages. The pluralization rules are
specified in the PO file and look something like this `Plural-Forms:
nplurals=2; plural=(n > 1);`. This is the pluralization rule for German. It
means that German has two pluralization rules. The first rule is `plural=n >
1)` and the second rule is all other counts.
-Plurals are selected from the PO file by index.
+Plurals are selected from the PO file by index.
Here's an example of how a pluralized string is handled in a PO file:
@@ -84,7 +84,7 @@
The two `msgstr` lines show that German has two rules for pluralization. The
indices map to the `Plural-Forms: nplurals=2; plural=(n > 1);` rule that we
specified in the PO file. The `[0]` index represents `plural=(n > 1)` and the
`[1]` index represents all other pluralization cases (in other words, when the
count equals 0 or 1).
-When Transifex generates a PO file for a specific language, it automatically
adds the appropriate pluralization rules in the PO file.
+When Transifex generates a PO file for a specific language, it automatically
adds the appropriate pluralization rules in the PO file.
### Comments
To provide translators with some contextual information or instructions about
a string, precede the string with a comment using `#. `. The comment gets
pulled in to the POT file and will show up as a comment in Transifex.
@@ -99,7 +99,7 @@
3. When a POT file is updated, the Transifex webhook pushes the new POT file
to Transifex ready for translation. (If your POT file hasn't been added to the
Transifex integration yet, you will need to get it added.)
-4. When a PO file reaches 100% translated and reviewed, a webhook pushes it
back to the source repo ready to be consumed by your app.
+4. When a PO file reaches 100% translated and reviewed, a webhook pushes it
back to the source repo ready to be consumed by your app.
5. Your app checks the user's locale settings (the browser settings for web
apps, or the system settings for the CLI). If we support the user's preferred
locale, the app will display strings in the user's language. Otherwise, it
defaults to English.
@@ -113,3 +113,7 @@
By default, the merged pot file is locales_path/project_name.pot. This can be
overridden when calling the method by providing a chosen path.
Please note: Since the default merged file name is project_name.pot, it will
override anything of that name within the locales directory.
+
+## Making releases
+
+Add the tag you wish to release (via the bot in the release channel is
preferred) and then `gem build gettext-setup.gemspec` and then `gem push
gettext-setup-<version>.gem`. (you will need to be an owner to push).
\ No newline at end of file
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/generate_metadata_pot.rb
new/lib/generate_metadata_pot.rb
--- old/lib/generate_metadata_pot.rb 2018-02-12 19:21:38.000000000 +0100
+++ new/lib/generate_metadata_pot.rb 2020-01-10 10:19:22.000000000 +0100
@@ -1 +1,3 @@
+# frozen_string_literal: true
+
require 'metadata_pot/metadata_pot'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/gettext-setup/gettext_setup.rb
new/lib/gettext-setup/gettext_setup.rb
--- old/lib/gettext-setup/gettext_setup.rb 2018-02-12 19:21:38.000000000
+0100
+++ new/lib/gettext-setup/gettext_setup.rb 2020-01-10 10:19:22.000000000
+0100
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'fast_gettext'
require 'yaml'
require 'locale'
@@ -58,6 +60,7 @@
def self.config?
raise NoConfigFoundError, File.join(locales_path, 'config.yaml') unless
@config
+
@config
end
@@ -113,9 +116,11 @@
# return the default locale
def self.negotiate_locale(accept_header)
unless @config
- raise ArgumentError, 'No config.yaml found! Use
`GettextSetup.initialize(locales_path)` to locate your config.yaml'
+ raise ArgumentError, 'No config.yaml found! Use ' \
+ '`GettextSetup.initialize(locales_path)` to locate your config.yaml'
end
return FastGettext.default_locale if accept_header.nil?
+
available_locales = accept_header.split(',').map do |locale|
pair = locale.strip.split(';q=')
pair << '1.0' unless pair.size == 2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/gettext-setup/metadata_pot.rb
new/lib/gettext-setup/metadata_pot.rb
--- old/lib/gettext-setup/metadata_pot.rb 2018-02-12 19:21:38.000000000
+0100
+++ new/lib/gettext-setup/metadata_pot.rb 2020-01-10 10:19:22.000000000
+0100
@@ -1,5 +1,8 @@
+# frozen_string_literal: true
+
require 'erb'
require 'json'
+require 'date'
module GettextSetup
module MetadataPot
@@ -13,7 +16,7 @@
def self.metadata(metadata_file = 'metadata.json')
if File.exist?(metadata_file)
- file = open(metadata_file)
+ file = File.open(metadata_file)
json = file.read
JSON.parse(json)
else
@@ -28,7 +31,7 @@
end
def self.generate_metadata_pot(pot_metadata = metadata, path =
metadata_path)
- open(path, 'w') do |f|
+ File.open(path, 'w') do |f|
f << pot_string(pot_metadata)
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/gettext-setup/pot.rb new/lib/gettext-setup/pot.rb
--- old/lib/gettext-setup/pot.rb 2018-02-12 19:21:38.000000000 +0100
+++ new/lib/gettext-setup/pot.rb 2020-01-10 10:19:22.000000000 +0100
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'open3'
require 'English'
require 'tempfile'
@@ -25,28 +27,39 @@
def self.pot_file_path
return if GettextSetup.locales_path.nil?
+
return if GettextSetup.config['project_name'].nil?
+
File.join(GettextSetup.locales_path, GettextSetup.config['project_name']
+ '.pot')
end
def self.po_file_path(language)
return if GettextSetup.locales_path.nil?
+
return if GettextSetup.config['project_name'].nil?
+
return if language.nil?
+
File.join(GettextSetup.locales_path, language,
GettextSetup.config['project_name'] + '.po')
end
def self.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 if status.exitstatus == 1 || \
+ /this message is not used/.match(stderr) || \
+ /this message is used but not defined/.match(stderr)
+
+ if stderr =~ /msgcmp: command not found/
+ puts 'Warning - msgcmp is not present on the system'
return true
end
- return false
+
+ false
rescue IOError
# probably means msgcmp is not present on the system
# so return true to be on the safe side
- return true
+ true
end
# @param [:locales_path] opts
@@ -176,6 +189,7 @@
_, _, _, wait = Open3.popen3(cmd)
exitstatus = wait.value
raise 'PO files failed to merge' unless exitstatus.success?
+
puts "PO files have been successfully merged, #{target_filename} has
been created."
exitstatus
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/gettext-setup.rb new/lib/gettext-setup.rb
--- old/lib/gettext-setup.rb 2018-02-12 19:21:38.000000000 +0100
+++ new/lib/gettext-setup.rb 2020-01-10 10:19:22.000000000 +0100
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'gettext-setup/gettext_setup'
require 'gettext-setup/metadata_pot'
require 'gettext-setup/pot'
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 2018-02-12 19:21:38.000000000 +0100
+++ new/lib/tasks/gettext.rake 2020-01-10 10:19:22.000000000 +0100
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_relative '../gettext-setup/gettext_setup'
require_relative '../gettext-setup/pot'
require_relative '../gettext-setup/metadata_pot'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata 2018-02-12 19:21:38.000000000 +0100
+++ new/metadata 2020-01-10 10:19:22.000000000 +0100
@@ -1,14 +1,14 @@
--- !ruby/object:Gem::Specification
name: gettext-setup
version: !ruby/object:Gem::Version
- version: '0.30'
+ version: '0.34'
platform: ruby
authors:
- Puppet
autorequire:
bindir: bin
cert_chain: []
-date: 2018-02-12 00:00:00.000000000 Z
+date: 2020-01-10 00:00:00.000000000 Z
dependencies:
- !ruby/object:Gem::Dependency
name: fast_gettext
@@ -31,6 +31,9 @@
- - ">="
- !ruby/object:Gem::Version
version: 3.0.2
+ - - "<"
+ - !ruby/object:Gem::Version
+ version: 3.3.0
type: :runtime
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
@@ -38,6 +41,9 @@
- - ">="
- !ruby/object:Gem::Version
version: 3.0.2
+ - - "<"
+ - !ruby/object:Gem::Version
+ version: 3.3.0
- !ruby/object:Gem::Dependency
name: locale
requirement: !ruby/object:Gem::Requirement
@@ -56,16 +62,16 @@
name: bundler
requirement: !ruby/object:Gem::Requirement
requirements:
- - - "~>"
+ - - ">="
- !ruby/object:Gem::Version
- version: '1.3'
+ version: '0'
type: :development
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - - "~>"
+ - - ">="
- !ruby/object:Gem::Version
- version: '1.3'
+ version: '0'
- !ruby/object:Gem::Dependency
name: rake
requirement: !ruby/object:Gem::Requirement
@@ -223,32 +229,31 @@
- !ruby/object:Gem::Version
version: '0'
requirements: []
-rubyforge_project:
-rubygems_version: 2.5.1
+rubygems_version: 3.0.3
signing_key:
specification_version: 4
summary: A gem to ease internationalization with fast_gettext
test_files:
+- spec/spec_helper.rb
+- spec/lib/tasks/gettext_rake_spec.rb
+- spec/lib/gettext-setup/pot_spec.rb
+- spec/lib/gettext-setup/metadata_pot_spec.rb
+- spec/lib/gettext-setup/gettext_setup_spec.rb
+- spec/fixtures/fixture_locales/test_strings.rb
- spec/fixtures/fixture_locales/config.yaml
- spec/fixtures/fixture_locales/fixture_locales.pot
- spec/fixtures/fixture_locales/jp/fixture_locales.po
-- spec/fixtures/fixture_locales/test_strings.rb
+- spec/fixtures/locales/sinatra-i18n.pot
- spec/fixtures/locales/config.yaml
- spec/fixtures/locales/de/sinatra-i18n.po
-- spec/fixtures/locales/sinatra-i18n.pot
- spec/fixtures/merge_locales/config.yaml
-- spec/fixtures/spec_locales/config.yaml
-- spec/fixtures/spec_locales/sinatra-i18n.pot
-- spec/fixtures/string_changes/add.pot
-- spec/fixtures/string_changes/change.pot
- spec/fixtures/string_changes/non_string_changes.pot
-- spec/fixtures/string_changes/old.pot
- spec/fixtures/string_changes/remove.pot
+- spec/fixtures/string_changes/old.pot
+- spec/fixtures/string_changes/change.pot
+- spec/fixtures/string_changes/add.pot
+- spec/fixtures/spec_locales/sinatra-i18n.pot
+- spec/fixtures/spec_locales/config.yaml
+- spec/fixtures/tmp_locales/sinatra-i18n.pot
- spec/fixtures/tmp_locales/config.yaml
- spec/fixtures/tmp_locales/de/sinatra-i18n.po
-- spec/fixtures/tmp_locales/sinatra-i18n.pot
-- spec/lib/gettext-setup/gettext_setup_spec.rb
-- spec/lib/gettext-setup/metadata_pot_spec.rb
-- spec/lib/gettext-setup/pot_spec.rb
-- spec/lib/tasks/gettext_rake_spec.rb
-- spec/spec_helper.rb
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/spec/fixtures/fixture_locales/test_strings.rb
new/spec/fixtures/fixture_locales/test_strings.rb
--- old/spec/fixtures/fixture_locales/test_strings.rb 2018-02-12
19:21:38.000000000 +0100
+++ new/spec/fixtures/fixture_locales/test_strings.rb 2020-01-10
10:19:22.000000000 +0100
@@ -1 +1,3 @@
+# frozen_string_literal: true
+
_('Hello, world!')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/spec/lib/gettext-setup/gettext_setup_spec.rb
new/spec/lib/gettext-setup/gettext_setup_spec.rb
--- old/spec/lib/gettext-setup/gettext_setup_spec.rb 2018-02-12
19:21:38.000000000 +0100
+++ new/spec/lib/gettext-setup/gettext_setup_spec.rb 2020-01-10
10:19:23.000000000 +0100
@@ -1,3 +1,6 @@
+# encoding: utf-8
+# frozen_string_literal: true
+
require 'rspec/expectations'
require_relative '../../spec_helper'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/spec/lib/gettext-setup/metadata_pot_spec.rb
new/spec/lib/gettext-setup/metadata_pot_spec.rb
--- old/spec/lib/gettext-setup/metadata_pot_spec.rb 2018-02-12
19:21:38.000000000 +0100
+++ new/spec/lib/gettext-setup/metadata_pot_spec.rb 2020-01-10
10:19:23.000000000 +0100
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'rspec/expectations'
require 'tmpdir'
require_relative '../../spec_helper'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/spec/lib/gettext-setup/pot_spec.rb
new/spec/lib/gettext-setup/pot_spec.rb
--- old/spec/lib/gettext-setup/pot_spec.rb 2018-02-12 19:21:38.000000000
+0100
+++ new/spec/lib/gettext-setup/pot_spec.rb 2020-01-10 10:19:23.000000000
+0100
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'rspec/expectations'
require 'tmpdir'
require_relative '../../spec_helper.rb'
@@ -60,7 +62,7 @@
expect(contents).to match(/Fixture locales/)
expect(contents).to match(/[email protected]/)
expect(contents).to match(/Puppet, LLC/)
- expect(contents).to match(/test_strings.rb:1/)
+ expect(contents).to match(/test_strings.rb:3/)
end
it 'builds a POT file with :header_only' do
path = File.join(Dir.mktmpdir, 'new.pot')
@@ -82,6 +84,8 @@
expect { GettextSetup::Pot.generate_new_po('ja', Dir.mktmpdir, path,
po_path) }.to raise_error(NoConfigFoundError)
end
it 'complains when no language is supplied' do
+ allow(ENV).to receive(:[]).and_call_original
+ allow(ENV).to receive(:[]).with('LANGUAGE').and_return(nil)
result = "You need to specify the language to add. Either 'LANGUAGE=eo
rake gettext:po' or 'rake gettext:po[LANGUAGE]'\n"
expect do
GettextSetup::Pot.generate_new_po(nil, fixture_locales_path,
Dir.mktmpdir, Dir.mktmpdir)
@@ -164,7 +168,7 @@
before :all do
{ 'ruby' => 'ruby.pot', 'puppet' => 'puppet.pot', 'metadata' =>
'metadata.pot' }.each do |pot_type, pot_name|
File.open(File.join(merge_locales_path, pot_name), 'w') do |file|
- file.write <<-POT
+ file.write <<POT
# Copyright (C) 2017 Puppet, Inc.
# This file is distributed under the same license as the puppetlabs-mysql
package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2017.
@@ -186,7 +190,7 @@
#: ../lib/puppet/parser/functions/mysql_strip_hash.rb:11
msgid "this is a #{pot_type} string"
msgstr ""
- POT
+POT
end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/spec/lib/tasks/gettext_rake_spec.rb
new/spec/lib/tasks/gettext_rake_spec.rb
--- old/spec/lib/tasks/gettext_rake_spec.rb 2018-02-12 19:21:38.000000000
+0100
+++ new/spec/lib/tasks/gettext_rake_spec.rb 2020-01-10 10:19:23.000000000
+0100
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'rspec/expectations'
require 'rake'
require_relative '../../spec_helper.rb'
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 2018-02-12 19:21:38.000000000 +0100
+++ new/spec/spec_helper.rb 2020-01-10 10:19:23.000000000 +0100
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'simplecov'
require_relative '../lib/gettext-setup'
@@ -10,9 +12,9 @@
def cmd_present?(cmd)
# Try to call out to msgcmp, if it doesn't error, we have the tool
`#{cmd} --version`
- return true
+ true
rescue IOError
- return false
+ false
end
def msgcmp_present?