[DRE-commits] [ruby-gherkin] 02/03: [patch] fix encoding issues with Ruby2.1 (Closes: #744807)
Cédric Boutillier
boutil at moszumanska.debian.org
Fri Apr 25 11:45:59 UTC 2014
This is an automated email from the git hooks/post-receive script.
boutil pushed a commit to branch master
in repository ruby-gherkin.
commit ec64b8dbad2a093d3ca7d345cce7b4cd620507d3
Author: Cédric Boutillier <boutil at debian.org>
Date: Fri Apr 25 13:38:27 2014 +0200
[patch] fix encoding issues with Ruby2.1 (Closes: #744807)
---
debian/patches/encoding_ruby21.patch | 45 ++++++++++++++++++++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 46 insertions(+)
diff --git a/debian/patches/encoding_ruby21.patch b/debian/patches/encoding_ruby21.patch
new file mode 100644
index 0000000..84ac5a4
--- /dev/null
+++ b/debian/patches/encoding_ruby21.patch
@@ -0,0 +1,45 @@
+Description: change regexp match on Ruby version to handle Ruby2.1
+ in order to known when to use Encoding features.
+ This change makes ruby-gherkin compatible with Ruby2.1.
+ Use something like defined? Encoding may not work since Gherkin as an Encoding
+ class.
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=744807
+Bug: https://github.com/cucumber/gherkin/issues/305
+Forwarded: https://github.com/cucumber/gherkin/pull/306
+Origin: vendor
+Author: Cédric Boutillier <boutil at debian.org>
+Last-Update: 2014-04-25
+
+--- a/spec/spec_helper.rb
++++ b/spec/spec_helper.rb
+@@ -6,7 +6,7 @@
+ result
+ end
+
+-if RUBY_VERSION =~ /1\.9|2\.0/
++if RUBY_VERSION =~ /^(1\.9|2\.)/
+ silence_warnings do
+ Encoding.default_external = Encoding::UTF_8
+ Encoding.default_internal = Encoding::UTF_8
+--- a/ragel/lexer.rb.rl.erb
++++ b/ragel/lexer.rb.rl.erb
+@@ -165,7 +165,7 @@
+ utf8_pack(rest[0..rest.index(10)||-1]).strip # 10 is \n
+ end
+
+- if (RUBY_VERSION =~ /^1\.9|2\.0/)
++ if (RUBY_VERSION =~ /^(1\.9|2\.)/)
+ def utf8_pack(array)
+ array.pack("c*").force_encoding("UTF-8")
+ end
+--- a/lib/gherkin/formatter/pretty_formatter.rb
++++ b/lib/gherkin/formatter/pretty_formatter.rb
+@@ -199,7 +199,7 @@
+ end
+ end
+
+- if(RUBY_VERSION =~ /^1\.9|2\.0/)
++ if(RUBY_VERSION =~ /^(1\.9|2\.)/)
+ START = /#{'^'.encode('UTF-8')}/
+ TRIPLE_QUOTES = /#{'"""'.encode('UTF-8')}/
+ else
diff --git a/debian/patches/series b/debian/patches/series
index bb43907..bca75a1 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@ fix_path_ragel_task.patch
same_sed_all_arches.patch
skip_beautify_ragel_task.patch
skip_encoding_lexer.patch
+encoding_ruby21.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-gherkin.git
More information about the Pkg-ruby-extras-commits
mailing list