commit rubygem-puppet for openSUSE:Factory
Hello community, here is the log from the commit of package rubygem-puppet for openSUSE:Factory checked in at 2016-04-22 16:24:37 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-puppet (Old) and /work/SRC/openSUSE:Factory/.rubygem-puppet.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "rubygem-puppet" Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-puppet/rubygem-puppet.changes 2016-01-28 17:23:56.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.rubygem-puppet.new/rubygem-puppet.changes 2016-04-22 16:24:38.000000000 +0200 @@ -1,0 +2,6 @@ +Mon Apr 11 15:28:34 UTC 2016 - kstreitova@suse.com + +- add puppet-non_ASCII_user_comment.patch to fix non-ASCII + user comment with ruby >= 2.1 [bnc#971223] + +------------------------------------------------------------------- New: ---- puppet-non_ASCII_user_comment.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-puppet.spec ++++++ --- /var/tmp/diff_new_pack.LfLzym/_old 2016-04-22 16:24:39.000000000 +0200 +++ /var/tmp/diff_new_pack.LfLzym/_new 2016-04-22 16:24:39.000000000 +0200 @@ -68,6 +68,7 @@ Patch1: %{mod_name}-systemd-default.patch Patch2: %{mod_name}-ruby-2_2.patch Patch3: %{mod_name}-systemd-default-on-new-suse.patch +Patch4: %{mod_name}-non_ASCII_user_comment.patch # /MANUAL Summary: A network tool for managing many disparate systems License: Apache-2.0 @@ -86,6 +87,7 @@ %patch1 -p1 %patch2 -p1 %patch3 -p1 +%patch4 -p1 %gem_build %build ++++++ puppet-non_ASCII_user_comment.patch ++++++
From 302369f4c335ffb87983506dcac6679de22878cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Barboiron?= <ced@winkie.fr> Date: Thu, 28 May 2015 14:30:05 +0200 Subject: [PATCH] (PUP-4633) fix non-ASCII user comment with ruby >= 2.1
--- lib/puppet/type/user.rb | 6 ++++-- spec/unit/type/user_spec.rb | 21 ++++++++++++++------- 2 files changed, 18 insertions(+), 9 deletions(-) Index: puppet-3.8.5/lib/puppet/type/user.rb =================================================================== --- puppet-3.8.5.orig/lib/puppet/type/user.rb +++ puppet-3.8.5/lib/puppet/type/user.rb @@ -167,8 +167,10 @@ module Puppet newproperty(:comment) do desc "A description of the user. Generally the user's full name." - munge do |v| - v.respond_to?(:force_encoding) ? v.force_encoding(Encoding::ASCII_8BIT) : v + if RUBY_VERSION < "2.1.0" + munge do |v| + v.respond_to?(:force_encoding) ? v.force_encoding(Encoding::ASCII_8BIT) : v + end end end Index: puppet-3.8.5/spec/unit/type/user_spec.rb =================================================================== --- puppet-3.8.5.orig/spec/unit/type/user_spec.rb +++ puppet-3.8.5/spec/unit/type/user_spec.rb @@ -344,13 +344,20 @@ describe Puppet::Type.type(:user) do end end - describe "when managing comment on Ruby 1.9", :if => String.method_defined?(:encode) do - it "should force value encoding to ASCII-8BIT" do - value = 'abcd™' - value.encoding.should == Encoding::UTF_8 - user = described_class.new(:name => 'foo', :comment => value) - user[:comment].encoding.should == Encoding::ASCII_8BIT - user[:comment].should == value.force_encoding(Encoding::ASCII_8BIT) + describe "when managing comment" do + before :each do + @value = 'abcd™' + expect(@value.encoding).to eq(Encoding::UTF_8) + @user = described_class.new(:name => 'foo', :comment => @value) + end + + it "should be converted to ASCII_8BIT for ruby 1.9 / 2.0", :if => RUBY_VERSION < "2.1.0" && String.method_defined?(:encode) do + expect(@user[:comment].encoding).to eq(Encoding::ASCII_8BIT) + expect(@user[:comment]).to eq(@value.force_encoding(Encoding::ASCII_8BIT)) + end + + it "must not be converted for ruby >= 2.1", :if => RUBY_VERSION >= "2.1.0" do + expect(@user[:comment].encoding).to eq(Encoding::UTF_8) end end
participants (1)
-
root@hilbert.suse.de