haml 6.0.0.beta.2 → 6.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -2
- data/README.md +1 -1
- data/lib/haml/attribute_compiler.rb +1 -1
- data/lib/haml/attribute_parser.rb +7 -1
- data/lib/haml/railtie.rb +0 -5
- data/lib/haml/util.rb +3 -2
- data/lib/haml/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 909d5636fba736ef06747221b4d0ff34a8c5b850f2c8d4cc60ac27843e914e94
|
4
|
+
data.tar.gz: 478fd2cce0e05e386690aa83fa41132da006cb02437ec43a0b4882842a2e973c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
6
|
-
([diff](https://github.com/haml/haml/compare/v5.2.2...
|
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
|
[](http://rubygems.org/gems/haml)
|
4
|
-
[](https://github.com/haml/haml/actions/workflows/test.yml)
|
5
5
|
[](https://codeclimate.com/github/haml/haml)
|
6
6
|
[](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 || !
|
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
|
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 = "
|
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
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.
|
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-
|
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:
|
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: []
|