Hello community,

here is the log from the commit of package rubygem-erubi for openSUSE:Factory 
checked in at 2017-12-07 13:51:13
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-erubi (Old)
 and      /work/SRC/openSUSE:Factory/.rubygem-erubi.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "rubygem-erubi"

Thu Dec  7 13:51:13 2017 rev:2 rq:533898 version:1.7.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/rubygem-erubi/rubygem-erubi.changes      
2017-09-04 12:36:29.006153420 +0200
+++ /work/SRC/openSUSE:Factory/.rubygem-erubi.new/rubygem-erubi.changes 
2017-12-07 13:51:18.718789805 +0100
@@ -1,0 +2,6 @@
+Fri Oct 13 11:19:23 UTC 2017 - [email protected]
+
+- updated to version 1.7.0
+  * Fix escaping in erubi/capture_end, the setting was previously inverted 
(jeremyevans) (#10) 
+
+-------------------------------------------------------------------

Old:
----
  erubi-1.6.1.gem

New:
----
  erubi-1.7.0.gem

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ rubygem-erubi.spec ++++++
--- /var/tmp/diff_new_pack.y8w8Ve/_old  2017-12-07 13:51:19.298768683 +0100
+++ /var/tmp/diff_new_pack.y8w8Ve/_new  2017-12-07 13:51:19.298768683 +0100
@@ -24,7 +24,7 @@
 #
 
 Name:           rubygem-erubi
-Version:        1.6.1
+Version:        1.7.0
 Release:        0
 %define mod_name erubi
 %define mod_full_name %{mod_name}-%{version}
@@ -34,7 +34,7 @@
 BuildRequires:  %{ruby}
 BuildRequires:  ruby-macros >= 5
 Url:            https://github.com/jeremyevans/erubi
-Source:         http://rubygems.org/gems/%{mod_full_name}.gem
+Source:         https://rubygems.org/gems/%{mod_full_name}.gem
 Source1:        gem2rpm.yml
 Summary:        Small ERB Implementation
 License:        MIT

++++++ erubi-1.6.1.gem -> erubi-1.7.0.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/CHANGELOG new/CHANGELOG
--- old/CHANGELOG       2017-06-27 22:02:01.000000000 +0200
+++ new/CHANGELOG       2017-10-09 17:00:55.000000000 +0200
@@ -1,3 +1,7 @@
+=== 1.7.0 (2017-10-09)
+
+* Fix escaping in erubi/capture_end, the setting was previously inverted 
(jeremyevans) (#10)
+
 === 1.6.1 (2017-06-27)
 
 * Fix usage on newer versions of JRuby 9.1 (jeremyevans)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/README.rdoc new/README.rdoc
--- old/README.rdoc     2017-06-27 22:02:01.000000000 +0200
+++ new/README.rdoc     2017-10-09 17:00:55.000000000 +0200
@@ -45,7 +45,8 @@
 
 Erubi does not support capturing block output into the template by default.
 However, it comes with an +erubi/capture_end+ file that supports capturing
-via <tt><%|=</tt>, <tt><%|==</tt>, <tt><%|</tt> tags:
+via <tt><%|=</tt> and <tt><%|==</tt> tags which are closed with a
+<tt><%|</tt> tag:
 
   <%|= form do %>
     <input>
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/erubi/capture_end.rb new/lib/erubi/capture_end.rb
--- old/lib/erubi/capture_end.rb        2017-06-27 22:02:01.000000000 +0200
+++ new/lib/erubi/capture_end.rb        2017-10-09 17:00:55.000000000 +0200
@@ -28,7 +28,7 @@
       when '|=', '|=='
         rspace = nil if tailch && !tailch.empty?
         add_text(lspace) if lspace
-        escape_capture = ((indicator == '|=') ^ @escape_capture)
+        escape_capture = !((indicator == '|=') ^ @escape_capture)
         src << "begin; (#{@bufstack} ||= []) << #{@bufvar}; #{@bufvar} = 
#{@bufval}; #{@bufstack}.last << #{@escapefunc if escape_capture}((" << code
         add_text(rspace) if rspace
       when '|'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/erubi.rb new/lib/erubi.rb
--- old/lib/erubi.rb    2017-06-27 22:02:01.000000000 +0200
+++ new/lib/erubi.rb    2017-10-09 17:00:55.000000000 +0200
@@ -1,7 +1,7 @@
 # frozen_string_literal: true
 
 module Erubi
-  VERSION = '1.6.1'
+  VERSION = '1.7.0'
   RANGE_ALL = 0..-1
 
   if RUBY_VERSION >= '1.9'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata        2017-06-27 22:02:01.000000000 +0200
+++ new/metadata        2017-10-09 17:00:55.000000000 +0200
@@ -1,7 +1,7 @@
 --- !ruby/object:Gem::Specification
 name: erubi
 version: !ruby/object:Gem::Version
-  version: 1.6.1
+  version: 1.7.0
 platform: ruby
 authors:
 - Jeremy Evans
@@ -9,7 +9,7 @@
 autorequire: 
 bindir: bin
 cert_chain: []
-date: 2017-06-27 00:00:00.000000000 Z
+date: 2017-10-09 00:00:00.000000000 Z
 dependencies:
 - !ruby/object:Gem::Dependency
   name: minitest
@@ -68,7 +68,7 @@
       version: '0'
 requirements: []
 rubyforge_project: 
-rubygems_version: 2.6.11
+rubygems_version: 2.6.13
 signing_key: 
 specification_version: 4
 summary: Small ERB Implementation
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/test/test.rb new/test/test.rb
--- old/test/test.rb    2017-06-27 22:02:01.000000000 +0200
+++ new/test/test.rb    2017-10-09 17:00:55.000000000 +0200
@@ -64,6 +64,16 @@
       @a << 'd'
       @a * 2
     end
+    def self.quux
+      @a << "a"
+      3.times do |i|
+        @a << "c#{i}"
+        yield i
+        @a << "d#{i}"
+      end
+      @a << "b"
+      @a.upcase
+    end
   end
 
   it "should handle no options" do
@@ -159,6 +169,22 @@
     @a.must_equal 'bar'
   end
 
+  it "should have <%|= with CaptureEndEngine not escape by default" do
+    eval(::Erubi::CaptureEndEngine.new('<%|= "&" %><%| %>').src).must_equal '&'
+    eval(::Erubi::CaptureEndEngine.new('<%|= "&" %><%| %>', 
:escape=>false).src).must_equal '&'
+    eval(::Erubi::CaptureEndEngine.new('<%|= "&" %><%| %>', 
:escape_capture=>false).src).must_equal '&'
+    eval(::Erubi::CaptureEndEngine.new('<%|= "&" %><%| %>', 
:escape=>true).src).must_equal '&amp;'
+    eval(::Erubi::CaptureEndEngine.new('<%|= "&" %><%| %>', 
:escape_capture=>true).src).must_equal '&amp;'
+  end
+
+  it "should have <%|== with CaptureEndEngine escape by default" do
+    eval(::Erubi::CaptureEndEngine.new('<%|== "&" %><%| %>').src).must_equal 
'&amp;'
+    eval(::Erubi::CaptureEndEngine.new('<%|== "&" %><%| %>', 
:escape=>true).src).must_equal '&'
+    eval(::Erubi::CaptureEndEngine.new('<%|== "&" %><%| %>', 
:escape_capture=>true).src).must_equal '&'
+    eval(::Erubi::CaptureEndEngine.new('<%|== "&" %><%| %>', 
:escape=>false).src).must_equal '&amp;'
+    eval(::Erubi::CaptureEndEngine.new('<%|== "&" %><%| %>', 
:escape_capture=>false).src).must_equal '&amp;'
+  end
+
   [['', false], ['=', true]].each do |ind, escape|
     it "should allow <%|=#{ind} and <%| for capturing with CaptureEndEngine 
with :escape_capture => #{escape} and :escape => #{!escape}" do
       @options[:bufvar] = '@a'
@@ -178,7 +204,7 @@
 END1
 #{'__erubi = ::Erubi;' unless escape}@a = String.new; @a << '<table>
  <tbody>
-'; @a << '  ';begin; (__erubi_stack ||= []) << @a; @a = String.new; 
__erubi_stack.last << #{!escape ? '__erubi' : '::Erubi'}.h(( bar do  @a << '
+'; @a << '  ';begin; (__erubi_stack ||= []) << @a; @a = String.new; 
__erubi_stack.last << (( bar do  @a << '
 '; @a << '   <b>'; @a << #{!escape ? '__erubi' : '::Erubi'}.h(( '&' )); @a << 
'</b>
 '; @a << ' '; end )).to_s; ensure; @a = __erubi_stack.pop; end; @a << '
 '; @a << ' </tbody>
@@ -189,7 +215,7 @@
 <table>
  <tbody>
   A
-   &lt;B&gt;&amp;AMP;&lt;/B&gt;
+   <B>&AMP;</B>
  B
  </tbody>
 </table>
@@ -214,7 +240,7 @@
 END1
 #{'__erubi = ::Erubi;' if escape}@a = String.new; @a << '<table>
  <tbody>
-'; @a << '  ';begin; (__erubi_stack ||= []) << @a; @a = String.new; 
__erubi_stack.last << (( bar do  @a << '
+'; @a << '  ';begin; (__erubi_stack ||= []) << @a; @a = String.new; 
__erubi_stack.last << #{escape ? '__erubi' : '::Erubi'}.h(( bar do  @a << '
 '; @a << '   <b>'; @a << #{escape ? '__erubi' : '::Erubi'}.h(( '&' )); @a << 
'</b>
 '; @a << ' '; end )).to_s; ensure; @a = __erubi_stack.pop; end; @a << '
 '; @a << ' </tbody>
@@ -225,13 +251,51 @@
 <table>
  <tbody>
   A
-   <B>&AMP;</B>
+   &lt;B&gt;&amp;AMP;&lt;/B&gt;
  B
  </tbody>
 </table>
 END3
     end
 
+    it "should handle loops in <%|=#{ind} and <%| for capturing with 
CaptureEndEngine when with :escape => #{escape}" do
+      @options[:bufvar] = '@a'
+      @options[:escape] = escape
+      @options[:engine] = ::Erubi::CaptureEndEngine
+      setup_bar
+      check_output(<<END1, <<END2, <<END3){}
+<table>
+ <tbody>
+  <%|=#{ind} quux do |i| %>
+   <b><%=#{ind} "\#{i}&" %></b>
+ <%| end %>
+ </tbody>
+</table>
+END1
+#{'__erubi = ::Erubi;' if escape}@a = String.new; @a << '<table>
+ <tbody>
+'; @a << '  ';begin; (__erubi_stack ||= []) << @a; @a = String.new; 
__erubi_stack.last << #{escape ? '__erubi' : '::Erubi'}.h(( quux do |i|  @a << '
+'; @a << '   <b>'; @a << #{escape ? '__erubi' : '::Erubi'}.h(( "\#{i}&" )); @a 
<< '</b>
+'; @a << ' '; end )).to_s; ensure; @a = __erubi_stack.pop; end; @a << '
+'; @a << ' </tbody>
+</table>
+';
[email protected]_s
+END2
+<table>
+ <tbody>
+  AC0
+   &lt;B&gt;0&amp;AMP;&lt;/B&gt;
+ D0C1
+   &lt;B&gt;1&amp;AMP;&lt;/B&gt;
+ D1C2
+   &lt;B&gt;2&amp;AMP;&lt;/B&gt;
+ D2B
+ </tbody>
+</table>
+END3
+    end
+
     it "should allow <%|=#{ind} and <%| for nested capturing with 
CaptureEndEngine when with :escape => #{escape}" do
       @options[:bufvar] = '@a'
       @options[:escape] = escape
@@ -249,9 +313,9 @@
 END1
 #{'__erubi = ::Erubi;' if escape}@a = String.new; @a << '<table>
  <tbody>
-'; @a << '  ';begin; (__erubi_stack ||= []) << @a; @a = String.new; 
__erubi_stack.last << (( bar do  @a << '
+'; @a << '  ';begin; (__erubi_stack ||= []) << @a; @a = String.new; 
__erubi_stack.last << #{escape ? '__erubi' : '::Erubi'}.h(( bar do  @a << '
 '; @a << '   <b>'; @a << #{escape ? '__erubi' : '::Erubi'}.h(( '&' )); @a << 
'</b>
-'; @a << '   ';begin; (__erubi_stack ||= []) << @a; @a = String.new; 
__erubi_stack.last << (( baz do  @a << 'e'; end )).to_s; ensure; @a = 
__erubi_stack.pop; end; @a << '
+'; @a << '   ';begin; (__erubi_stack ||= []) << @a; @a = String.new; 
__erubi_stack.last << #{escape ? '__erubi' : '::Erubi'}.h(( baz do  @a << 'e'; 
end )).to_s; ensure; @a = __erubi_stack.pop; end; @a << '
 '; @a << ' '; end )).to_s; ensure; @a = __erubi_stack.pop; end; @a << '
 '; @a << ' </tbody>
 </table>
@@ -261,7 +325,7 @@
 <table>
  <tbody>
   A
-   <B>&AMP;</B>
+   &lt;B&gt;&amp;AMP;&lt;/B&gt;
    CEDCED
  B
  </tbody>


Reply via email to