Blame SOURCES/rubygem-erubis-2.7-Add-support-for-Ruby-2.1.patch

433bc1
From 4a986d3a8f3cc4bfeacf1c1def3c6375c4866dfe Mon Sep 17 00:00:00 2001
433bc1
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
433bc1
Date: Mon, 23 Jun 2014 14:25:16 +0200
433bc1
Subject: [PATCH] Add support for Ruby 2.1.
433bc1
433bc1
---
433bc1
 test/test-main.rb        | 2 +-
433bc1
 test/test-users-guide.rb | 2 +-
433bc1
 test/testutil.rb         | 4 ++++
433bc1
 3 files changed, 6 insertions(+), 2 deletions(-)
433bc1
433bc1
diff --git a/test/test-main.rb b/test/test-main.rb
433bc1
index e4d6c2a..9dbe12e 100644
433bc1
--- a/test/test-main.rb
433bc1
+++ b/test/test-main.rb
433bc1
@@ -273,7 +273,7 @@ END
433bc1
       errmsgs << <<'END'
433bc1
 7: syntax error, unexpected $end, expecting keyword_end
433bc1
 END
433bc1
-    elsif ruby20?
433bc1
+    elsif ruby20? || ruby21?
433bc1
       errmsgs << <<'END'
433bc1
 3: syntax error, unexpected ']', expecting ')'
433bc1
  _buf << '  
  • '; _buf << ( item[:name]] ).to_s; _buf << '
  • 433bc1
    diff --git a/test/test-users-guide.rb b/test/test-users-guide.rb
    433bc1
    index b89706b..fee5435 100644
    433bc1
    --- a/test/test-users-guide.rb
    433bc1
    +++ b/test/test-users-guide.rb
    433bc1
    @@ -28,7 +28,7 @@ class KwarkUsersGuideTest < Test::Unit::TestCase
    433bc1
         s =~ /\A\$ (.*?)\n/
    433bc1
         command = $1
    433bc1
         expected = $'
    433bc1
    -    if ruby19? || ruby20?
    433bc1
    +    if ruby19? || ruby20? || ruby21?
    433bc1
           case @name
    433bc1
           when 'test_main_program1_result'
    433bc1
             expected.sub!('["eruby", "items", "x", "_buf"]', '[:_buf, :eruby, :items, :x]')
    433bc1
    diff --git a/test/testutil.rb b/test/testutil.rb
    433bc1
    index 59c3779..1b841c3 100644
    433bc1
    --- a/test/testutil.rb
    433bc1
    +++ b/test/testutil.rb
    433bc1
    @@ -21,6 +21,10 @@ def ruby20?  # :nodoc:
    433bc1
       RUBY_VERSION =~ /\A2.0/
    433bc1
     end
    433bc1
     
    433bc1
    +def ruby21?  # :nodoc:
    433bc1
    +  RUBY_VERSION =~ /\A2.1/
    433bc1
    +end
    433bc1
    +
    433bc1
     def rubinius?  # :nodoc:
    433bc1
       defined?(RUBY_ENGINE) && RUBY_ENGINE == "rbx"
    433bc1
     end
    433bc1
    -- 
    433bc1
    1.9.0
    433bc1