hamlit 2.9.4-java → 2.12.0-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +12 -10
- data/CHANGELOG.md +45 -0
- data/Gemfile +2 -8
- data/REFERENCE.md +13 -4
- data/benchmark/dynamic_merger/benchmark.rb +25 -0
- data/benchmark/dynamic_merger/hello.haml +50 -0
- data/benchmark/dynamic_merger/hello.string +50 -0
- data/bin/bench +3 -3
- data/ext/hamlit/hamlit.c +0 -1
- data/hamlit.gemspec +3 -1
- data/lib/hamlit/attribute_builder.rb +2 -2
- data/lib/hamlit/attribute_compiler.rb +3 -3
- data/lib/hamlit/compiler/children_compiler.rb +18 -4
- data/lib/hamlit/compiler/comment_compiler.rb +7 -5
- data/lib/hamlit/compiler/tag_compiler.rb +0 -4
- data/lib/hamlit/dynamic_merger.rb +67 -0
- data/lib/hamlit/engine.rb +5 -6
- data/lib/hamlit/filters/plain.rb +0 -3
- data/lib/hamlit/html.rb +8 -0
- data/lib/hamlit/parser/haml_attribute_builder.rb +164 -0
- data/lib/hamlit/parser/haml_helpers.rb +6 -0
- data/lib/hamlit/parser/haml_parser.rb +32 -9
- data/lib/hamlit/parser/haml_xss_mods.rb +6 -3
- data/lib/hamlit/string_splitter.rb +9 -78
- data/lib/hamlit/template.rb +1 -1
- data/lib/hamlit/temple_line_counter.rb +31 -0
- data/lib/hamlit/version.rb +1 -1
- metadata +53 -21
- data/lib/hamlit/hamlit.su +0 -0
data/lib/hamlit/template.rb
CHANGED
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module Hamlit
|
3
|
+
# A module to count lines of expected code. This would be faster than actual code generation
|
4
|
+
# and counting newlines in it.
|
5
|
+
module TempleLineCounter
|
6
|
+
class UnexpectedExpression < StandardError; end
|
7
|
+
|
8
|
+
def self.count_lines(exp)
|
9
|
+
type, *args = exp
|
10
|
+
case type
|
11
|
+
when :multi
|
12
|
+
args.map { |a| count_lines(a) }.reduce(:+) || 0
|
13
|
+
when :dynamic, :code
|
14
|
+
args.first.count("\n")
|
15
|
+
when :static
|
16
|
+
0 # It has not real newline "\n" but escaped "\\n".
|
17
|
+
when :case
|
18
|
+
arg, *cases = args
|
19
|
+
arg.count("\n") + cases.map do |cond, e|
|
20
|
+
(cond == :else ? 0 : cond.count("\n")) + count_lines(e)
|
21
|
+
end.reduce(:+)
|
22
|
+
when :escape
|
23
|
+
count_lines(args[1])
|
24
|
+
when :newline
|
25
|
+
1
|
26
|
+
else
|
27
|
+
raise UnexpectedExpression.new("[HAML BUG] Unexpected Temple expression '#{type}' is given!")
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
data/lib/hamlit/version.rb
CHANGED
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hamlit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.12.0
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Takashi Kokubun
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-10-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
15
15
|
requirements:
|
16
16
|
- - ">="
|
17
17
|
- !ruby/object:Gem::Version
|
18
|
-
version: 0.8.
|
18
|
+
version: 0.8.2
|
19
19
|
name: temple
|
20
|
-
prerelease: false
|
21
20
|
type: :runtime
|
21
|
+
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.8.
|
26
|
+
version: 0.8.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
29
29
|
requirements:
|
@@ -31,8 +31,8 @@ dependencies:
|
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: '0'
|
33
33
|
name: thor
|
34
|
-
prerelease: false
|
35
34
|
type: :runtime
|
35
|
+
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
@@ -45,8 +45,8 @@ dependencies:
|
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: '0'
|
47
47
|
name: tilt
|
48
|
-
prerelease: false
|
49
48
|
type: :runtime
|
49
|
+
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - ">="
|
@@ -58,9 +58,23 @@ dependencies:
|
|
58
58
|
- - ">="
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: '0'
|
61
|
-
name:
|
61
|
+
name: benchmark_driver
|
62
|
+
type: :development
|
62
63
|
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
requirement: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
75
|
+
name: bundler
|
63
76
|
type: :development
|
77
|
+
prerelease: false
|
64
78
|
version_requirements: !ruby/object:Gem::Requirement
|
65
79
|
requirements:
|
66
80
|
- - ">="
|
@@ -73,8 +87,8 @@ dependencies:
|
|
73
87
|
- !ruby/object:Gem::Version
|
74
88
|
version: '0'
|
75
89
|
name: coffee-script
|
76
|
-
prerelease: false
|
77
90
|
type: :development
|
91
|
+
prerelease: false
|
78
92
|
version_requirements: !ruby/object:Gem::Requirement
|
79
93
|
requirements:
|
80
94
|
- - ">="
|
@@ -87,8 +101,8 @@ dependencies:
|
|
87
101
|
- !ruby/object:Gem::Version
|
88
102
|
version: '0'
|
89
103
|
name: erubi
|
90
|
-
prerelease: false
|
91
104
|
type: :development
|
105
|
+
prerelease: false
|
92
106
|
version_requirements: !ruby/object:Gem::Requirement
|
93
107
|
requirements:
|
94
108
|
- - ">="
|
@@ -101,8 +115,8 @@ dependencies:
|
|
101
115
|
- !ruby/object:Gem::Version
|
102
116
|
version: '5'
|
103
117
|
name: haml
|
104
|
-
prerelease: false
|
105
118
|
type: :development
|
119
|
+
prerelease: false
|
106
120
|
version_requirements: !ruby/object:Gem::Requirement
|
107
121
|
requirements:
|
108
122
|
- - ">="
|
@@ -115,8 +129,8 @@ dependencies:
|
|
115
129
|
- !ruby/object:Gem::Version
|
116
130
|
version: '0'
|
117
131
|
name: less
|
118
|
-
prerelease: false
|
119
132
|
type: :development
|
133
|
+
prerelease: false
|
120
134
|
version_requirements: !ruby/object:Gem::Requirement
|
121
135
|
requirements:
|
122
136
|
- - ">="
|
@@ -129,8 +143,8 @@ dependencies:
|
|
129
143
|
- !ruby/object:Gem::Version
|
130
144
|
version: '1.1'
|
131
145
|
name: minitest-reporters
|
132
|
-
prerelease: false
|
133
146
|
type: :development
|
147
|
+
prerelease: false
|
134
148
|
version_requirements: !ruby/object:Gem::Requirement
|
135
149
|
requirements:
|
136
150
|
- - "~>"
|
@@ -143,8 +157,8 @@ dependencies:
|
|
143
157
|
- !ruby/object:Gem::Version
|
144
158
|
version: 4.0.0
|
145
159
|
name: rails
|
146
|
-
prerelease: false
|
147
160
|
type: :development
|
161
|
+
prerelease: false
|
148
162
|
version_requirements: !ruby/object:Gem::Requirement
|
149
163
|
requirements:
|
150
164
|
- - ">="
|
@@ -157,8 +171,8 @@ dependencies:
|
|
157
171
|
- !ruby/object:Gem::Version
|
158
172
|
version: '0'
|
159
173
|
name: rake
|
160
|
-
prerelease: false
|
161
174
|
type: :development
|
175
|
+
prerelease: false
|
162
176
|
version_requirements: !ruby/object:Gem::Requirement
|
163
177
|
requirements:
|
164
178
|
- - ">="
|
@@ -171,8 +185,8 @@ dependencies:
|
|
171
185
|
- !ruby/object:Gem::Version
|
172
186
|
version: '0'
|
173
187
|
name: rake-compiler
|
174
|
-
prerelease: false
|
175
188
|
type: :development
|
189
|
+
prerelease: false
|
176
190
|
version_requirements: !ruby/object:Gem::Requirement
|
177
191
|
requirements:
|
178
192
|
- - ">="
|
@@ -185,8 +199,8 @@ dependencies:
|
|
185
199
|
- !ruby/object:Gem::Version
|
186
200
|
version: '0'
|
187
201
|
name: sass
|
188
|
-
prerelease: false
|
189
202
|
type: :development
|
203
|
+
prerelease: false
|
190
204
|
version_requirements: !ruby/object:Gem::Requirement
|
191
205
|
requirements:
|
192
206
|
- - ">="
|
@@ -199,8 +213,22 @@ dependencies:
|
|
199
213
|
- !ruby/object:Gem::Version
|
200
214
|
version: '0'
|
201
215
|
name: slim
|
216
|
+
type: :development
|
202
217
|
prerelease: false
|
218
|
+
version_requirements: !ruby/object:Gem::Requirement
|
219
|
+
requirements:
|
220
|
+
- - ">="
|
221
|
+
- !ruby/object:Gem::Version
|
222
|
+
version: '0'
|
223
|
+
- !ruby/object:Gem::Dependency
|
224
|
+
requirement: !ruby/object:Gem::Requirement
|
225
|
+
requirements:
|
226
|
+
- - ">="
|
227
|
+
- !ruby/object:Gem::Version
|
228
|
+
version: '0'
|
229
|
+
name: string_template
|
203
230
|
type: :development
|
231
|
+
prerelease: false
|
204
232
|
version_requirements: !ruby/object:Gem::Requirement
|
205
233
|
requirements:
|
206
234
|
- - ">="
|
@@ -213,8 +241,8 @@ dependencies:
|
|
213
241
|
- !ruby/object:Gem::Version
|
214
242
|
version: '0'
|
215
243
|
name: unindent
|
216
|
-
prerelease: false
|
217
244
|
type: :development
|
245
|
+
prerelease: false
|
218
246
|
version_requirements: !ruby/object:Gem::Requirement
|
219
247
|
requirements:
|
220
248
|
- - ">="
|
@@ -246,6 +274,9 @@ files:
|
|
246
274
|
- benchmark/dynamic_attributes/data_attribute.haml
|
247
275
|
- benchmark/dynamic_attributes/id_attribute.haml
|
248
276
|
- benchmark/dynamic_boolean_attribute.haml
|
277
|
+
- benchmark/dynamic_merger/benchmark.rb
|
278
|
+
- benchmark/dynamic_merger/hello.haml
|
279
|
+
- benchmark/dynamic_merger/hello.string
|
249
280
|
- benchmark/etc/attribute_builder.haml
|
250
281
|
- benchmark/etc/real_sample.haml
|
251
282
|
- benchmark/etc/real_sample.rb
|
@@ -289,6 +320,7 @@ files:
|
|
289
320
|
- lib/hamlit/compiler/script_compiler.rb
|
290
321
|
- lib/hamlit/compiler/silent_script_compiler.rb
|
291
322
|
- lib/hamlit/compiler/tag_compiler.rb
|
323
|
+
- lib/hamlit/dynamic_merger.rb
|
292
324
|
- lib/hamlit/engine.rb
|
293
325
|
- lib/hamlit/error.rb
|
294
326
|
- lib/hamlit/escapable.rb
|
@@ -310,7 +342,6 @@ files:
|
|
310
342
|
- lib/hamlit/filters/text_base.rb
|
311
343
|
- lib/hamlit/filters/tilt_base.rb
|
312
344
|
- lib/hamlit/force_escapable.rb
|
313
|
-
- lib/hamlit/hamlit.su
|
314
345
|
- lib/hamlit/helpers.rb
|
315
346
|
- lib/hamlit/html.rb
|
316
347
|
- lib/hamlit/identity.rb
|
@@ -318,6 +349,7 @@ files:
|
|
318
349
|
- lib/hamlit/parser.rb
|
319
350
|
- lib/hamlit/parser/MIT-LICENSE
|
320
351
|
- lib/hamlit/parser/README.md
|
352
|
+
- lib/hamlit/parser/haml_attribute_builder.rb
|
321
353
|
- lib/hamlit/parser/haml_buffer.rb
|
322
354
|
- lib/hamlit/parser/haml_compiler.rb
|
323
355
|
- lib/hamlit/parser/haml_error.rb
|
@@ -332,6 +364,7 @@ files:
|
|
332
364
|
- lib/hamlit/ruby_expression.rb
|
333
365
|
- lib/hamlit/string_splitter.rb
|
334
366
|
- lib/hamlit/template.rb
|
367
|
+
- lib/hamlit/temple_line_counter.rb
|
335
368
|
- lib/hamlit/utils.rb
|
336
369
|
- lib/hamlit/version.rb
|
337
370
|
homepage: https://github.com/k0kubun/hamlit
|
@@ -353,8 +386,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
353
386
|
- !ruby/object:Gem::Version
|
354
387
|
version: '0'
|
355
388
|
requirements: []
|
356
|
-
|
357
|
-
rubygems_version: 2.7.9
|
389
|
+
rubygems_version: 3.0.6
|
358
390
|
signing_key:
|
359
391
|
specification_version: 4
|
360
392
|
summary: High Performance Haml Implementation
|
data/lib/hamlit/hamlit.su
DELETED
Binary file
|