commit rubygem-yast-rake for openSUSE:Factory
Hello community, here is the log from the commit of package rubygem-yast-rake for openSUSE:Factory checked in at 2014-11-24 11:11:00 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-yast-rake (Old) and /work/SRC/openSUSE:Factory/.rubygem-yast-rake.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "rubygem-yast-rake" Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-yast-rake/rubygem-yast-rake.changes 2014-11-02 16:28:06.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.rubygem-yast-rake.new/rubygem-yast-rake.changes 2014-11-24 11:11:04.000000000 +0100 @@ -1,0 +2,8 @@ +Thu Nov 13 09:26:46 UTC 2014 - lslezak@suse.cz + +- new tasks: + - "pot" - collect translatable strings and create *.pot files + - "check:pot" - check for common mistakes in translations +- 0.1.10 + +------------------------------------------------------------------- Old: ---- yast-rake-0.1.9.gem New: ---- yast-rake-0.1.10.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-yast-rake.spec ++++++ --- /var/tmp/diff_new_pack.KwtbK1/_old 2014-11-24 11:11:05.000000000 +0100 +++ /var/tmp/diff_new_pack.KwtbK1/_new 2014-11-24 11:11:05.000000000 +0100 @@ -17,7 +17,7 @@ Name: rubygem-yast-rake -Version: 0.1.9 +Version: 0.1.10 Release: 0 %define mod_name yast-rake %define mod_full_name %{mod_name}-%{version} ++++++ yast-rake-0.1.9.gem -> yast-rake-0.1.10.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/VERSION new/VERSION --- old/VERSION 1970-01-01 01:00:00.000000000 +0100 +++ new/VERSION 1970-01-01 01:00:00.000000000 +0100 @@ -1 +1 @@ -0.1.9 +0.1.10 Files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/tasks/pot.rake new/lib/tasks/pot.rake --- old/lib/tasks/pot.rake 1970-01-01 01:00:00.000000000 +0100 +++ new/lib/tasks/pot.rake 1970-01-01 01:00:00.000000000 +0100 @@ -0,0 +1,72 @@ +#-- +# Yast rake +# +# Copyright (C) 2014 Novell, Inc. +# This library is free software; you can redistribute it and/or modify +# it only under the terms of version 2.1 of the GNU Lesser General Public +# License as published by the Free Software Foundation. +# +# This library is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more +# details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +#++ + +desc "Collect translatable strings and create POT files" +task :pot do + y2tool = "/usr/bin/y2tool" + raise "File #{y2tool} is missing, install yast2-devtools" unless File.exist?(y2tool) + + sh "#{y2tool} y2makepot" +end + +namespace :check do + # print failed lines and a hint to STDERR + def report_pot_errors(lines) + $stderr.puts "Failed lines:" + $stderr.puts "-" * 30 + $stderr.puts lines + $stderr.puts "-" * 30 + $stderr.puts + $stderr.puts "Note: \#{foo} substitution in translatable strings does" \ + " not work properly, use" + $stderr.puts " _(\"foo %{bar} baz\") % { :bar => bar }" + $stderr.puts "or" + $stderr.puts " _(\"foo %s baz\") % bar" + $stderr.puts + end + + # remove gettext keywords and extra quotes + def clean_pot_lines(lines) + # leave just the text + lines.each do |line| + line.sub!(/^msgid \"/, "") + line.sub!(/^\"/, "") + line.sub!(/\"$/, "") + end + end + + desc "Check translatable strings for common mistakes" + # depends on the global "pot" task defined above + task :pot => :"rake:pot" do + Dir["*.pot"].each do |pot| + puts "Checking #{pot}..." + lines = File.readlines(pot) + # remove comments + lines.reject!{ |line| line.match(/^#/) } + # Ruby substitution present? + lines.select!{ |line| line.include?('#{') } + + clean_pot_lines(lines) + + if !lines.empty? + report_pot_errors(lines) + raise "ERROR: Ruby substitution found in a translatable string" + end + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 1970-01-01 01:00:00.000000000 +0100 +++ new/metadata 1970-01-01 01:00:00.000000000 +0100 @@ -1,14 +1,14 @@ --- !ruby/object:Gem::Specification name: yast-rake version: !ruby/object:Gem::Version - version: 0.1.9 + version: 0.1.10 platform: ruby authors: - Josef Reidinger autorequire: bindir: bin cert_chain: [] -date: 2014-10-29 00:00:00.000000000 Z +date: 2014-11-13 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: rake @@ -49,6 +49,7 @@ files: - lib/yast/rake.rb - lib/tasks/install.rake +- lib/tasks/pot.rake - lib/tasks/test_unit.rake - lib/tasks/version.rake - lib/tasks/run.rake -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@hilbert.suse.de