[DRE-commits] [ruby-remcached] 01/03: add patch to force encoding of strings to ascii, fixing FTBS with ruby2.0

Cédric Boutillier boutil at moszumanska.debian.org
Sat Apr 26 00:26:36 UTC 2014


This is an automated email from the git hooks/post-receive script.

boutil pushed a commit to branch master
in repository ruby-remcached.

commit 92152b3566c96f39f2bc9c4bab996a02e21153b4
Author: Cédric Boutillier <boutil at debian.org>
Date:   Fri Apr 25 23:42:12 2014 +0200

    add patch to force encoding of strings to ascii, fixing FTBS with ruby2.0
---
 debian/patches/force_ascii_encoding.patch | 73 +++++++++++++++++++++++++++++++
 debian/patches/series                     |  1 +
 2 files changed, 74 insertions(+)

diff --git a/debian/patches/force_ascii_encoding.patch b/debian/patches/force_ascii_encoding.patch
new file mode 100644
index 0000000..30e9079
--- /dev/null
+++ b/debian/patches/force_ascii_encoding.patch
@@ -0,0 +1,73 @@
+Description: Force encoding of expected results to ASCII-8BIT
+ Ruby2.0 defaults to UTF-8, whereas strings @s are ASCII-8BIT
+Bug: https://github.com/astro/remcached/issues/5
+Forwarded: https://github.com/astro/remcached/pull/6
+Author: Cédric Boutillier <boutil at debian.org>
+Last-Update: 2014-04-26 
+
+--- a/spec/packet_spec.rb
++++ b/spec/packet_spec.rb
+@@ -16,13 +16,13 @@
+       end
+ 
+       it "should serialize correctly" do
+-        @s.should == "\x80\x00\x00\x05" +
++        @s.should == ("\x80\x00\x00\x05" +
+           "\x00\x00\x00\x00" +
+           "\x00\x00\x00\x05" +
+           "\x00\x00\x00\x00" +
+           "\x00\x00\x00\x00" +
+           "\x00\x00\x00\x00" +
+-          "Hello"
++          "Hello").force_encoding("ASCII-8BIT")
+       end
+     end
+ 
+@@ -36,7 +36,7 @@
+       end
+ 
+       it "should serialize correctly" do
+-        @s.should == "\x80\x02\x00\x05" +
++        @s.should == ("\x80\x02\x00\x05" +
+           "\x08\x00\x00\x00" +
+           "\x00\x00\x00\x12" +
+           "\x00\x00\x00\x00" +
+@@ -45,7 +45,7 @@
+           "\xde\xad\xbe\xef" +
+           "\x00\x00\x0e\x10" +
+           "Hello" +
+-          "World"
++          "World").force_encoding("ASCII-8BIT")
+       end
+     end
+   end
+@@ -53,10 +53,10 @@
+   context "when parsing a response" do
+     context "example 4.1.1" do
+       before :all do
+-        s = "\x81\x00\x00\x00\x00\x00\x00\x01" +
++        s = ("\x81\x00\x00\x00\x00\x00\x00\x01" +
+           "\x00\x00\x00\x09\x00\x00\x00\x00" +
+           "\x00\x00\x00\x00\x00\x00\x00\x00" +
+-          "Not found"
++          "Not found").force_encoding("ASCII-8BIT")
+         @pkt = Memcached::Response.parse_header(s[0..23])
+         @pkt.parse_body(s[24..-1])
+       end
+@@ -87,14 +87,14 @@
+ 
+     context "example 4.2.1" do
+       before :all do
+-        s =  "\x81\x00\x00\x00" +
++        s =  ("\x81\x00\x00\x00" +
+           "\x04\x00\x00\x00" +
+           "\x00\x00\x00\x09" +
+           "\x00\x00\x00\x00" +
+           "\x00\x00\x00\x00" +
+           "\x00\x00\x00\x01" +
+           "\xde\xad\xbe\xef" +
+-          "World"
++          "World").force_encoding("ASCII-8BIT")
+         @pkt = Memcached::Response.parse_header(s[0..23])
+         @pkt.parse_body(s[24..-1])
+       end
diff --git a/debian/patches/series b/debian/patches/series
index e9906d7..b0a4653 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 add-license-from-upstream-git.patch
 change-memcached-port.patch
+force_ascii_encoding.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-remcached.git



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