[DRE-commits] [SCM] ruby-afm.git branch, master, updated. upstream/0.2.0-7-gd180913

Cédric Boutillier boutil at debian.org
Tue Jun 25 21:26:10 UTC 2013


The following commit has been merged in the master branch:
commit d346188e7669f630283a06aeaefff98765cba865
Author: Cédric Boutillier <boutil at debian.org>
Date:   Tue Jun 25 22:53:35 2013 +0200

    add compatibility patch for several Ruby versions

diff --git a/debian/patches/ruby_compatibility.patch b/debian/patches/ruby_compatibility.patch
new file mode 100644
index 0000000..9a779b7
--- /dev/null
+++ b/debian/patches/ruby_compatibility.patch
@@ -0,0 +1,31 @@
+Description: fix #metrics_for to work across ruby 1.8, 1.9 and 2.0
+ * on 1.8 String#[] returns the character code at that position as an int
+ * on 1.9+ String#[] returns a single character string
+Author: James Healy <james at yob.id.auto>
+Origin: https://github.com/halfbyte/afm/commit/0718e0f1d0e46f5b6c0325dfd6f5f3abf7533110
+Reviewed-by: Cédric Boutillier <boutil at debian.org>
+Last-Update: 2013-04-01
+---
+ lib/afm.rb | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/afm.rb b/lib/afm.rb
+index 62af0b3..dfbe415 100644
+--- a/lib/afm.rb
++++ b/lib/afm.rb
+@@ -95,9 +95,9 @@ def metrics_for(char)
+       glyph = if (char.kind_of?(Integer))
+         ISO_LATIN1_ENCODING[char]
+       else
+-        ISO_LATIN1_ENCODING[char[0]]
++        ISO_LATIN1_ENCODING[char.unpack("C*").first]
+       end
+       @char_metrics[glyph]
+     end
+   end
+-end
+\ No newline at end of file
++end
+-- 
+1.8.1.6
+
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..6d53e5d
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+ruby_compatibility.patch

-- 
ruby-afm.git



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