haml 6.0.0.beta.2 → 6.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6964b87cfc74066321cba0147ad79d0384bb5f28bc2e5a1fff8b4dc2f49ea0d2
4
- data.tar.gz: e0ce73fab6bc19bf808b892ceff3fcd838b78fb2d78239cc0255185b46fadc8b
3
+ metadata.gz: 909d5636fba736ef06747221b4d0ff34a8c5b850f2c8d4cc60ac27843e914e94
4
+ data.tar.gz: 478fd2cce0e05e386690aa83fa41132da006cb02437ec43a0b4882842a2e973c
5
5
  SHA512:
6
- metadata.gz: ee2ed54cab4219c44a1a1c135b76a57551d418ed15039deab855f09dc36fc288df7c81a1866372e2c7edf94bb5a8c993cd9b0b5ebd7a16be6fa72833f5449a2f
7
- data.tar.gz: ad13e3fc711a7416f7433da206f82574fa5aa5d02662234549e8738200a82f19321ed3176cded723f599861fab911970308a53db9337c750bdbc9996d9009fa2
6
+ metadata.gz: 268bfdc33ba76950ab553692c5ff1c45b84a3f3b4185248a19c6a3a74f4b47cd46527d279ed3782f9b7fd6bba6be889a531b7e6c133a4f00ac7e3e06d61a464c
7
+ data.tar.gz: 1b4f559abe65e3c39627d87b6cc2da894ca67514f62d702ff0920d9d974dda49d4ab7b49e465157622b31a9c3ad5b1925e5e4aa2b1360640d784a7a6f537178a
data/CHANGELOG.md CHANGED
@@ -1,9 +1,17 @@
1
1
  # Haml Changelog
2
2
 
