haml 7.0.2 → 7.1.0
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 +4 -0
- data/lib/haml/attribute_builder.rb +8 -8
- data/lib/haml/attribute_compiler.rb +1 -1
- data/lib/haml/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b5fd21b96511ffb6ab57ac08adcbb48f4fba26c9ba3998f9c320527e193b5d65
|
|
4
|
+
data.tar.gz: 42788bd91d1e0c66c8db3ab579f4005ccd176012207e300ee15244e079ea046c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6a3959bebf8b2351923c7820d522aedc2bf104ac2d1d75cb76d7a8b2c5dbb4f6fb8b34434981534969658bc1f8068b768365a5a5a222f63dfe12376785462470
|
|
7
|
+
data.tar.gz: e5bb8177220ef5c56cbc2e34f3c0583b783604719ef1d666f707ee3dee95d2c73b0edd64654ff11776a57d63a9852ad6ee2f080e29431533a937d6dbea5d860c
|
data/CHANGELOG.md
CHANGED
|
@@ -16,9 +16,9 @@ module Haml::AttributeBuilder
|
|
|
16
16
|
when 'class'
|
|
17
17
|
buf << " class=#{quote}#{build_class(escape_attrs, *hash[key])}#{quote}"
|
|
18
18
|
when 'data'
|
|
19
|
-
buf << build_data(escape_attrs, quote, *hash[key])
|
|
19
|
+
buf << build_data(escape_attrs, quote, format, *hash[key])
|
|
20
20
|
when 'aria'
|
|
21
|
-
buf << build_aria(escape_attrs, quote, *hash[key])
|
|
21
|
+
buf << build_aria(escape_attrs, quote, format, *hash[key])
|
|
22
22
|
when *Haml::BOOLEAN_ATTRIBUTES, /\Adata-/, /\Aaria-/
|
|
23
23
|
build_boolean!(escape_attrs, quote, format, buf, key, hash[key])
|
|
24
24
|
else
|
|
@@ -62,17 +62,17 @@ module Haml::AttributeBuilder
|
|
|
62
62
|
escape_html(escape_attrs, classes.map(&:to_s).uniq.join(' '))
|
|
63
63
|
end
|
|
64
64
|
|
|
65
|
-
def build_data(escape_attrs, quote, *hashes)
|
|
66
|
-
build_data_attribute(:data, escape_attrs, quote, *hashes)
|
|
65
|
+
def build_data(escape_attrs, quote, format, *hashes)
|
|
66
|
+
build_data_attribute(:data, escape_attrs, quote, format, *hashes)
|
|
67
67
|
end
|
|
68
68
|
|
|
69
|
-
def build_aria(escape_attrs, quote, *hashes)
|
|
70
|
-
build_data_attribute(:aria, escape_attrs, quote, *hashes)
|
|
69
|
+
def build_aria(escape_attrs, quote, format, *hashes)
|
|
70
|
+
build_data_attribute(:aria, escape_attrs, quote, format, *hashes)
|
|
71
71
|
end
|
|
72
72
|
|
|
73
73
|
private
|
|
74
74
|
|
|
75
|
-
def build_data_attribute(key, escape_attrs, quote, *hashes)
|
|
75
|
+
def build_data_attribute(key, escape_attrs, quote, format, *hashes)
|
|
76
76
|
attrs = []
|
|
77
77
|
if hashes.size > 1 && hashes.all? { |h| h.is_a?(Hash) }
|
|
78
78
|
data_value = merge_all_attrs(hashes)
|
|
@@ -84,7 +84,7 @@ module Haml::AttributeBuilder
|
|
|
84
84
|
hash.sort_by(&:first).each do |key, value|
|
|
85
85
|
case value
|
|
86
86
|
when true
|
|
87
|
-
|
|
87
|
+
build_boolean!(escape_attrs, quote, format, attrs, key, value)
|
|
88
88
|
when nil, false
|
|
89
89
|
# noop
|
|
90
90
|
else
|
|
@@ -85,7 +85,7 @@ module Haml
|
|
|
85
85
|
end
|
|
86
86
|
|
|
87
87
|
def compile_data!(temple, key, values)
|
|
88
|
-
args = [@escape_attrs.inspect, "#{@quote.inspect}.freeze", values.map { |v| literal_for(v) }]
|
|
88
|
+
args = [@escape_attrs.inspect, "#{@quote.inspect}.freeze", @format.inspect, values.map { |v| literal_for(v) }]
|
|
89
89
|
build_code = "::Haml::AttributeBuilder.build_#{key}(#{args.join(', ')})"
|
|
90
90
|
|
|
91
91
|
if values.all? { |type, exp| type == :static || Temple::StaticAnalyzer.static?(exp) }
|
data/lib/haml/version.rb
CHANGED