haml 6.0.0-java → 6.0.1-java

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: 4924e3e24cb0f131b9f6e5f2b89875d4aa3450bc0310a4e6705d6fb59c94ac18
4
- data.tar.gz: 5cae3a510be49afaf4074676614b2348c0c08921b1f0d943d4f4a8bb74cb4498
3
+ metadata.gz: 68a6f34dd21649937e9a8b43f05e536ace7973921daf3db313817d3e95a92118
4
+ data.tar.gz: 7631ed48b303b7f2b692423f7a88b0e8cce20bf59a9adcf0eb93717492795fae
5
5
  SHA512:
6
- metadata.gz: 8a8fe83e1205aa401a9b5d0bb8d84842a6f21cd4ddef02360f70cfcab94957c2bb261e80edcec1333e84b6f626dc5a9778ab2cce59bb4e0142908e9fb1fb80ef
7
- data.tar.gz: 54df09a64b90d5f2b1ce69bd718a159c9b1b82a9bffd205c4558a299a0aab0e46c1021078cdff94ca3d4ae3d87c7191b2f162f675760f5a8ca04d6093f2a8306
6
+ metadata.gz: 7de58f9231b4ab3aae8f9d6b1a45c9d10cf2dd8ff38c393447aef23660d67b6166f4dbca6eba1da4ca3c5e684a1378b5a283932145d4db35200a381ff65ca5a9
7
+ data.tar.gz: cc82756deb275aad826bec55c2224523e05870f8a136bd795bd9ffc13d3c6ddbb1df3f1f671d0ca15e8d171d8c2b88bf9ae921eca5dc0d1196b04648363a9843
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
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
13
  Released on September 21, 2022
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'
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
4
+ version: 6.0.1
5
5
  platform: java
6
6
  authors:
7
7
  - Natalie Weizenbaum
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: exe
14
14
  cert_chain: []
15
- date: 2022-09-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
  requirement: !ruby/object:Gem::Requirement