-
Notifications
You must be signed in to change notification settings - Fork 1
Bump haml from 6.3.0 to 7.1.0 #836
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
Contributor
gem compare haml 6.3.0 7.1.0Compared versions: ["6.3.0", "7.1.0"]
DIFFERENT date:
6.3.0: 2023-12-10 00:00:00 UTC
7.1.0: 1980-01-02 00:00:00 UTC
DIFFERENT metadata:
6.3.0: {"rubygems_mfa_required" => "true"}
7.1.0: {"rubygems_mfa_required" => "true", "changelog_uri" => "https://haml.info/docs/yardoc/file.CHANGELOG.html", "source_code_uri" => "https://github.com/haml/haml"}
DIFFERENT required_ruby_version:
6.3.0: >= 2.1.0
7.1.0: >= 3.2.0
DIFFERENT rubygems_version:
6.3.0: 3.4.10
7.1.0: 3.6.7
DIFFERENT version:
6.3.0: 6.3.0
7.1.0: 7.1.0
DIFFERENT files:
6.3.0->7.1.0:
* Added:
.github/workflows/release.yml +46/-0
* Changed:
.github/workflows/test.yml +5/-7
CHANGELOG.md +32/-1
Gemfile +4/-6
README.md +2/-1
REFERENCE.md +9/-16
bin/console +3/-4
bin/stackprof +2/-2
haml.gemspec +4/-2
lib/haml/attribute_builder.rb +10/-10
lib/haml/attribute_compiler.rb +2/-2
lib/haml/engine.rb +2/-2
lib/haml/filters/plain.rb +1/-1
lib/haml/filters/ruby.rb +1/-1
lib/haml/parser.rb +10/-10
lib/haml/rails_template.rb +2/-2
lib/haml/string_splitter.rb +1/-1
lib/haml/util.rb +2/-2
lib/haml/version.rb +1/-1
DIFFERENT development dependencies:
6.3.0->7.1.0:
* Deleted:
haml [">= 5"] (development)
DIFFERENT Gemfile dependencies
6.3.0->7.1.0:
* Added:
base64 [">= 0"] (runtime)
bigdecimal [">= 0"] (runtime)
mutex_m [">= 0"] (runtime)
* Deleted
pry [">= 0"] (runtime)
rake-compiler ["< 1.2.4"] (runtime) |
Contributor
gem compare --diff haml 6.3.0 7.1.0Compared versions: ["6.3.0", "7.1.0"]
DIFFERENT files:
6.3.0->7.1.0:
* Added:
.github/workflows/release.yml
--- /tmp/20251212-2477-9cazvh 2025-12-12 03:01:37.758960541 +0000
+++ /tmp/d20251212-2477-il2uzp/haml-7.1.0/.github/workflows/release.yml 2025-12-12 03:01:37.747960571 +0000
@@ -0,0 +1,46 @@
+name: Release
+
+on:
+ push:
+ tags:
+ - 'v*'
+
+permissions:
+ contents: read
+
+jobs:
+ push:
+ if: github.repository_owner == 'haml'
+ runs-on: ubuntu-latest
+
+ environment:
+ name: rubygems.org
+ url: https://rubygems.org/gems/haml
+
+ permissions:
+ contents: write
+ id-token: write
+
+ steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+
+ - name: Set up Ruby
+ uses: ruby/setup-ruby@eaecf785f6a34567a6d97f686bbb7bccc1ac1e5c # v1.237.0
+ with:
+ bundler-cache: true
+ ruby-version: ruby
+
+ - name: Publish to RubyGems
+ uses: rubygems/release-gem@a25424ba2ba8b387abc8ef40807c2c85b96cbe32 # v1.1.1
+
+ - name: Create GitHub release
+ run: |
+ tag_name="$(git describe --tags --abbrev=0)"
+ gh release create "${tag_name}" --verify-tag --generate-notes
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
* Changed:
.github/workflows/test.yml
--- /tmp/d20251212-2477-il2uzp/haml-6.3.0/.github/workflows/test.yml 2025-12-12 03:01:37.737960598 +0000
+++ /tmp/d20251212-2477-il2uzp/haml-7.1.0/.github/workflows/test.yml 2025-12-12 03:01:37.748960568 +0000
@@ -20,5 +19,0 @@
- - '2.5'
- - '2.6'
- - '2.7'
- - '3.0'
- - '3.1'
@@ -25,0 +21,3 @@
+ - '3.3'
+ - '3.4'
+ - ruby-head
@@ -27 +25 @@
- - truffleruby-head
+ - truffleruby
@@ -29 +27 @@
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
CHANGELOG.md
--- /tmp/d20251212-2477-il2uzp/haml-6.3.0/CHANGELOG.md 2025-12-12 03:01:37.738960595 +0000
+++ /tmp/d20251212-2477-il2uzp/haml-7.1.0/CHANGELOG.md 2025-12-12 03:01:37.748960568 +0000
@@ -2,0 +3,32 @@
+## 7.1.0
+
+* Support xhtml format for boolean nested data attributes https://github.com/haml/haml/pull/1200
+
+## 7.0.2
+
+* Replace usages of `=~` with `.match?` where possible https://github.com/haml/haml/pull/1196
+* Add source code URI to gemspec metadata https://github.com/haml/haml/pull/1197
+
+## 7.0.1
+
+* Use `Regexp#match?` predicate where possible https://github.com/haml/haml/pull/1194
+* Fix the 'Changelog' link on rubygems.org/gems/haml https://github.com/haml/haml/pull/1192
+
+## 7.0.0
+
+* Change the default `attr_quote` from `'` to `"` https://github.com/haml/haml/issues/1188
+* Bump required Ruby version to 3.2 https://github.com/haml/haml/issues/1176
+
+## 6.4.0
+
+* Authorize characters in attribute name for vuejs https://github.com/haml/haml/pull/1172
+* Compile new-style attributes statically https://github.com/haml/haml/pull/1165
+* Remove newlines from template annotation comments https://github.com/haml/haml/pull/1186
+* Fix line numbers within a :ruby filter https://github.com/haml/haml/pull/1166
+* Fix .class + nested class array bug https://github.com/haml/haml/pull/1191
+
+## 6.3.1
+
+* Optimize string transformation using `String#tr` https://github.com/haml/haml/pull/1168
+* Provide a Changelog link on rubygems.org https://github.com/haml/haml/pull/1157
+
@@ -11 +42,0 @@
- * See [the reference](https://github.com/haml/haml/blob/v6.2.5/REFERENCE.md#turbo) for suggested alternatives.
Gemfile
--- /tmp/d20251212-2477-il2uzp/haml-6.3.0/Gemfile 2025-12-12 03:01:37.738960595 +0000
+++ /tmp/d20251212-2477-il2uzp/haml-7.1.0/Gemfile 2025-12-12 03:01:37.749960565 +0000
@@ -13 +13,3 @@
-gem 'pry'
+gem 'base64'
+gem 'bigdecimal'
+gem 'mutex_m'
@@ -15 +17 @@
-if /java/ === RUBY_PLATFORM # JRuby
+if /java/.match?(RUBY_PLATFORM) # JRuby
@@ -23,4 +24,0 @@
-end
-
-if RUBY_VERSION < '2.6'
- gem 'rake-compiler', '< 1.2.4'
README.md
--- /tmp/d20251212-2477-il2uzp/haml-6.3.0/README.md 2025-12-12 03:01:37.739960592 +0000
+++ /tmp/d20251212-2477-il2uzp/haml-7.1.0/README.md 2025-12-12 03:01:37.749960565 +0000
@@ -6,0 +7 @@
+[](https://discord.gg/G8dEAwvV2Y)
@@ -159 +160 @@
-Haml currently supports Ruby 2.0.0 and higher, so please make sure your changes run on 2.0+.
+Haml currently supports Ruby 3.2.0 and higher, so please make sure your changes run on 3.2+.
REFERENCE.md
--- /tmp/d20251212-2477-il2uzp/haml-6.3.0/REFERENCE.md 2025-12-12 03:01:37.739960592 +0000
+++ /tmp/d20251212-2477-il2uzp/haml-7.1.0/REFERENCE.md 2025-12-12 03:01:37.749960565 +0000
@@ -108 +108 @@
-For the complete list of available options, please see `Haml::Engine`.
+For the complete list of available options, please see [`Haml::Engine`](https://github.com/haml/haml/blob/main/lib/haml/engine.rb).
@@ -323 +323 @@
-[`Haml::AttributeBuilder::BOOLEAN_ATTRIBUTES`](https://github.com/haml/haml/blob/main/lib/haml/attribute_builder.rb#L5),
+[`Haml::BOOLEAN_ATTRIBUTES`](https://github.com/haml/haml/blob/main/lib/haml/attribute_compiler.rb#L8),
@@ -363,7 +362,0 @@
-Notice that the underscore in `author_id` was replaced with a hyphen. If you wish
-to suppress this behavior, you can set Haml's
-{Haml::Options#hyphenate_data_attrs `:hyphenate_data_attrs` option} to `false`,
-and the output will be rendered as:
-
- <a data-author_id='123' data-category='7' href='/posts'>Posts By Author</a>
-
@@ -571 +564 @@
- @user = CrazyUser.find(15)
+ @user = FriendlyUser.find(15)
@@ -582 +575 @@
- <div class='greeting_crazy_user' id='greeting_crazy_user_15'>
+ <div class='greeting_friendly_user' id='greeting_friendly_user_15'>
@@ -590 +583 @@
- # file: app/models/crazy_user.rb
+ # file: app/models/friendly_user.rb
@@ -592 +585 @@
- class CrazyUser < ActiveRecord::Base
+ class FriendlyUser < ActiveRecord::Base
@@ -594 +587 @@
- "a_crazy_user"
+ "a_friendly_user"
@@ -605 +598 @@
- <div class='a_crazy_user' id='a_crazy_user_15'>
+ <div class='a_friendly_user' id='a_friendly_user_15'>
@@ -1301 +1294 @@
-For people using Turbo-rails and Haml 6+ need to either:
+For people using Turbo-rails need to either:
bin/console
--- /tmp/d20251212-2477-il2uzp/haml-6.3.0/bin/console 2025-12-12 03:01:37.739960592 +0000
+++ /tmp/d20251212-2477-il2uzp/haml-7.1.0/bin/console 2025-12-12 03:01:37.750960563 +0000
@@ -4 +4 @@
-require 'hamlit'
+require 'haml'
@@ -9,3 +9,2 @@
-# (If you use this, don't forget to add pry to your Gemfile!)
-require 'pry'
-Pry.start
+require 'irb'
+IRB.start
bin/stackprof
--- /tmp/d20251212-2477-il2uzp/haml-6.3.0/bin/stackprof 2025-12-12 03:01:37.740960590 +0000
+++ /tmp/d20251212-2477-il2uzp/haml-7.1.0/bin/stackprof 2025-12-12 03:01:37.750960563 +0000
@@ -4 +4 @@
-require 'hamlit'
+require 'haml'
@@ -23 +23 @@
-Hamlit::Engine.new.call(haml)
+Haml::Engine.new.call(haml)
haml.gemspec
--- /tmp/d20251212-2477-il2uzp/haml-6.3.0/haml.gemspec 2025-12-12 03:01:37.740960590 +0000
+++ /tmp/d20251212-2477-il2uzp/haml-7.1.0/haml.gemspec 2025-12-12 03:01:37.751960560 +0000
@@ -24 +24,4 @@
- spec.required_ruby_version = '>= 2.1.0'
+ spec.metadata["changelog_uri"] = spec.homepage + "/docs/yardoc/file.CHANGELOG.html"
+ spec.metadata["source_code_uri"] = "https://github.com/haml/haml"
+
+ spec.required_ruby_version = '>= 3.2.0'
@@ -34 +36,0 @@
- spec.add_development_dependency 'haml', '>= 5'
lib/haml/attribute_builder.rb
--- /tmp/d20251212-2477-il2uzp/haml-6.3.0/lib/haml/attribute_builder.rb 2025-12-12 03:01:37.741960587 +0000
+++ /tmp/d20251212-2477-il2uzp/haml-7.1.0/lib/haml/attribute_builder.rb 2025-12-12 03:01:37.751960560 +0000
@@ -19 +19 @@
- buf << build_data(escape_attrs, quote, *hash[key])
+ buf << build_data(escape_attrs, quote, format, *hash[key])
@@ -21 +21 @@
- buf << build_aria(escape_attrs, quote, *hash[key])
+ buf << build_aria(escape_attrs, quote, format, *hash[key])
@@ -57 +57 @@
- classes += value.select { |v| v }
+ classes += value.flatten.select { |v| v }
@@ -65,2 +65,2 @@
- def build_data(escape_attrs, quote, *hashes)
- build_data_attribute(:data, escape_attrs, quote, *hashes)
+ def build_data(escape_attrs, quote, format, *hashes)
+ build_data_attribute(:data, escape_attrs, quote, format, *hashes)
@@ -69,2 +69,2 @@
- def build_aria(escape_attrs, quote, *hashes)
- build_data_attribute(:aria, escape_attrs, quote, *hashes)
+ def build_aria(escape_attrs, quote, format, *hashes)
+ build_data_attribute(:aria, escape_attrs, quote, format, *hashes)
@@ -75 +75 @@
- def build_data_attribute(key, escape_attrs, quote, *hashes)
+ def build_data_attribute(key, escape_attrs, quote, format, *hashes)
@@ -87 +87 @@
- attrs << " #{key}"
+ build_boolean!(escape_attrs, quote, format, attrs, key, value)
@@ -108 +108 @@
- flattened["#{key}-#{k.to_s.gsub(/_/, '-')}"] = v
+ flattened["#{key}-#{k.to_s.tr('_', '-')}"] = v
lib/haml/attribute_compiler.rb
--- /tmp/d20251212-2477-il2uzp/haml-6.3.0/lib/haml/attribute_compiler.rb 2025-12-12 03:01:37.741960587 +0000
+++ /tmp/d20251212-2477-il2uzp/haml-7.1.0/lib/haml/attribute_compiler.rb 2025-12-12 03:01:37.751960560 +0000
@@ -88 +88 @@
- args = [@escape_attrs.inspect, "#{@quote.inspect}.freeze", values.map { |v| literal_for(v) }]
+ args = [@escape_attrs.inspect, "#{@quote.inspect}.freeze", @format.inspect, values.map { |v| literal_for(v) }]
@@ -101 +101 @@
- if Temple::StaticAnalyzer.static?(exp)
+ if values.last.first == :static || Temple::StaticAnalyzer.static?(exp)
lib/haml/engine.rb
--- /tmp/d20251212-2477-il2uzp/haml-6.3.0/lib/haml/engine.rb 2025-12-12 03:01:37.742960584 +0000
+++ /tmp/d20251212-2477-il2uzp/haml-7.1.0/lib/haml/engine.rb 2025-12-12 03:01:37.753960555 +0000
@@ -20 +20 @@
- attr_quote: "'",
+ attr_quote: '"',
@@ -26 +26 @@
- filename: "",
+ filename: '',
lib/haml/filters/plain.rb
--- /tmp/d20251212-2477-il2uzp/haml-6.3.0/lib/haml/filters/plain.rb 2025-12-12 03:01:37.744960579 +0000
+++ /tmp/d20251212-2477-il2uzp/haml-7.1.0/lib/haml/filters/plain.rb 2025-12-12 03:01:37.755960549 +0000
@@ -10 +10 @@
- [:multi, *compile_plain(text)]
+ [:multi, [:newline], *compile_plain(text)]
lib/haml/filters/ruby.rb
--- /tmp/d20251212-2477-il2uzp/haml-6.3.0/lib/haml/filters/ruby.rb 2025-12-12 03:01:37.744960579 +0000
+++ /tmp/d20251212-2477-il2uzp/haml-7.1.0/lib/haml/filters/ruby.rb 2025-12-12 03:01:37.755960549 +0000
@@ -6 +6 @@
- [:code, node.value[:text]]
+ [:multi, [:newline], [:code, node.value[:text]]]
lib/haml/parser.rb
--- /tmp/d20251212-2477-il2uzp/haml-6.3.0/lib/haml/parser.rb 2025-12-12 03:01:37.746960574 +0000
+++ /tmp/d20251212-2477-il2uzp/haml-7.1.0/lib/haml/parser.rb 2025-12-12 03:01:37.756960546 +0000
@@ -185 +185 @@
- return @template_tabs + 1 if flat? && line.whitespace =~ /^#{@flat_spaces}/
+ return @template_tabs + 1 if flat? && /^#{@flat_spaces}/.match?(line.whitespace)
@@ -239 +239 @@
- unless value =~ /\A{.*}\z/m
+ unless /\A{.*}\z/m.match?(value)
@@ -531 +531 @@
- raise Error.new(Error.message(:invalid_filter_name, name)) unless name =~ /^\w+$/
+ raise Error.new(Error.message(:invalid_filter_name, name)) unless /^\w+$/.match?(name)
@@ -633 +633 @@
- if !attributes.empty? && (attributes =~ /[.#](\.|#|\z)/)
+ if !attributes.empty? && /[.#](\.|#|\z)/.match?(attributes)
@@ -752 +752 @@
- unless (name = scanner.scan(/[-:\w]+/))
+ unless (name = scanner.scan(/[-:@#\w\.]+/))
@@ -789 +789 @@
- (line_defined && @line.text[0] == ?: && line.full =~ %r[^#{@line.full[/^\s+/]}\s])
+ (line_defined && @line.text[0] == ?: && %r[^#{@line.full[/^\s+/]}\s].match?(line.full))
@@ -799 +799 @@
- line && !line.text.empty? && line.full !~ /^#{@flat_spaces}/
+ line && !line.text.empty? && !(/^#{@flat_spaces}/.match?(line.full))
@@ -817 +817 @@
- text && text.length > 1 && text[-1] == MULTILINE_CHAR_VALUE && text[-2] == ?\s && text !~ BLOCK_WITH_SPACES
+ text && text.length > 1 && text[-1] == MULTILINE_CHAR_VALUE && text[-2] == ?\s && !BLOCK_WITH_SPACES.match?(text)
@@ -841 +841 @@
- !((text[-3, 2] =~ /\W\?/) || text[-3, 2] == "?\\")
+ !(/\W\?/.match?(text[-3, 2]) || text[-3, 2] == "?\\")
@@ -874 +874 @@
- @next_line.full =~ (@indentation ? /^#{@indentation * (@template_tabs + 1)}/ : /^\s/)
+ (@indentation ? /^#{@indentation * (@template_tabs + 1)}/ : /^\s/).match?(@next_line.full)
lib/haml/rails_template.rb
--- /tmp/d20251212-2477-il2uzp/haml-6.3.0/lib/haml/rails_template.rb 2025-12-12 03:01:37.746960574 +0000
+++ /tmp/d20251212-2477-il2uzp/haml-7.1.0/lib/haml/rails_template.rb 2025-12-12 03:01:37.756960546 +0000
@@ -43,2 +43,2 @@
- preamble: "<!-- BEGIN #{template.short_identifier} -->\n",
- postamble: "<!-- END #{template.short_identifier} -->\n",
+ preamble: "<!-- BEGIN #{template.short_identifier} -->",
+ postamble: "<!-- END #{template.short_identifier} -->",
lib/haml/string_splitter.rb
--- /tmp/d20251212-2477-il2uzp/haml-6.3.0/lib/haml/string_splitter.rb 2025-12-12 03:01:37.746960574 +0000
+++ /tmp/d20251212-2477-il2uzp/haml-7.1.0/lib/haml/string_splitter.rb 2025-12-12 03:01:37.757960544 +0000
@@ -10 +10 @@
- if defined?(Ripper) && RUBY_VERSION >= "2.0.0" && Ripper.respond_to?(:lex)
+ if defined?(Ripper) && Ripper.respond_to?(:lex)
lib/haml/util.rb
--- /tmp/d20251212-2477-il2uzp/haml-6.3.0/lib/haml/util.rb 2025-12-12 03:01:37.747960571 +0000
+++ /tmp/d20251212-2477-il2uzp/haml-7.1.0/lib/haml/util.rb 2025-12-12 03:01:37.757960544 +0000
@@ -72 +72 @@
- elsif str.encoding.name =~ /^UTF-(16|32)(BE|LE)?$/
+ elsif /^UTF-(16|32)(BE|LE)?$/.match?(str.encoding.name)
@@ -255 +255 @@
- return unless name =~ /(en)?coding/in
+ return unless /(en)?coding/in.match?(name)
lib/haml/version.rb
--- /tmp/d20251212-2477-il2uzp/haml-6.3.0/lib/haml/version.rb 2025-12-12 03:01:37.747960571 +0000
+++ /tmp/d20251212-2477-il2uzp/haml-7.1.0/lib/haml/version.rb 2025-12-12 03:01:37.757960544 +0000
@@ -3 +3 @@
- VERSION = '6.3.0'
+ VERSION = '7.1.0' |
Contributor
gem compare temple 0.10.3 0.10.4Compared versions: ["0.10.3", "0.10.4"]
DIFFERENT date:
0.10.3: 2023-10-03 00:00:00 UTC
0.10.4: 2025-07-24 00:00:00 UTC
DIFFERENT rubygems_version:
0.10.3: 3.4.10
0.10.4: 3.6.7
DIFFERENT version:
0.10.3: 0.10.3
0.10.4: 0.10.4
DIFFERENT files:
0.10.3->0.10.4:
* Changed:
.github/workflows/test.yml +3/-1
CHANGES +4/-0
lib/temple/filters/encoding.rb +1/-1
lib/temple/version.rb +1/-1 |
Contributor
gem compare --diff temple 0.10.3 0.10.4Compared versions: ["0.10.3", "0.10.4"]
DIFFERENT files:
0.10.3->0.10.4:
* Changed:
.github/workflows/test.yml
--- /tmp/d20251212-3047-u8a2ib/temple-0.10.3/.github/workflows/test.yml 2025-12-12 03:02:01.049891023 +0000
+++ /tmp/d20251212-3047-u8a2ib/temple-0.10.4/.github/workflows/test.yml 2025-12-12 03:02:01.058891003 +0000
@@ -25,0 +26,2 @@
+ - '3.3'
+ - '3.4'
@@ -29 +31 @@
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
CHANGES
--- /tmp/d20251212-3047-u8a2ib/temple-0.10.3/CHANGES 2025-12-12 03:02:01.050891021 +0000
+++ /tmp/d20251212-3047-u8a2ib/temple-0.10.4/CHANGES 2025-12-12 03:02:01.059891000 +0000
@@ -0,0 +1,4 @@
+0.10.4
+
+ * Fix Ruby 3.4 compatibility (#152)
+
lib/temple/filters/encoding.rb
--- /tmp/d20251212-3047-u8a2ib/temple-0.10.3/lib/temple/filters/encoding.rb 2025-12-12 03:02:01.053891014 +0000
+++ /tmp/d20251212-3047-u8a2ib/temple-0.10.4/lib/temple/filters/encoding.rb 2025-12-12 03:02:01.061890996 +0000
@@ -13 +13 @@
- s = s.dup if s.frozen?
+ s = +s
lib/temple/version.rb
--- /tmp/d20251212-3047-u8a2ib/temple-0.10.3/lib/temple/version.rb 2025-12-12 03:02:01.058891003 +0000
+++ /tmp/d20251212-3047-u8a2ib/temple-0.10.4/lib/temple/version.rb 2025-12-12 03:02:01.066890984 +0000
@@ -3 +3 @@
- VERSION = '0.10.3'
+ VERSION = '0.10.4' |
Contributor
gem compare tilt 2.4.0 2.6.1Compared versions: ["2.4.0", "2.6.1"]
DIFFERENT date:
2.4.0: 2024-06-27 00:00:00 UTC
2.6.1: 1980-01-02 00:00:00 UTC
DIFFERENT rubygems_version:
2.4.0: 3.5.9
2.6.1: 3.6.7
DIFFERENT version:
2.4.0: 2.4.0
2.6.1: 2.6.1
DIFFERENT files:
2.4.0->2.6.1:
* Deleted:
lib/tilt/erubis.rb
lib/tilt/maruku.rb
lib/tilt/wikicloth.rb
* Changed:
lib/tilt.rb +9/-4
lib/tilt/creole.rb +2/-0
lib/tilt/liquid.rb +0/-3
lib/tilt/mapping.rb +3/-3
lib/tilt/rdoc.rb +0/-8
lib/tilt/template.rb +184/-28 |
Contributor
gem compare --diff tilt 2.4.0 2.6.1Compared versions: ["2.4.0", "2.6.1"]
DIFFERENT files:
2.4.0->2.6.1:
* Deleted:
lib/tilt/erubis.rb
lib/tilt/maruku.rb
lib/tilt/wikicloth.rb
* Changed:
lib/tilt.rb
--- /tmp/d20251212-3494-bvgrj4/tilt-2.4.0/lib/tilt.rb 2025-12-12 03:02:24.013826609 +0000
+++ /tmp/d20251212-3494-bvgrj4/tilt-2.6.1/lib/tilt.rb 2025-12-12 03:02:24.019826591 +0000
@@ -8 +8,4 @@
- VERSION = '2.4.0'
+ VERSION = '2.6.1'
+
+ EMPTY_ARRAY = [].freeze
+ private_constant :EMPTY_ARRAY
@@ -13,0 +17 @@
+ @extract_fixed_locals = false
@@ -88,0 +93,4 @@
+ # Whether to extract fixed locals from templates by scanning the
+ # template content.
+ attr_accessor :extract_fixed_locals
+
@@ -142 +149,0 @@
- register_lazy :ErubisTemplate, 'tilt/erubis', 'erb', 'rhtml', 'erubis'
@@ -146 +152,0 @@
- register_lazy :MarukuTemplate, 'tilt/maruku', 'markdown', 'mkd', 'md'
@@ -178 +183,0 @@
- register_lazy :WikiClothTemplate, 'tilt/wikicloth', 'wiki', 'mediawiki', 'mw'
lib/tilt/creole.rb
--- /tmp/d20251212-3494-bvgrj4/tilt-2.4.0/lib/tilt/creole.rb 2025-12-12 03:02:24.014826606 +0000
+++ /tmp/d20251212-3494-bvgrj4/tilt-2.6.1/lib/tilt/creole.rb 2025-12-12 03:02:24.020826588 +0000
@@ -4,0 +5,2 @@
+warn 'tilt/creole is deprecated, as creole requires modifying string literals', uplevel: 1
+
lib/tilt/liquid.rb
--- /tmp/d20251212-3494-bvgrj4/tilt-2.4.0/lib/tilt/liquid.rb 2025-12-12 03:02:24.015826603 +0000
+++ /tmp/d20251212-3494-bvgrj4/tilt-2.6.1/lib/tilt/liquid.rb 2025-12-12 03:02:24.021826585 +0000
@@ -16,3 +15,0 @@
- #
- # It's suggested that your program require 'liquid' at load
- # time when using this template engine.
lib/tilt/mapping.rb
--- /tmp/d20251212-3494-bvgrj4/tilt-2.4.0/lib/tilt/mapping.rb 2025-12-12 03:02:24.016826600 +0000
+++ /tmp/d20251212-3494-bvgrj4/tilt-2.6.1/lib/tilt/mapping.rb 2025-12-12 03:02:24.022826582 +0000
@@ -116 +116 @@
- # mapping.register_lazy('Maruku::Template', 'maruku/template', 'md')
+ # mapping.register_lazy('Kramdown::Template', 'kramdown/template', 'md')
@@ -122,2 +122,2 @@
- # Maruku. Tilt will first try to `require "rdiscount/template"`, falling
- # back to `require "maruku/template"`. If none of these are successful,
+ # Kramdown. Tilt will first try to `require "rdiscount/template"`, falling
+ # back to `require "kramdown/template"`. If none of these are successful,
lib/tilt/rdoc.rb
--- /tmp/d20251212-3494-bvgrj4/tilt-2.4.0/lib/tilt/rdoc.rb 2025-12-12 03:02:24.017826597 +0000
+++ /tmp/d20251212-3494-bvgrj4/tilt-2.6.1/lib/tilt/rdoc.rb 2025-12-12 03:02:24.023826579 +0000
@@ -9,8 +8,0 @@
-#
-# It's suggested that your program run the following at load time when
-# using this templae engine in a threaded environment:
-#
-# require 'rdoc'
-# require 'rdoc/markup'
-# require 'rdoc/markup/to_html'
-# require 'rdoc/options'
lib/tilt/template.rb
--- /tmp/d20251212-3494-bvgrj4/tilt-2.4.0/lib/tilt/template.rb 2025-12-12 03:02:24.018826594 +0000
+++ /tmp/d20251212-3494-bvgrj4/tilt-2.6.1/lib/tilt/template.rb 2025-12-12 03:02:24.024826576 +0000
@@ -60 +60,22 @@
- # All arguments are optional.
+ # All arguments are optional. The following options are respected and
+ # are used by Tilt::Template itself and not the underlying template
+ # libraries:
+ #
+ # :default_encoding :: Force the encoding of the template to the given
+ # encoding.
+ # :skip_compiled_encoding_detection :: Do not scan template code for
+ # an encoding magic comment.
+ # :fixed_locals :: Force a specific method parameter signature, and call
+ # the method with a splat of locals, instead of passing
+ # the locals hash as a positional argument, and
+ # extracting locals from that. Should be a string
+ # containing the parameters for the compiled method,
+ # surrounded by parentheses. Can be set to false to
+ # disable the scan for embedded fixed locals.
+ # :extract_fixed_locals :: Whether embedded fixed locals should be scanned for
+ # and extracted from the template code.
+ # :default_fixed_locals :: Similar to fixed_locals, but lowest priority,
+ # only used if :fixed_locals is not provided
+ # and no embedded locals are found (or scanned for).
+ # :scope_class :: Force the scope class used for the method. By default,
+ # uses the class of the scope provided to render.
@@ -72 +93,3 @@
- set_compiled_method_cache
+ # Force a specific scope class, instead of using the class of the provided
+ # scope as the scope class.
+ @scope_class = @options.delete :scope_class
@@ -80,0 +104,7 @@
+ # Compiled path to use. This must be specified as an option if
+ # providing the :scope_class option and using fixed locals,
+ # since template compilation occurs during initialization in that case.
+ if compiled_path = @options.delete(:compiled_path)
+ self.compiled_path = compiled_path
+ end
+
@@ -86 +116 @@
- @data = @data.dup if @data.frozen?
+ @data = _dup_string_if_frozen(@data)
@@ -94,0 +125 @@
+ set_fixed_locals
@@ -95,0 +127 @@
+ set_compiled_method_cache
@@ -121,0 +154,5 @@
+ # Whether the template uses fixed locals.
+ def fixed_locals?
+ @fixed_locals ? true : false
+ end
+
@@ -132 +169,8 @@
- # Set the prefix to use for compiled paths.
+ # Set the prefix to use for compiled paths, similar to using the
+ # :compiled_path template option. Note that this only
+ # has affect for future template compilations. When using the
+ # :scope_class template option, and using fixed_locals, calling
+ # this after the template is created has no effect, since the
+ # template is compiled during initialization in that case. It
+ # is recommended to use the :compiled_path template option
+ # instead of this method in new code.
@@ -148 +192,12 @@
- key = [scope_class, locals_keys].freeze
+ if @fixed_locals
+ if @scope_class
+ return @compiled_method
+ else
+ key = scope_class
+ end
+ elsif @scope_class
+ key = locals_keys.dup.freeze
+ else
+ key = [scope_class, locals_keys].freeze
+ end
+
@@ -184 +239 @@
- USE_BIND_CALL = RUBY_VERSION >= '2.7'
+ USE_BIND_CALL = RUBY_VERSION >= '3'
@@ -193,6 +248,2 @@
- locals_keys = locals.keys
- locals_keys.sort!{|x, y| x.to_s <=> y.to_s}
-
- case scope
- when Object
- scope_class = Module === scope ? scope : scope.class
+ if @fixed_locals
+ locals_keys = EMPTY_ARRAY
@@ -200,3 +251,2 @@
- # :nocov:
- scope_class = USE_BIND_CALL ? CLASS_METHOD.bind_call(scope) : CLASS_METHOD.bind(scope).call
- # :nocov:
+ locals_keys = locals.keys
+ locals_keys.sort!{|x, y| x.to_s <=> y.to_s}
@@ -204 +253,0 @@
- method = compiled_method(locals_keys, scope_class)
@@ -206,6 +255,9 @@
- if USE_BIND_CALL
- method.bind_call(scope, locals, &block)
- # :nocov:
- else
- method.bind(scope).call(locals, &block)
- # :nocov:
+ unless scope_class = @scope_class
+ scope_class = case scope
+ when Object
+ Module === scope ? scope : scope.class
+ else
+ # :nocov:
+ USE_BIND_CALL ? CLASS_METHOD.bind_call(scope) : CLASS_METHOD.bind(scope).call
+ # :nocov:
+ end
@@ -212,0 +265,2 @@
+
+ evaluate_method(compiled_method(locals_keys, scope_class), scope, locals, &block)
@@ -269,0 +324,12 @@
+ if RUBY_VERSION >= '2.3'
+ def _dup_string_if_frozen(string)
+ +string
+ end
+ # :nocov:
+ else
+ def _dup_string_if_frozen(string)
+ string.frozen? ? string.dup : string
+ end
+ end
+ # :nocov:
+
@@ -294 +360,6 @@
- @compiled_method = {}
+ @compiled_method = if @fixed_locals && @scope_class
+ # No hash needed, only a single compiled method per template.
+ compile_template_method(EMPTY_ARRAY, @scope_class)
+ else
+ {}
+ end
@@ -317,0 +389,25 @@
+ if USE_BIND_CALL
+ def evaluate_method(method, scope, locals, &block)
+ if @fixed_locals
+ method.bind_call(scope, **locals, &block)
+ else
+ method.bind_call(scope, locals, &block)
+ end
+ end
+ # :nocov:
+ else
+ def evaluate_method(method, scope, locals, &block)
+ if @fixed_locals
+ if locals.empty?
+ # Empty keyword splat on Ruby 2.0-2.6 passes empty hash
+ method.bind(scope).call(&block)
+ else
+ method.bind(scope).call(**locals, &block)
+ end
+ else
+ method.bind(scope).call(locals, &block)
+ end
+ end
+ end
+ # :nocov:
+
@@ -320 +416,6 @@
- local_code = local_extraction(local_keys)
+ if @fixed_locals
+ method_args = @fixed_locals
+ else
+ method_args = "(locals)"
+ local_code = local_extraction(local_keys)
+ end
@@ -331 +432 @@
- method_source << "::Tilt::TOPOBJECT.class_eval do\ndef #{method_name}(locals)\n#{local_code}\n"
+ method_source << "::Tilt::TOPOBJECT.class_eval do\ndef #{method_name}#{method_args}\n#{local_code}\n"
@@ -375 +476,6 @@
- File.binwrite(path, method_source)
+ # Write to a temporary path specific to the current process, and
+ # rename after writing. This prevents issues during parallel
+ # coverage testing.
+ tmp_path = "#{path}-#{$$}"
+ File.binwrite(tmp_path, method_source)
+ File.rename(tmp_path, path)
@@ -387,0 +494,34 @@
+ # Set the fixed locals for the template, which may be nil if no fixed locals can
+ # be determined.
+ def set_fixed_locals
+ fixed_locals = @options.delete(:fixed_locals)
+ extract_fixed_locals = @options.delete(:extract_fixed_locals)
+ default_fixed_locals = @options.delete(:default_fixed_locals)
+
+ if fixed_locals.nil?
+ if extract_fixed_locals.nil?
+ extract_fixed_locals = Tilt.extract_fixed_locals
+ end
+
+ if extract_fixed_locals
+ fixed_locals = extract_fixed_locals()
+ end
+
+ if fixed_locals.nil?
+ fixed_locals = default_fixed_locals
+ end
+ end
+
+ @fixed_locals = fixed_locals
+ end
+
+ # Extract fixed locals from the template code string. Should return nil
+ # if there are no fixed locals specified, or a method argument string
+ # surrounded by parentheses if there are fixed locals. The method
+ # argument string will be used when defining the template method if given.
+ def extract_fixed_locals
+ if @data.is_a?(String) && (match = /\#\s*locals:\s*(\(.*\))/.match(@data))
+ match[1]
+ end
+ end
+
@@ -393,2 +533,4 @@
- if script.frozen?
- script = script.dup
+ was_frozen = script.frozen?
+ script = _dup_string_if_frozen(script)
+
+ if was_frozen
@@ -415,0 +558,10 @@
+ # Static templates are templates that return the same output for every render
+ #
+ # Instead of inheriting from the StaticTemplate class, you will use the .subclass
+ # method with a block which processes @data and returns the transformed value.
+ #
+ # Basic example which transforms the template to uppercase:
+ #
+ # UppercaseTemplate = Tilt::StaticTemplate.subclass do
+ # @data.upcase
+ # end
@@ -452,0 +605,4 @@
+ end
+
+ # Do nothing, since fixed locals are not used.
+ def set_fixed_locals |
8755427 to
d7e6e4c
Compare
Bumps [haml](https://github.com/haml/haml) from 6.3.0 to 7.1.0. - [Release notes](https://github.com/haml/haml/releases) - [Changelog](https://github.com/haml/haml/blob/main/CHANGELOG.md) - [Commits](haml/haml@v6.3.0...v7.1.0) --- updated-dependencies: - dependency-name: haml dependency-version: 7.1.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
d7e6e4c to
eae1b7a
Compare
Contributor
Author
|
Superseded by #872. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bumps haml from 6.3.0 to 7.1.0.
Release notes
Sourced from haml's releases.
... (truncated)
Changelog
Sourced from haml's changelog.
Commits
2417298Version 7.1.016ea650Support xhtml format for boolean nested data attributes (#1198) (#1200)9c3e6afVersion 7.0.2f230d01Add source code URI to gemspec metadata (#1197)c251880Replace usages of =~ with.match?where possible (#1196)9e429d6Remove references to Hamlit (#1195)6ac290dVersion 7.0.1ca3a039UseRegexp#match?predicate where possible (#1194)616d129Remove references to unsupported Ruby versions (#1193)07b7284Fix the 'Changelog' link on rubygems.org/gems/haml (#1192)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot mergewill merge this PR after your CI passes on it@dependabot squash and mergewill squash and merge this PR after your CI passes on it@dependabot cancel mergewill cancel a previously requested merge and block automerging@dependabot reopenwill reopen this PR if it is closed@dependabot closewill close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)