temple 0.10.5 → 0.10.6
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/.github/workflows/test.yml +2 -1
- data/CHANGES +4 -0
- data/README.md +1 -1
- data/lib/temple/static_analyzer.rb +25 -1
- data/lib/temple/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: 36199c665624018e6c8bfec5ff6d1e19bcd8015ee4aeedd7800b264136227b7b
|
|
4
|
+
data.tar.gz: f70ee914c911f6f7ad17c84f81fd88dc5cc6d974c37b2d773995bbcc03b17c5b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f3661349e66534eaed2be550577677c3a4457ed0fe4e2ec5c3b8a6dced46fa45d5aa6be774662cf84186ead6954ebcb51ff53357abf93c64093b559fb22f22ec
|
|
7
|
+
data.tar.gz: 4e81de0ec56c60964b9363bf87b270191a39d19a0fd0710dc9e07b0baaadf273a8a84d6c37a733edd55ab55f90bba7d4a1b676b50817f1ba1566efdb29e8a911
|
data/.github/workflows/test.yml
CHANGED
data/CHANGES
CHANGED
data/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Temple
|
|
2
2
|
======
|
|
3
3
|
|
|
4
|
-
[](https://github.com/judofyr/temple/actions/workflows/test.yml) [](https://github.com/judofyr/temple/actions/workflows/test.yml) [](https://qlty.sh/gh/judofyr/projects/temple) [](https://rubygems.org/gems/temple) [](http://rubydoc.info/gems/temple/frames)
|
|
5
5
|
|
|
6
6
|
Temple is an abstraction and a framework for compiling templates to pure Ruby.
|
|
7
7
|
It's all about making it easier to experiment, implement and optimize template
|
|
@@ -93,7 +93,8 @@ module Temple
|
|
|
93
93
|
return false
|
|
94
94
|
end
|
|
95
95
|
end
|
|
96
|
-
|
|
96
|
+
|
|
97
|
+
!ShorthandSyntaxChecker.shorthand?(code)
|
|
97
98
|
end
|
|
98
99
|
|
|
99
100
|
def syntax_error?(code)
|
|
@@ -112,6 +113,29 @@ module Temple
|
|
|
112
113
|
raise ParseError
|
|
113
114
|
end
|
|
114
115
|
end
|
|
116
|
+
|
|
117
|
+
class ShorthandSyntaxChecker < Ripper
|
|
118
|
+
class << self
|
|
119
|
+
def shorthand?(code)
|
|
120
|
+
instance = new(code)
|
|
121
|
+
instance.parse
|
|
122
|
+
instance.shorthand
|
|
123
|
+
end
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
attr_reader :shorthand
|
|
127
|
+
|
|
128
|
+
def initialize(*)
|
|
129
|
+
super
|
|
130
|
+
@shorthand = nil
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
private
|
|
134
|
+
|
|
135
|
+
def on_assoc_new(key, value)
|
|
136
|
+
@shorthand = true if value.nil?
|
|
137
|
+
end
|
|
138
|
+
end
|
|
115
139
|
end
|
|
116
140
|
else
|
|
117
141
|
class << self
|
data/lib/temple/version.rb
CHANGED