[DRE-commits] [SCM] ruby-ogginfo.git branch, master, updated. upstream/0.6.5-4-g9a8f23b

Gunnar Wolf gwolf at gwolf.org
Thu Aug 11 23:19:03 UTC 2011


The following commit has been merged in the master branch:
commit 9a8f23bead9658e20e00e010c36271a4fc77a717
Author: Gunnar Wolf <gwolf at gwolf.org>
Date:   Thu Aug 11 18:18:55 2011 -0500

    Fix an encoding issue breaking all tests under Ruby 1.9.1

diff --git a/debian/patches/encoding_fixes_for_1.9.1 b/debian/patches/encoding_fixes_for_1.9.1
new file mode 100644
index 0000000..219d18b
--- /dev/null
+++ b/debian/patches/encoding_fixes_for_1.9.1
@@ -0,0 +1,66 @@
+Author: Gunnar Wolf <gwolf at debian.org>
+Last-Update: 2011-08-11
+Forwarded: https://github.com/gwolf/ruby-ogginfo/commit/558f420f1d2b5870d74241354669c0ca3d57b7b9 (pull request on github)
+Description: Fix an encoding issue breaking all tests under Ruby 1.9.1
+ Strings in Ruby 1.9.1 are no longer defined as an array of bytes, but
+ as an array of (encoding-aware) characters. This forces a string to
+ be built as a series of bytes, and allows the tests to pass.
+
+Index: ruby-ogginfo/test/test_ruby-ogginfo.rb
+===================================================================
+--- ruby-ogginfo.orig/test/test_ruby-ogginfo.rb	2011-08-11 18:09:16.000000000 -0500
++++ ruby-ogginfo/test/test_ruby-ogginfo.rb	2011-08-11 18:09:21.000000000 -0500
+@@ -146,7 +146,10 @@
+     end
+ 
+     OggInfo.open(tf.path, "iso-8859-1") do |ogg|
+-      assert_equal "hello\xe9", ogg.tag["title"] 
++      string = ''
++      string.force_encoding 'iso-8859-1'
++      [104, 101, 108, 108, 111, 233].each {|chr| string << chr}
++      assert_equal string, ogg.tag["title"] 
+     end
+   end
+ 
+Index: ruby-ogginfo/test/test_ruby-spxinfo.rb
+===================================================================
+--- ruby-ogginfo.orig/test/test_ruby-spxinfo.rb	2011-08-11 18:09:16.000000000 -0500
++++ ruby-ogginfo/test/test_ruby-spxinfo.rb	2011-08-11 18:09:21.000000000 -0500
+@@ -91,12 +91,33 @@
+   def test_charset
+     generate_spx
+     FileUtils.cp("test.spx",GEN_FILE)
+-    OggInfo.open(GEN_FILE, "utf-8") do |spx|
++    if RUBY_VERSION[0..2] == '1.8'
++      OggInfo.open(GEN_FILE, "utf-8") do |spx|
+     	assert_equal "hello\303\251",spx.tag["test"] 
+-    end
++      end
++
++      OggInfo.open(GEN_FILE, "iso-8859-1") do |spx|
++        assert_equal "hello\xe9", spx.tag["test"] 
++      end
++
++    else
++      # In Ruby >= 1.9, all strings are UTF-8, and are made up by
++      # characters (and not anymore bytes). So, we hand-craft it in a
++      # dumb-enough encoding.
++      OggInfo.open(GEN_FILE, "utf-8") do |spx|
++        string = ''
++        string.force_encoding 'ascii-8bit'
++        [104, 101, 108, 108, 111, 195, 169].each {|chr| string << chr}
++        assert_equal string, spx.tag["test"]
++      end
++
++      OggInfo.open(GEN_FILE, "iso-8859-1") do |spx|
++        string = ''
++        string.force_encoding 'iso-8859-1'
++        [104, 101, 108, 108, 111, 233].each {|chr| string << chr}
++        assert_equal string, spx.tag["test"]
++      end
+ 
+-    OggInfo.open(GEN_FILE, "iso-8859-1") do |spx|
+-      assert_equal "hello\xe9", spx.tag["test"] 
+     end
+   end
+   
diff --git a/debian/patches/series b/debian/patches/series
index a1fe824..7f4b65c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
+encoding_fixes_for_1.9.1
 class_eval_requires_strings_under_1.9.1

-- 
ruby-ogginfo.git



More information about the Pkg-ruby-extras-commits mailing list