rblade 0.2.0 → 0.2.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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d55092cb6f64266006466fb9fcb1f6f9de30bb1a2df18e5ed123a7778f694c8
|
4
|
+
data.tar.gz: bd6ed6fca05f62d0cd606d53addbb27ecbabe1b32dcdd76f2a150d6227e3c6f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0821ffdde4f0e0ba9763c37e6f167a1e990aa7ef912b19561aa6f5f97ff90b0ddc4cbee7472bb73d2d31f0ef0d560ec81f47ab92a68a0280478a054d4c133bf4'
|
7
|
+
data.tar.gz: 450ae054965627db91899496ed5fefa3f34cb057710f7377941d196b0a6e753eea7c41ff8f5082174947f30a702ab8e346dea19f6de6e5ecdbf7e8492e1767db
|
data/CHANGELOG.md
CHANGED
@@ -39,6 +39,9 @@ module RBlade
|
|
39
39
|
|
40
40
|
def compile_token_end token
|
41
41
|
component = @component_stack.pop
|
42
|
+
if component.nil?
|
43
|
+
raise StandardError.new "Unexpected closing tag (#{token.value[:name]})"
|
44
|
+
end
|
42
45
|
if token.value[:name] != component[:name]
|
43
46
|
raise StandardError.new "Unexpected closing tag (#{token.value[:name]}) expecting #{component[:name]}"
|
44
47
|
end
|
@@ -73,6 +76,12 @@ module RBlade
|
|
73
76
|
|
74
77
|
next
|
75
78
|
end
|
79
|
+
if attribute[:type] == "attributes"
|
80
|
+
attribute_arguments.push "**attributes.to_h"
|
81
|
+
attribute_assignments.push "_style = attributes[:style];"
|
82
|
+
|
83
|
+
next
|
84
|
+
end
|
76
85
|
|
77
86
|
if attribute[:type] == "string"
|
78
87
|
attribute_arguments.push "'#{attribute[:name]}': '#{RBlade.escape_quotes(attribute[:value])}'"
|
@@ -57,9 +57,9 @@ module RBlade
|
|
57
57
|
if name == "@class" || name == "@style"
|
58
58
|
attributes.push({type: name[1..], value: raw_attributes[i + 1][1..-2]})
|
59
59
|
i += 2
|
60
|
-
elsif name
|
61
|
-
attributes.push({type: "attributes", value: raw_attributes[i + 1]
|
62
|
-
i +=
|
60
|
+
elsif name == "{{"
|
61
|
+
attributes.push({type: "attributes", value: raw_attributes[i + 1]})
|
62
|
+
i += 3
|
63
63
|
else
|
64
64
|
attribute = {name:}
|
65
65
|
|
@@ -116,7 +116,7 @@ module RBlade
|
|
116
116
|
)
|
117
117
|
|
|
118
118
|
(
|
119
|
-
\{\{\s*attributes
|
119
|
+
\{\{\s*attributes.*?\s*\}\}
|
120
120
|
)
|
121
121
|
|
|
122
122
|
(?:
|
@@ -163,7 +163,7 @@ module RBlade
|
|
163
163
|
)
|
164
164
|
|
|
165
165
|
(?:
|
166
|
-
(\{\{)\s*attributes
|
166
|
+
(\{\{)\s*(attributes.*?)\s*(\}\})
|
167
167
|
)
|
168
168
|
|
|
169
169
|
(?:
|
data/lib/rblade/compiler.rb
CHANGED
@@ -22,11 +22,11 @@ module RBlade
|
|
22
22
|
def self.compileString(string_template)
|
23
23
|
tokens = [Token.new(:unprocessed, string_template)]
|
24
24
|
|
25
|
-
CompilesComments.new.compile! tokens
|
26
|
-
CompilesEchos.new.compile! tokens
|
27
25
|
CompilesRuby.new.compile! tokens
|
28
26
|
TokenizesComponents.new.tokenize! tokens
|
29
27
|
TokenizesStatements.new.tokenize! tokens
|
28
|
+
CompilesComments.new.compile! tokens
|
29
|
+
CompilesEchos.new.compile! tokens
|
30
30
|
CompilesStatements.new.compile! tokens
|
31
31
|
CompilesComponents.new.compile! tokens
|
32
32
|
|
data/rblade.gemspec
CHANGED