Blame SOURCES/rubygem-erubis-2.7.0-ruby-2.0-compatibility.patch

d683aa
From 81a56bce3a41896310bd1bed733b894b0c094979 Mon Sep 17 00:00:00 2001
d683aa
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
d683aa
Date: Tue, 5 Mar 2013 10:02:31 +0100
d683aa
Subject: [PATCH 1/5] Fix embedded YAML to be compatible with Psych.
d683aa
d683aa
---
d683aa
 test/test-engines.rb | 32 +++++++++++++++++++++-----------
d683aa
 1 file changed, 21 insertions(+), 11 deletions(-)
d683aa
d683aa
diff --git a/test/test-engines.rb b/test/test-engines.rb
d683aa
index 8f0705a..a183231 100644
d683aa
--- a/test/test-engines.rb
d683aa
+++ b/test/test-engines.rb
d683aa
@@ -71,7 +71,8 @@ __END__
d683aa
 - name:  ruby2_options
d683aa
   lang:  ruby
d683aa
   class: Eruby
d683aa
-  options: { :bufvar: '@_out_buf' }
d683aa
+  options:
d683aa
+    :bufvar: '@_out_buf'
d683aa
   input: |
d683aa
       
d683aa
         <% for item in @items %>
d683aa
@@ -137,7 +138,9 @@ __END__
d683aa
 - name:  c1
d683aa
   lang:  c
d683aa
   class: Ec
d683aa
-  options: { :filename: foo.html, :indent: '  ' }
d683aa
+  options:
d683aa
+    :filename: foo.html
d683aa
+    :indent: '  '
d683aa
   input: |4
d683aa
       
d683aa
        
d683aa
@@ -167,7 +170,9 @@ __END__
d683aa
 - name:  cpp1
d683aa
   lang:  cpp
d683aa
   class: Ecpp
d683aa
-  options: { :filename: foo.html, :indent: '  ' }
d683aa
+  options:
d683aa
+    :filename: foo.html
d683aa
+    :indent: '  '
d683aa
   input: |4
d683aa
       
d683aa
        
d683aa
@@ -197,7 +202,10 @@ __END__
d683aa
 - name:  java1
d683aa
   lang:  java
d683aa
   class: Ejava
d683aa
-  options: { :buf: _buf, :bufclass: StringBuilder, :indent: '    ' }
d683aa
+  options:
d683aa
+    :buf: _buf,
d683aa
+    :bufclass: StringBuilder
d683aa
+    :indent: '    '
d683aa
   input: |
d683aa
       
d683aa
        
d683aa
@@ -220,19 +228,19 @@ __END__
d683aa
   expected: |4
d683aa
           StringBuilder _buf = new StringBuilder(); _buf.append("\n"
d683aa
                     + " \n");
d683aa
-           
d683aa
+      
d683aa
           int i = 0;
d683aa
           for (Iterator it = list.iterator(); it.hasNext(); ) {
d683aa
               String s = (String)it.next();
d683aa
               i++;
d683aa
-             
d683aa
+      
d683aa
           _buf.append("  \n"
d683aa
                     + "   "); _buf.append(i); _buf.append("\n"
d683aa
                     + "   "); _buf.append(escape(s)); _buf.append("\n"
d683aa
                     + "  \n");
d683aa
-           
d683aa
+      
d683aa
           }
d683aa
-          
d683aa
+      
d683aa
           _buf.append(" \n"
d683aa
                     + "\n");
d683aa
            System.err.println("*** debug: i="+(i)); _buf.append("\n");
d683aa
@@ -242,7 +250,7 @@ __END__
d683aa
   lang:  scheme
d683aa
   class: Escheme
d683aa
   options:
