Blame SOURCES/rubygem-erubis-2.7.0-Add-support-for-Ruby-2.2.patch

3322d9
From 82d85b70f66de8c8c6f6ecb52f6536711c1de591 Mon Sep 17 00:00:00 2001
3322d9
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
3322d9
Date: Wed, 21 Jan 2015 16:46:45 +0100
3322d9
Subject: [PATCH] Add support for Ruby 2.2.
3322d9
3322d9
---
3322d9
 test/test-main.rb        | 4 ++--
3322d9
 test/test-users-guide.rb | 2 +-
3322d9
 test/testutil.rb         | 4 ++++
3322d9
 3 files changed, 7 insertions(+), 3 deletions(-)
3322d9
3322d9
diff --git a/test/test-main.rb b/test/test-main.rb
3322d9
index 9dbe12e..eca7b21 100644
3322d9
--- a/test/test-main.rb
3322d9
+++ b/test/test-main.rb
3322d9
@@ -216,7 +216,7 @@ END
3322d9
     begin
3322d9
       ENV['PATH'] = bindir + File::PATH_SEPARATOR + ENV['PATH']
3322d9
       ENV['_'] = 'erubis'
3322d9
-      Tempfile.open(self.name.gsub(/[^\w]/,'_')) do |f|
3322d9
+      Tempfile.open(self.method_name.gsub(/[^\w]/,'_')) do |f|
3322d9
         f.write(INPUT)
3322d9
         f.flush
3322d9
         yield(f.path)
3322d9
@@ -273,7 +273,7 @@ END
3322d9
       errmsgs << <<'END'
3322d9
 7: syntax error, unexpected $end, expecting keyword_end
3322d9
 END
3322d9
-    elsif ruby20? || ruby21?
3322d9
+    elsif ruby20? || ruby21? || ruby22?
3322d9
       errmsgs << <<'END'
3322d9
 3: syntax error, unexpected ']', expecting ')'
3322d9
  _buf << '  
  • '; _buf << ( item[:name]] ).to_s; _buf << '
  • 3322d9
    diff --git a/test/test-users-guide.rb b/test/test-users-guide.rb
    3322d9
    index fee5435..af6c006 100644
    3322d9
    --- a/test/test-users-guide.rb
    3322d9
    +++ b/test/test-users-guide.rb
    3322d9
    @@ -28,7 +28,7 @@ class KwarkUsersGuideTest < Test::Unit::TestCase
    3322d9
         s =~ /\A\$ (.*?)\n/
    3322d9
         command = $1
    3322d9
         expected = $'
    3322d9
    -    if ruby19? || ruby20? || ruby21?
    3322d9
    +    if ruby19? || ruby20? || ruby21? || ruby22?
    3322d9
           case @name
    3322d9
           when 'test_main_program1_result'
    3322d9
             expected.sub!('["eruby", "items", "x", "_buf"]', '[:_buf, :eruby, :items, :x]')
    3322d9
    diff --git a/test/testutil.rb b/test/testutil.rb
    3322d9
    index 1b841c3..e9130b7 100644
    3322d9
    --- a/test/testutil.rb
    3322d9
    +++ b/test/testutil.rb
    3322d9
    @@ -25,6 +25,10 @@ def ruby21?  # :nodoc:
    3322d9
       RUBY_VERSION =~ /\A2.1/
    3322d9
     end
    3322d9
     
    3322d9
    +def ruby22?  # :nodoc:
    3322d9
    +  RUBY_VERSION =~ /\A2.2/
    3322d9
    +end
    3322d9
    +
    3322d9
     def rubinius?  # :nodoc:
    3322d9
       defined?(RUBY_ENGINE) && RUBY_ENGINE == "rbx"
    3322d9
     end
    3322d9
    -- 
    3322d9
    2.1.0
    3322d9