liquid-tag-parser 1.0.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/liquid/tag/parser.rb +8 -9
- data/lib/liquid/tag/parser/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 79a95da9a9ff6492e2d8dc4219744588b896db80
|
4
|
+
data.tar.gz: 452e2c797b3b7bb85ccde0acee140ca3b9a33983
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1543e498250b9151fbc1023ea0568a5a21dfb1adb890f70307748c7e28bbf6882b5d35eb1f4e0caa5bdb2e4eec806f23cdfc03b05507017119f937cca267fd7d
|
7
|
+
data.tar.gz: b22b19eb2f06849346b5fa12119370b95bfff68b1cec5554f95c02ba5b0dfd3bb6c3d2a5a404e05520ffd8ed3e767785349b45eed6b9fd434407d8ba6c63b513
|
data/lib/liquid/tag/parser.rb
CHANGED
@@ -66,16 +66,15 @@ module Liquid
|
|
66
66
|
|
67
67
|
@args = @defaults.deep_merge(args.each_with_object(hash) do |k, h, out = h|
|
68
68
|
keys, _, val = k.rpartition(@sep_regexp)
|
69
|
-
keys = keys.split(KEY_REGEXP).map(&:to_sym)
|
70
|
-
val = val.gsub(@escaped_sep_regexp, @sep)
|
71
69
|
|
72
|
-
|
73
|
-
if keys.
|
74
|
-
|
75
|
-
|
76
|
-
|
70
|
+
val = val.gsub(@escaped_sep_regexp, @sep)
|
71
|
+
if keys.empty? && val =~ BOOLEAN_REGEXP
|
72
|
+
# @true, @false will not map right.
|
73
|
+
keys = val.gsub(BOOLEAN_REGEXP, "")
|
74
|
+
end
|
77
75
|
|
78
|
-
|
76
|
+
keys = keys.split(KEY_REGEXP).map(&:to_sym)
|
77
|
+
if keys.size > 1
|
79
78
|
h = h[keys[0]] ||= {}
|
80
79
|
keys[1...-1].each do |sk|
|
81
80
|
h = h[sk] ||= {}
|
@@ -89,7 +88,7 @@ module Liquid
|
|
89
88
|
val = val.to_i if val =~ /^\d+$/
|
90
89
|
val = true if val == "true"
|
91
90
|
|
92
|
-
key = keys.last.
|
91
|
+
key = keys.last.to_sym
|
93
92
|
h[key] << val if h[key].is_a?(Array)
|
94
93
|
h[key] = [h[key]] << val if h[key]
|
95
94
|
h[key] = val unless h[key]
|