haml 6.0.8 → 6.0.10

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: 9ff76f0fdc08205d557aad04a3701f7aad3df7badb119afe88c3a538fad318e8
4
- data.tar.gz: a9bae0ed0aab397b6718df223ae9d093c94b349ecf1a0c0306d7faa446c53e3f
3
+ metadata.gz: 0b1a2e9891d05d2723574950d4f2e8239234c0a59587dd4eb453554b2b597f75
4
+ data.tar.gz: a66cb9a12b12700bf815425feaae73fa840cae26ae630a1aaee188066be09429
5
5
  SHA512:
6
- metadata.gz: bdd2458541e841265ae99d5825a5d76fab8b977d8fd38ae110e19b73dbd1059616de97e6963d5feb42f15cc5b7648887646f4f6a17ec4fbe6aec883ef61865a6
7
- data.tar.gz: c3dd71673d91323183695d6d734102422caabad995b76574a7a11ec59703cfc31302df250f6a679e974c7f4f6be50eff6b44c06a0ad45a2d47257a259de07af8
6
+ metadata.gz: b05af5eefbaeeb3440d5e8c8e5389fef759d76a4641b8e678e5fe14404a98f84acadf2187ed192472fa05ece0d19cb528c427e00cadec6ec7cb9cf6314fb5609
7
+ data.tar.gz: 27d504c0129637c4bb06601af899d6f11bd5668abdcd9b0034484c1a57c8537bf3da5d5c552de712368ef0c213d713fa7e38b4b10f2e16e467d19e1d3e929d2c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Haml Changelog
2
2
 
3
+ ## 6.0.10
4
+
5
+ * Evaluate :erb filter in the template context
6
+
7
+ ## 6.0.9
8
+
9
+ * Support sass-embedded [#1112](https://github.com/haml/haml/issues/1112)
10
+
3
11
  ## 6.0.8
4
12
 
5
13
  * Support interpolation in HTML comments, which has not been working since 6.0.0
@@ -63,6 +71,8 @@ Released on September 21, 2022
63
71
  * The parser is kept as is, but everything else is replaced.
64
72
  * The `haml` CLI interface was also replaced.
65
73
  * The interface of `Haml::Engine` is changed. `Haml::Template` is most likely what you need now.
74
+ * before: `Haml::Engine.new("%p Haml code!").render`
75
+ * after: `Haml::Template.new { "%p Haml code!" }.render`
66
76
  * Most Haml helpers are removed.
67
77
  * Rails:
68
78
  * Kept: `find_and_reserve`, `preserve`, `surround`, `precede`, `succeed`, `capture_haml`
@@ -78,6 +88,8 @@ Released on September 21, 2022
78
88
  `defer`, `disabled`, `download`, `formnovalidate`, `hidden`, `inert`, `ismap`, `itemscope`, `loop`,
79
89
  `multiple`, `muted`, `novalidate`, `open`, `pubdate`, `readonly`, `required`, `reversed`, `scoped`,
80
90
  `seamless`, `selected`, `sortable`, `truespeed`, `typemustmatch`
91
+ * Only `data` and `aria` attributes support using a nested Hash to render hyphenated attributes, e.g.
92
+ `data: { foo: 'bar' }` becomes `data-foo="bar"`, but this no longer works for non-`data`/`aria` attributes.
81
93
  * Some legacy Rails integration is removed.
82
94
  * The default value of `escape_html` option became true.
83
95
  * `-` script lines no longer support capturing. Only `=` lines are supported to yield a nested block.
@@ -3,7 +3,7 @@ module Haml
3
3
  class Filters
4
4
  class Erb < TiltBase
5
5
  def compile(node)
6
- compile_with_tilt(node, 'erb')
6
+ precompiled_with_tilt(node, 'erb')
7
7
  end
8
8
  end
9
9
  end
@@ -7,7 +7,11 @@ module Haml
7
7
  def self.render(name, source, indent_width: 0)
8
8
  text = ::Tilt["t.#{name}"].new { source }.render
9
9
  return text if indent_width == 0
10
- text.gsub!(/^/, ' ' * indent_width)
10
+ if text.frozen?
11
+ text.gsub(/^/, ' ' * indent_width)
12
+ else
13
+ text.gsub!(/^/, ' ' * indent_width)
14
+ end
11
15
  end
12
16
 
13
17
  def explicit_require?(needed_registration)
@@ -17,6 +21,12 @@ module Haml
17
21
 
18
22
  private
19
23
 
24
+ # TODO: support interpolation
25
+ def precompiled_with_tilt(node, name)
26
+ src = ::Tilt["t.#{name}"].new { node.value[:text] }.send(:precompiled, {}).first
27
+ [:dynamic, src]
28
+ end
29
+
20
30
  def compile_with_tilt(node, name, indent_width: 0)
21
31
  if ::Haml::Util.contains_interpolation?(node.value[:text])
22
32
  dynamic_compile(node, name, indent_width: indent_width)
data/lib/haml/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Haml
3
- VERSION = '6.0.8'
3
+ VERSION = '6.0.10'
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.8
4
+ version: 6.0.10
5
5
  platform: ruby
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-10-29 00:00:00.000000000 Z
15
+ date: 2022-11-10 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: temple