Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package rubygem-haml for openSUSE:Factory 
checked in at 2022-12-13 18:56:41
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-haml (Old)
 and      /work/SRC/openSUSE:Factory/.rubygem-haml.new.1835 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "rubygem-haml"

Tue Dec 13 18:56:41 2022 rev:36 rq:1042641 version:6.0.12

Changes:
--------
--- /work/SRC/openSUSE:Factory/rubygem-haml/rubygem-haml.changes        
2022-10-30 18:29:06.794474276 +0100
+++ /work/SRC/openSUSE:Factory/.rubygem-haml.new.1835/rubygem-haml.changes      
2022-12-13 18:57:02.747708715 +0100
@@ -1,0 +2,28 @@
+Wed Dec  7 11:22:53 UTC 2022 - Stephan Kulow <[email protected]>
+
+updated to version 6.0.12
+ see installed CHANGELOG.md
+
+  ## 6.0.12
+  
+  * Fix a whitespace removal with `>` and an `if`-`else` statement 
[#1114](https://github.com/haml/haml/issues/1114)
+  
+  ## 6.0.11
+  
+  * Fix a whitespace removal with `>` and an `if` statement 
[#1114](https://github.com/haml/haml/issues/1114)
+  
+  ## 6.0.10
+  
+  * Evaluate :erb filter in the template context like Haml 5
+  
+  ## 6.0.9
+  
+  * Support sass-embedded [#1112](https://github.com/haml/haml/issues/1112)
+  
+  ## 6.0.8
+  
+  * Support interpolation in HTML comments, which has not been working since 
6.0.0
+    [#1107](https://github.com/haml/haml/issues/1107)
+  
+
+-------------------------------------------------------------------

Old:
----
  haml-6.0.7.gem

New:
----
  haml-6.0.12.gem

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

Other differences:
------------------
++++++ rubygem-haml.spec ++++++
--- /var/tmp/diff_new_pack.5FDdhm/_old  2022-12-13 18:57:03.335711854 +0100
+++ /var/tmp/diff_new_pack.5FDdhm/_new  2022-12-13 18:57:03.339711875 +0100
@@ -24,7 +24,7 @@
 #
 
 Name:           rubygem-haml
-Version:        6.0.7
+Version:        6.0.12
 Release:        0
 %define mod_name haml
 %define mod_full_name %{mod_name}-%{version}

++++++ haml-6.0.7.gem -> haml-6.0.12.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/.github/workflows/test.yml 
new/.github/workflows/test.yml
--- old/.github/workflows/test.yml      2022-10-14 08:40:09.000000000 +0200
+++ new/.github/workflows/test.yml      2022-11-27 06:16:44.000000000 +0100
@@ -25,16 +25,10 @@
           - truffleruby-head
     steps:
       - uses: actions/checkout@v2
+      - run: sudo apt-get update && sudo apt-get install -y nodejs libxslt-dev 
# nodejs for execjs, libxslt for TruffleRuby nokogiri
       - name: Set up Ruby
         uses: ruby/setup-ruby@v1
         with:
           ruby-version: ${{ matrix.ruby }}
-      - uses: actions/cache@v2
-        with:
-          path: vendor/bundle
-          key: ${{ runner.os }}-${{ matrix.ruby }}-gems-${{ 
hashFiles('**/Gemfile.lock') }}
-          restore-keys: ${{ runner.os }}-gems-
-      - run: sudo apt-get update && sudo apt-get install -y nodejs libxslt-dev 
# nodejs for execjs, libxslt for TruffleRuby nokogiri
-      - name: bundle install
-        run: bundle config path vendor/bundle && bundle install -j$(nproc) 
--retry 3
+          bundler-cache: true
       - run: bundle exec rake test
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/CHANGELOG.md new/CHANGELOG.md
--- old/CHANGELOG.md    2022-10-14 08:40:09.000000000 +0200
+++ new/CHANGELOG.md    2022-11-27 06:16:44.000000000 +0100
@@ -1,5 +1,26 @@
 # Haml Changelog
 
+## 6.0.12
+
+* Fix a whitespace removal with `>` and an `if`-`else` statement 
[#1114](https://github.com/haml/haml/issues/1114)
+
+## 6.0.11
+
+* Fix a whitespace removal with `>` and an `if` statement 
[#1114](https://github.com/haml/haml/issues/1114)
+
+## 6.0.10
+
+* Evaluate :erb filter in the template context like Haml 5
+
+## 6.0.9
+
+* Support sass-embedded [#1112](https://github.com/haml/haml/issues/1112)
+
+## 6.0.8
+
+* Support interpolation in HTML comments, which has not been working since 
6.0.0
+  [#1107](https://github.com/haml/haml/issues/1107)
+
 ## 6.0.7
 
 * `Haml::Engine` and `Haml::Template` use StringBuffer instead of ArrayBuffer
@@ -58,6 +79,8 @@
   * The parser is kept as is, but everything else is replaced.
   * The `haml` CLI interface was also replaced.
   * The interface of `Haml::Engine` is changed. `Haml::Template` is most 
likely what you need now.
+     * before: `Haml::Engine.new("%p Haml code!").render`
+     * after: `Haml::Template.new { "%p Haml code!" }.render`
   * Most Haml helpers are removed.
      * Rails:
          * Kept: `find_and_reserve`, `preserve`, `surround`, `precede`, 
`succeed`, `capture_haml`
@@ -68,9 +91,19 @@
          * Removed: `block_is_haml?`, `capture_haml`, `escape_once`, 
`find_and_preserve`, `flatten`, `haml_concat`,
            `haml_indent`, `haml_tag`, `haml_tag_if`, `html_attrs`, 
`html_escape`, `init_haml_helpers`, `is_haml?`,
            `list_of`, `non_haml`, `precede`, `succeed`, `surround`, 
`tab_down`, `tab_up`, `with_tabs`
-  * Only the attributes in 
[`Haml::AttributeBuilder::BOOLEAN_ATTRIBUTES`](lib/haml/attribute_builder.rb)
-    are handled as boolean attributes.
+  * Only the following attributes and `aria`/`data` attributes are considered 
boolean attributes:
+     * `allowfullscreen`, `async`, `autobuffer`, `autofocus`, `autoplay`, 
`checked`, `controls`, `default`,
+       `defer`, `disabled`, `download`, `formnovalidate`, `hidden`, `inert`, 
`ismap`, `itemscope`, `loop`,
+       `multiple`, `muted`, `novalidate`, `open`, `pubdate`, `readonly`, 
`required`, `reversed`, `scoped`,
+       `seamless`, `selected`, `sortable`, `truespeed`, `typemustmatch`
+  * Only `data` and `aria` attributes support using a nested Hash to render 
hyphenated attributes, e.g.
+    `data: { foo: 'bar' }` becomes `data-foo="bar"`, but this no longer works 
for non-`data`/`aria` attributes.
   * Some legacy Rails integration is removed.
+  * The default value of `escape_html` option became true.
+  * `-` script lines no longer support capturing. Only `=` lines are supported 
to yield a nested block.
+  * Overriding `data` attributes with another falsy `data-*` attribute that 
has the same name
+    is no longer supported. [#1105](https://github.com/haml/haml/issues/1105)
+  * :erb filter is not executed in the template context (fixed in 6.0.10)
 
 ## 5.2.2
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/REFERENCE.md new/REFERENCE.md
--- old/REFERENCE.md    2022-10-14 08:40:09.000000000 +0200
+++ new/REFERENCE.md    2022-11-27 06:16:44.000000000 +0100
@@ -338,20 +338,19 @@
 <a> tag is so old links to here still work. -->
 <a id="html5_custom_data_attributes" style="border:0;"></a>
 
-#### Prefixed Attributes
+#### Data Attributes
 
 HTML5 allows for adding
 [custom non-visible data 
attributes](http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#embedding-custom-non-visible-data-with-the-data-*-attributes)
 to elements using attribute names beginning with `data-`. The
 [Accessible Rich Internet Applications](http://www.w3.org/WAI/intro/aria)
-specification makes use of attributes beginning with `aria-`. There are also
-frameworks that use non-standard attributes with a common prefix.
+specification makes use of attributes beginning with `aria-`.
 
 Haml can help generate collections of attributes that share a prefix like
-these. Any entry in an attribute hash that has a Hash as its value is expanded
-into a series of attributes, one for each key/value pair in the hash, with the
-attribute name formed by joining the “parent” key name to the key name 
with a
-hyphen.
+these. Any entry in an `data` or `aria` attribute hash that has a Hash as its
+value is expanded into a series of attributes, one for each key/value pair in
+the hash, with the attribute name formed by joining the “parent” key name 
to
+the key name with a hyphen. This works only for `data` or `aria`.
 
 For example:
 
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/haml/compiler/children_compiler.rb 
new/lib/haml/compiler/children_compiler.rb
--- old/lib/haml/compiler/children_compiler.rb  2022-10-14 08:40:09.000000000 
+0200
+++ new/lib/haml/compiler/children_compiler.rb  2022-11-27 06:16:44.000000000 
+0100
@@ -6,21 +6,22 @@
     class ChildrenCompiler
       def initialize
         @lineno = 1
+        @multi_flattener = Temple::Filters::MultiFlattener.new
       end
 
       def compile(node, &block)
         temple = [:multi]
         return temple if node.children.empty?
 
-        temple << :whitespace if prepend_whitespace?(node)
+        temple << [:whitespace] if prepend_whitespace?(node)
         node.children.each do |n|
           rstrip_whitespace!(temple) if nuke_prev_whitespace?(n)
           insert_newlines!(temple, n)
           temple << moving_lineno(n) { block.call(n) }
-          temple << :whitespace if insert_whitespace?(n)
+          temple << [:whitespace] if insert_whitespace?(n)
         end
         rstrip_whitespace!(temple) if nuke_inner_whitespace?(node)
-        confirm_whitespace(temple)
+        temple
       end
 
       private
@@ -56,17 +57,6 @@
         temple
       end
 
-      def confirm_whitespace(temple)
-        temple.map do |exp|
-          case exp
-          when :whitespace
-            [:static, "\n"]
-          else
-            exp
-          end
-        end
-      end
-
       def prepend_whitespace?(node)
         return false unless %i[comment tag].include?(node.type)
         !nuke_inner_whitespace?(node)
@@ -100,9 +90,48 @@
       end
 
       def rstrip_whitespace!(temple)
-        if temple[-1] == :whitespace
-          temple.delete_at(-1)
+        return if temple.size == 1
+
+        case temple[0]
+        when :multi
+          case temple[-1][0]
+          when :whitespace
+            temple.delete_at(-1)
+          when :multi, :block
+            rstrip_whitespace!(temple[-1])
+          end
+        when :block
+          _block, code, exp = temple
+          if code.start_with?(/\s*if\s/)
+            # Remove [:whitespace] before `end`
+            exp.replace(@multi_flattener.call(exp))
+            rstrip_whitespace!(exp)
+
+            # Remove [:whitespace] before `else` if exists
+            else_index = find_else_index(exp)
+            if else_index
+              whitespace_index = else_index - 1
+              while exp[whitespace_index] == [:newline]
+                whitespace_index -= 1
+              end
+              if exp[whitespace_index] == [:whitespace]
+                exp.delete_at(whitespace_index)
+              end
+            end
+          end
+        end
+      end
+
+      def find_else_index(temple)
+        multi, *args = temple
+        return nil if multi != :multi
+
+        args.each_with_index do |arg, index|
+          if arg[0] == :code && arg[1].match?(/\A\s*else\s*\z/)
+            return index + 1
+          end
         end
+        nil
       end
 
       def insert_whitespace?(node)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/haml/compiler/comment_compiler.rb 
new/lib/haml/compiler/comment_compiler.rb
--- old/lib/haml/compiler/comment_compiler.rb   2022-10-14 08:40:09.000000000 
+0200
+++ new/lib/haml/compiler/comment_compiler.rb   2022-11-27 06:16:44.000000000 
+0100
@@ -14,7 +14,7 @@
 
       def compile_html_comment(node, &block)
         if node.children.empty?
-          [:html, :comment, [:static, " #{node.value[:text]} "]]
+          [:html, :comment, compile_text(node)]
         else
           [:html, :comment, yield(node)]
         end
@@ -28,12 +28,24 @@
 
         content =
           if node.children.empty?
-            [:static, " #{node.value[:text]} "]
+            compile_text(node)
           else
             yield(node)
           end
         [:html, :condcomment, condition, content, node.value[:revealed]]
       end
+
+      def compile_text(node)
+        text =
+          if node.value[:parse]
+            # Just always escaping the result for safety. We could respect
+            # escape_html, but I don't see any use case for it.
+            [:escape, true, [:dynamic, node.value[:text]]]
+          else
+            [:static, node.value[:text]]
+          end
+        [:multi, [:static, ' '], text, [:static, ' ']]
+      end
     end
   end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/haml/engine.rb new/lib/haml/engine.rb
--- old/lib/haml/engine.rb      2022-10-14 08:40:09.000000000 +0200
+++ new/lib/haml/engine.rb      2022-11-27 06:16:44.000000000 +0100
@@ -8,6 +8,7 @@
 require 'haml/force_escapable'
 require 'haml/dynamic_merger'
 require 'haml/ambles'
+require 'haml/whitespace'
 
 module Haml
   class Engine < Temple::Engine
@@ -36,6 +37,7 @@
     filter :ControlFlow
     use Ambles
     filter :MultiFlattener
+    use Whitespace
     filter :StaticMerger
     use DynamicMerger
     use :Generator, -> { options[:generator] }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/haml/filters/erb.rb new/lib/haml/filters/erb.rb
--- old/lib/haml/filters/erb.rb 2022-10-14 08:40:09.000000000 +0200
+++ new/lib/haml/filters/erb.rb 2022-11-27 06:16:44.000000000 +0100
@@ -3,7 +3,7 @@
   class Filters
     class Erb < TiltBase
       def compile(node)
-        compile_with_tilt(node, 'erb')
+        precompiled_with_tilt(node, 'erb')
       end
     end
   end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/haml/filters/tilt_base.rb 
new/lib/haml/filters/tilt_base.rb
--- old/lib/haml/filters/tilt_base.rb   2022-10-14 08:40:09.000000000 +0200
+++ new/lib/haml/filters/tilt_base.rb   2022-11-27 06:16:44.000000000 +0100
@@ -7,7 +7,11 @@
       def self.render(name, source, indent_width: 0)
         text = ::Tilt["t.#{name}"].new { source }.render
         return text if indent_width == 0
-        text.gsub!(/^/, ' ' * indent_width)
+        if text.frozen?
+          text.gsub(/^/, ' ' * indent_width)
+        else
+          text.gsub!(/^/, ' ' * indent_width)
+        end
       end
 
       def explicit_require?(needed_registration)
@@ -17,6 +21,12 @@
 
       private
 
+      # TODO: support interpolation
+      def precompiled_with_tilt(node, name)
+        src = ::Tilt["t.#{name}"].new { node.value[:text] }.send(:precompiled, 
{}).first
+        [:dynamic, src]
+      end
+
       def compile_with_tilt(node, name, indent_width: 0)
         if ::Haml::Util.contains_interpolation?(node.value[:text])
           dynamic_compile(node, name, indent_width: indent_width)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/haml/version.rb new/lib/haml/version.rb
--- old/lib/haml/version.rb     2022-10-14 08:40:09.000000000 +0200
+++ new/lib/haml/version.rb     2022-11-27 06:16:44.000000000 +0100
@@ -1,4 +1,4 @@
 # frozen_string_literal: true
 module Haml
-  VERSION = '6.0.7'
+  VERSION = '6.0.12'
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/haml/whitespace.rb new/lib/haml/whitespace.rb
--- old/lib/haml/whitespace.rb  1970-01-01 01:00:00.000000000 +0100
+++ new/lib/haml/whitespace.rb  2022-11-27 06:16:44.000000000 +0100
@@ -0,0 +1,8 @@
+# frozen_string_literal: true
+module Haml
+  class Whitespace < Temple::Filter
+    def on_whitespace
+      [:static, "\n"]
+    end
+  end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata        2022-10-14 08:40:09.000000000 +0200
+++ new/metadata        2022-11-27 06:16:44.000000000 +0100
@@ -1,7 +1,7 @@
 --- !ruby/object:Gem::Specification
 name: haml
 version: !ruby/object:Gem::Version
-  version: 6.0.7
+  version: 6.0.12
 platform: ruby
 authors:
 - Natalie Weizenbaum
@@ -12,7 +12,7 @@
 autorequire: 
 bindir: exe
 cert_chain: []
-date: 2022-10-14 00:00:00.000000000 Z
+date: 2022-11-27 00:00:00.000000000 Z
 dependencies:
 - !ruby/object:Gem::Dependency
   name: temple
@@ -334,6 +334,7 @@
 - lib/haml/temple_line_counter.rb
 - lib/haml/util.rb
 - lib/haml/version.rb
+- lib/haml/whitespace.rb
 homepage: https://haml.info
 licenses:
 - MIT
@@ -353,7 +354,7 @@
     - !ruby/object:Gem::Version
       version: '0'
 requirements: []
-rubygems_version: 3.3.7
+rubygems_version: 3.4.0.dev
 signing_key: 
 specification_version: 4
 summary: An elegant, structured (X)HTML/XML templating engine.

Reply via email to