3
+ ## 6.0.1
4
+
5
+ Released on September 23, 2022
6
+ ([diff](https://github.com/haml/haml/compare/v6.0.0...v6.0.1)).
7
+
8
+ * Unescape HTML-safe interpolation on Rails [#1084](https://github.com/haml/haml/issues/1084)
9
+ * Resurrect Haml 5's `AttributeParser.available?` for syntax\_tree-haml [#1085](https://github.com/haml/haml/issues/1085)
10
+
3
11
  ## 6.0.0
4
12
 
5
- Not released yet
6
- ([diff](https://github.com/haml/haml/compare/v5.2.2...main)).
13
+ Released on September 21, 2022
14
+ ([diff](https://github.com/haml/haml/compare/v5.2.2...v6.0.0)).
7
15
 
8
16
  * Replace the implementation with Hamlit
9
17
  * Haml 6 is about 1.7x faster than Haml 5 in [this benchmark](benchmark/slim/run-benchmarks.rb).
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Haml
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/haml.svg)](http://rubygems.org/gems/haml)
4
- [![Build Status](https://travis-ci.org/haml/haml.svg?branch=main)](http://travis-ci.org/haml/haml)
4
+ [![test](https://github.com/haml/haml/actions/workflows/test.yml/badge.svg)](https://github.com/haml/haml/actions/workflows/test.yml)
5
5
  [![Code Climate](https://codeclimate.com/github/haml/haml/badges/gpa.svg)](https://codeclimate.com/github/haml/haml)
6
6
  [![Inline docs](http://inch-ci.org/github/haml/haml.png)](http://inch-ci.org/github/haml/haml)
7
7
 
@@ -14,7 +14,7 @@ module Haml
14
14
 
15
15
  def compile(node)
16
16
  hashes = []
17
- if node.value[:object_ref] != :nil || !Ripper.respond_to?(:lex) # No Ripper.lex in truffleruby
17
+ if node.value[:object_ref] != :nil || !AttributeParser.available?
18
18
  return runtime_compile(node)
19
19
  end
20
20
  [node.value[:dynamic_attributes].new, node.value[:dynamic_attributes].old].compact.each do |attribute_str|
@@ -6,13 +6,19 @@ module Haml
6
6
  class ParseSkip < StandardError
7
7
  end
8
8
 
9
+ # @return [TrueClass, FalseClass] - return true if AttributeParser.parse can be used.
10
+ def self.available?
11
+ # TruffleRuby doesn't have Ripper.lex
12
+ defined?(Ripper) && Ripper.respond_to?(:lex) && Temple::StaticAnalyzer.available?
13
+ end
14
+
9
15
  def self.parse(text)
10
16
  self.new.parse(text)
11
17
  end
12
18
 
13
19
  def parse(text)
14
20
  exp = wrap_bracket(text)
15
- return if RubyExpression.syntax_error?(exp)
21
+ return if Temple::StaticAnalyzer.syntax_error?(exp)
16
22
 
17
23
  hash = {}
18
24
  tokens = Ripper.lex(exp)[1..-2] || []
data/lib/haml/railtie.rb CHANGED
@@ -4,11 +4,6 @@ require 'rails'
4
4
  module Haml
5
5
  class Railtie < ::Rails::Railtie
6
6
  initializer :haml, before: :load_config_initializers do |app|
7
- # Load haml/plugin first to override if available
8
- begin
9
- require 'haml/plugin'
10
- rescue LoadError
11
- end
12
7
  require 'haml/rails_template'
13
8
  end
14
9
  end
data/lib/haml/util.rb CHANGED
@@ -26,8 +26,9 @@ module Haml
26
26
  require 'haml/haml' # Haml::Util.escape_html
27
27
  end
28
28
 
29
+ # TODO: Remove unescape_interpolation's workaround and get rid of `respond_to?`.
29
30
  def self.escape_html_safe(html)
30
- html.html_safe? ? html : escape_html(html)
31
+ (html.respond_to?(:html_safe?) && html.html_safe?) ? html : escape_html(html)
31
32
  end
32
33
 
33
34
  # Silence all output to STDERR within a block.
@@ -216,7 +217,7 @@ MSG
216
217
  end
217
218
  content = eval("\"#{interpolated}\"")
218
219
  content = "#{char}#{content}" if char == '@' || char == '$'
219
- content = "CGI.escapeHTML((#{content}).to_s)" if escape_html
220
+ content = "Haml::Util.escape_html_safe((#{content}).to_s)" if escape_html
220
221
 
221
222
  res << "\#{#{content}}"
222
223
  end
data/lib/haml/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Haml
3
- VERSION = '6.0.0.beta.2'
3
+ VERSION = '6.0.1'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: haml
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.0.beta.2
4
+ version: 6.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Natalie Weizenbaum
@@ -9,10 +9,10 @@ authors:
9
9
  - Norman Clarke
10
10
  - Akira Matsuda
11
11
  - Takashi Kokubun
12
- autorequire:
12
+ autorequire:
13
13
  bindir: exe
14
14
  cert_chain: []
15
- date: 2022-08-21 00:00:00.000000000 Z
15
+ date: 2022-09-23 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: temple
@@ -337,7 +337,7 @@ homepage: https://haml.info
337
337
  licenses:
338
338
  - MIT
339
339
  metadata: {}
340
- post_install_message:
340
+ post_install_message:
341
341
  rdoc_options: []
342
342
  require_paths:
343
343
  - lib
@@ -348,12 +348,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
348
348
  version: 2.1.0
349
349
  required_rubygems_version: !ruby/object:Gem::Requirement
350
350
  requirements:
351
- - - ">"
351
+ - - ">="
352
352
  - !ruby/object:Gem::Version
353
- version: 1.3.1
353
+ version: '0'
354
354
  requirements: []
355
355
  rubygems_version: 3.3.7
356
- signing_key:
356
+ signing_key:
357
357
  specification_version: 4
358
358
  summary: An elegant, structured (X)HTML/XML templating engine.
359
359
  test_files: []