d683aa
-  input: &scheme1_input|
d683aa
+  input: &scheme1_input |
d683aa
       <% (let ((i 0)) %>
d683aa
       
d683aa
        
d683aa
@@ -290,7 +298,8 @@ __END__
d683aa
 - name:  scheme2
d683aa
   lang:  scheme
d683aa
   class: Escheme
d683aa
-  options: { :func: 'display' }
d683aa
+  options:
d683aa
+    :func: 'display'
d683aa
   input: *scheme1_input
d683aa
   expected: |4
d683aa
        (let ((i 0)) 
d683aa
@@ -401,7 +410,8 @@ __END__
d683aa
 - name:  javascript2
d683aa
   lang:  javascript
d683aa
   class: Ejavascript
d683aa
-  options: { :docwrite: false }
d683aa
+  options:
d683aa
+    :docwrite: false
d683aa
   input: *javascript_input
d683aa
   expected: |4
d683aa
       var _buf = [];
d683aa
-- 
d683aa
1.8.1.4
d683aa
d683aa
d683aa
From bbf33e57251d353ffe4789c7f4e445305b707d12 Mon Sep 17 00:00:00 2001
d683aa
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
d683aa
Date: Tue, 5 Mar 2013 10:03:23 +0100
d683aa
Subject: [PATCH 2/5] Fix embedded YAML to be compatible with Psych.
d683aa
d683aa
---
d683aa
 test/test-erubis.rb | 34 ++++++++++++++++++++--------------
d683aa
 1 file changed, 20 insertions(+), 14 deletions(-)
d683aa
d683aa
diff --git a/test/test-erubis.rb b/test/test-erubis.rb
d683aa
index ad00e5e..89e94f7 100644
d683aa
--- a/test/test-erubis.rb
d683aa
+++ b/test/test-erubis.rb
d683aa
@@ -220,13 +220,13 @@ y = 20
d683aa
 
d683aa
 __END__
d683aa
 - name:  basic1
d683aa
-  input: &basic1_input|
d683aa
+  input: &basic1_input |
d683aa
       
    d683aa
            <% for item in list %>
    d683aa
             
  • <%= item %>
  • d683aa
            <% end %>
    d683aa
           
    d683aa
    -  src: &basic1_src|
    d683aa
    +  src: &basic1_src |
    d683aa
           _buf = ''; _buf << '
      d683aa
             ';  for item in list 
      d683aa
              _buf << '  
    • '; _buf << ( item ).to_s; _buf << '
    • d683aa
      @@ -234,7 +234,7 @@ __END__
      d683aa
              _buf << '
      d683aa
             ';
      d683aa
             _buf.to_s
      d683aa
      -  output: &basic1_output|
      d683aa
      +  output: &basic1_output |
      d683aa
             
        d683aa
                 
      • <aaa>
      • d683aa
                 
      • b&b
      • d683aa
        @@ -344,7 +344,7 @@ __END__
        d683aa
         - name:  quotation1
        d683aa
           desc:  single quotation and backslash
        d683aa
           class: Eruby
        d683aa
        -  input: &quotation1_input|
        d683aa
        +  input: &quotation1_input |
        d683aa
               a = "'"
        d683aa
               b = "\""
        d683aa
               c = '\''
        d683aa
        @@ -451,7 +451,9 @@ __END__
        d683aa
         ##
        d683aa
         - name:  bodyonly1
        d683aa
           testopt:  skip_output
        d683aa
        -  options: { :preamble: no, :postamble: no }
        d683aa
        +  options:
        d683aa
        +   :preamble: no
        d683aa
        +   :postamble: no
        d683aa
           input: *basic1_input
        d683aa
           src: |4
        d683aa
                _buf << '
          d683aa
          @@ -496,7 +498,7 @@ __END__
          d683aa
           ##
          d683aa
           - name:  nomatch1
          d683aa
             desc:  bug
          d683aa
          -  input: &nomatch1|
          d683aa
          +  input: &nomatch1 |
          d683aa
                 
            d683aa
                     
          • foo
          • d683aa
                   
            d683aa
            @@ -510,7 +512,8 @@ __END__
            d683aa
             
            d683aa
             ##
            d683aa
             - name:  escape1
            d683aa
            -  options: { :escape: true }
            d683aa
            +  options:
            d683aa
            +   :escape: true
            d683aa
               input: |
            d683aa
                   <% str = '<>&"' %>
            d683aa
                   <%= str %>
            d683aa
            @@ -570,7 +573,7 @@ __END__
            d683aa
             ##
            d683aa
             - name:  optimized1
            d683aa
               class: OptimizedEruby
            d683aa
            -  input: &optimized1_input|
            d683aa
            +  input: &optimized1_input |
            d683aa
                   
            d683aa
                    <% for item in list %>
            d683aa
                     
            d683aa
            @@ -677,7 +680,7 @@ __END__
            d683aa
             - name:  optimized4
            d683aa
               desc:  single quotation and backslash
            d683aa
               class: OptimizedEruby
            d683aa
            -  input: &optimized4_input|
            d683aa
            +  input: &optimized4_input |
            d683aa
                   a = "'"
            d683aa
                   b = "\""
            d683aa
                   c = '\''
            d683aa
            @@ -751,14 +754,14 @@ __END__
            d683aa
             - name:  pi1
            d683aa
               class:  PI::Eruby
            d683aa
               testopt:  evaluate
            d683aa
            -  input: &input_pi1|
            d683aa
            +  input: &input_pi1 |
            d683aa
                   
              d683aa
                      
              d683aa
                       
            • @{item}@ / @!{item}@
            • d683aa
                       
            • <%= item %> / <%== item %>
            • d683aa
                      
              d683aa
                     
              d683aa
              -  src: &src_pi1|
              d683aa
              +  src: &src_pi1 |
              d683aa
                     _buf = ''; _buf << '
                d683aa
                       ';  for item in @list 
                d683aa
                        _buf << '  
              • '; _buf << Erubis::XmlHelper.escape_xml(item); _buf << ' / '; _buf << (item).to_s; _buf << '
              • d683aa
                @@ -767,7 +770,7 @@ __END__
                d683aa
                        _buf << '
                d683aa
                       ';
                d683aa
                       _buf.to_s
                d683aa
                -  output: &output_pi1|
                d683aa
                +  output: &output_pi1 |
                d683aa
                       
                  d683aa
                           
                • <aaa> / <aaa>
                • d683aa
                           
                • <aaa> / <aaa>
                • d683aa
                  @@ -780,7 +783,8 @@ __END__
                  d683aa
                   ##
                  d683aa
                   - name:  pi2
                  d683aa
                     class:  PI::Eruby
                  d683aa
                  -  options: { :escape: false }
                  d683aa
                  +  options:
                  d683aa
                  +   :escape: false
                  d683aa
                     testopt:  evaluate
                  d683aa
                     input: *input_pi1
                  d683aa
                     src: |
                  d683aa
                  @@ -805,7 +809,9 @@ __END__
                  d683aa
                   ##
                  d683aa
                   - name:  pi3
                  d683aa
                     class:  PI::Eruby
                  d683aa
                  -  options: { :pi: hoge, :embchar: '$' }
                  d683aa
                  +  options:
                  d683aa
                  +   :pi: hoge
                  d683aa
                  +   :embchar: '$'
                  d683aa
                     testopt:  evaluate
                  d683aa
                     input: |
                  d683aa
                         
                    d683aa
                    -- 
                    d683aa
                    1.8.1.4
                    d683aa
                    d683aa
                    d683aa
                    From 8c847c79dc4a6a6886d51d01178b7e6bff6e9ad7 Mon Sep 17 00:00:00 2001
                    d683aa
                    From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
                    d683aa
                    Date: Tue, 5 Mar 2013 10:04:36 +0100
                    d683aa
                    Subject: [PATCH 3/5] Fix embedded YAML to be compatible with Psych.
                    d683aa
                    d683aa
                    ---
                    d683aa
                     test/test-enhancers.rb | 14 ++++++++------
                    d683aa
                     1 file changed, 8 insertions(+), 6 deletions(-)
                    d683aa
                    d683aa
                    diff --git a/test/test-enhancers.rb b/test/test-enhancers.rb
                    d683aa
                    index 3b46721..0ad9f65 100644
                    d683aa
                    --- a/test/test-enhancers.rb
                    d683aa
                    +++ b/test/test-enhancers.rb
                    d683aa
                    @@ -106,13 +106,13 @@ __END__
                    d683aa
                     ##
                    d683aa
                     - name:  basic1
                    d683aa
                       class: Eruby
                    d683aa
                    -  input: &basic1_input|
                    d683aa
                    +  input: &basic1_input |
                    d683aa
                           
                      d683aa
                              <% for item in list %>
                      d683aa
                               
                    • <%= item %>
                    • d683aa
                              <% end %>
                      d683aa
                             
                      d683aa
                      -  src: &basic1_src|
                      d683aa
                      +  src: &basic1_src |
                      d683aa
                             _buf = ''; _buf << '
                        d683aa
                               ';  for item in list 
                        d683aa
                                _buf << '  
                      • '; _buf << ( item ).to_s; _buf << '
                      • d683aa
                        @@ -120,7 +120,7 @@ __END__
                        d683aa
                                _buf << '
                        d683aa
                               ';
                        d683aa
                               _buf.to_s
                        d683aa
                        -  output: &basic1_output|
                        d683aa
                        +  output: &basic1_output |
                        d683aa
                               
                          d683aa
                                   
                        • <aaa>
                        • d683aa
                                   
                        • b&b
                        • d683aa
                          @@ -193,7 +193,7 @@ __END__
                          d683aa
                           ##
                          d683aa
                           - name:  printenabled1
                          d683aa
                             class: PrintEnabledEruby
                          d683aa
                          -  input: &printenabled1_input|
                          d683aa
                          +  input: &printenabled1_input |
                          d683aa
                                 
                            d683aa
                                    <% for item in list %>
                            d683aa
                                     
                          • <% print item %>
                          • d683aa
                            @@ -425,7 +425,8 @@ __END__
                            d683aa
                             ##
                            d683aa
                             - name:  bipattern2
                            d683aa
                               class: BiPatternEruby
                            d683aa
                            -  options:  { :bipattern: '\$\{ \}' }
                            d683aa
                            +  options:
                            d683aa
                            +    :bipattern: '\$\{ \}'
                            d683aa
                               input: |
                            d683aa
                                   <% for item in list %>
                            d683aa
                                     <%=item%> % <%==item%>
                            d683aa
                            @@ -500,7 +501,8 @@ __END__
                            d683aa
                             ##
                            d683aa
                             - name:  prefixedline1
                            d683aa
                               class: PrefixedLineEruby
                            d683aa
                            -  options: { :prefixchar: '!' }
                            d683aa
                            +  options:
                            d683aa
                            +   :prefixchar: '!'
                            d683aa
                               input: |
                            d683aa
                                   
                            d683aa
                                     ! for item in list
                            d683aa
                            -- 
                            d683aa
                            1.8.1.4
                            d683aa
                            d683aa
                            d683aa
                            From f993710234852a713a351fcd06ca027b1b46d809 Mon Sep 17 00:00:00 2001
                            d683aa
                            From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
                            d683aa
                            Date: Tue, 5 Mar 2013 10:06:30 +0100
                            d683aa
                            Subject: [PATCH 4/5] Add support for Ruby 2.0.0 error messages.
                            d683aa
                            d683aa
                            ---
                            d683aa
                             test/test-main.rb | 13 +++++++++++++
                            d683aa
                             test/testutil.rb  |  4 ++++
                            d683aa
                             2 files changed, 17 insertions(+)
                            d683aa
                            d683aa
                            diff --git a/test/test-main.rb b/test/test-main.rb
                            d683aa
                            index 0e63229..e4d6c2a 100644
                            d683aa
                            --- a/test/test-main.rb
                            d683aa
                            +++ b/test/test-main.rb
                            d683aa
                            @@ -273,6 +273,19 @@ END
                            d683aa
                                   errmsgs << <<'END'
                            d683aa
                             7: syntax error, unexpected $end, expecting keyword_end
                            d683aa
                             END
                            d683aa
                            +    elsif ruby20?
                            d683aa
                            +      errmsgs << <<'END'
                            d683aa
                            +3: syntax error, unexpected ']', expecting ')'
                            d683aa
                            + _buf << '  
                          • '; _buf << ( item[:name]] ).to_s; _buf << '
                          • d683aa
                            +                                         ^
                            d683aa
                            +-:4: syntax error, unexpected keyword_end, expecting ')'
                            d683aa
                            +'; end 
                            d683aa
                            +      ^
                            d683aa
                            +-:7: syntax error, unexpected end-of-input, expecting ')'
                            d683aa
                            +END
                            d683aa
                            +      errmsgs << <<'END'
                            d683aa
                            +7: syntax error, unexpected end-of-input, expecting keyword_end
                            d683aa
                            +END
                            d683aa
                                 elsif rubinius?
                            d683aa
                                   errmsgs << <<'END'
                            d683aa
                             3: expecting ')'
                            d683aa
                            diff --git a/test/testutil.rb b/test/testutil.rb
                            d683aa
                            index e5293a5..59c3779 100644
                            d683aa
                            --- a/test/testutil.rb
                            d683aa
                            +++ b/test/testutil.rb
                            d683aa
                            @@ -17,6 +17,10 @@ def ruby19?  # :nodoc:
                            d683aa
                               RUBY_VERSION =~ /\A1.9/
                            d683aa
                             end
                            d683aa
                             
                            d683aa
                            +def ruby20?  # :nodoc:
                            d683aa
                            +  RUBY_VERSION =~ /\A2.0/
                            d683aa
                            +end
                            d683aa
                            +
                            d683aa
                             def rubinius?  # :nodoc:
                            d683aa
                               defined?(RUBY_ENGINE) && RUBY_ENGINE == "rbx"
                            d683aa
                             end
                            d683aa
                            -- 
                            d683aa
                            1.8.1.4
                            d683aa
                            d683aa
                            d683aa
                            From 99d0db2f38d7a4b9cf782e2e4a73bde0d73277e9 Mon Sep 17 00:00:00 2001
                            d683aa
                            From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
                            d683aa
                            Date: Tue, 5 Mar 2013 10:07:02 +0100
                            d683aa
                            Subject: [PATCH 5/5] Add support for Ruby 2.0.0.
                            d683aa
                            d683aa
                            ---
                            d683aa
                             test/test-users-guide.rb | 2 +-
                            d683aa
                             1 file changed, 1 insertion(+), 1 deletion(-)
                            d683aa
                            d683aa
                            diff --git a/test/test-users-guide.rb b/test/test-users-guide.rb
                            d683aa
                            index 2687a83..b89706b 100644
                            d683aa
                            --- a/test/test-users-guide.rb
                            d683aa
                            +++ b/test/test-users-guide.rb
                            d683aa
                            @@ -28,7 +28,7 @@ class KwarkUsersGuideTest < Test::Unit::TestCase
                            d683aa
                                 s =~ /\A\$ (.*?)\n/
                            d683aa
                                 command = $1
                            d683aa
                                 expected = $'
                            d683aa
                            -    if ruby19?
                            d683aa
                            +    if ruby19? || ruby20?
                            d683aa
                                   case @name
                            d683aa
                                   when 'test_main_program1_result'
                            d683aa
                                     expected.sub!('["eruby", "items", "x", "_buf"]', '[:_buf, :eruby, :items, :x]')
                            d683aa
                            -- 
                            d683aa
                            1.8.1.4
                            d683aa