hamlit 1.5.5 → 1.5.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/CHANGELOG.md +5 -0
- data/benchmarks/benchmark.rb +5 -26
- data/doc/README.md +2 -3
- data/doc/engine/old_attributes.md +2 -2
- data/doc/engine/text.md +2 -26
- data/doc/filters/coffee.md +3 -3
- data/doc/filters/erb.md +1 -1
- data/doc/filters/javascript.md +2 -2
- data/doc/filters/less.md +2 -2
- data/doc/filters/markdown.md +1 -1
- data/doc/filters/plain.md +1 -1
- data/doc/filters/sass.md +2 -2
- data/doc/filters/scss.md +2 -2
- data/hamlit.gemspec +0 -1
- data/lib/hamlit/compilers/text.rb +21 -0
- data/lib/hamlit/parser.rb +10 -1
- data/lib/hamlit/version.rb +1 -1
- data/spec/hamlit/engine/error_spec.rb +7 -0
- data/spec/hamlit/engine/script_spec.rb +6 -8
- data/spec/hamlit/engine/tag_spec.rb +2 -2
- data/spec/hamlit/engine/text_spec.rb +0 -1
- data/spec/rails/spec/hamlit_spec.rb +1 -2
- data/spec/spec_helper.rb +4 -5
- metadata +1 -17
- data/benchmarks/view.rbhtml +0 -23
- data/doc/engine/script.md +0 -105
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 77be0fc87affead60a2cc9cf21fd59b2983cc06c
|
4
|
+
data.tar.gz: 88ee1131ab3ab0e9d48ab26389342dd878c41952
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59c87b3d65976a804e11a4cd297321a528c4bd65c33a49258bd25f4669a49bffb72a251c3b50e908f46b5c7ddc7fbb6297da3825f3f2c8bb604b1883f908c250
|
7
|
+
data.tar.gz: 429b1fb44e55ee9f1732d0c4af1e8a7bd8b96e69cd04dc8a16d2cbb8ad0c43a46a8ff3e301bff9d9c8365a5fce83ff9a45bfff51638652253d010aff5468f314
|
data/CHANGELOG.md
CHANGED
data/benchmarks/benchmark.rb
CHANGED
@@ -5,13 +5,10 @@ $:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'), File.dirname(__FILE__
|
|
5
5
|
require_relative './context'
|
6
6
|
require 'benchmark/ips'
|
7
7
|
|
8
|
-
require 'erb'
|
9
8
|
require 'erubis'
|
10
9
|
require 'faml'
|
11
10
|
require 'haml'
|
12
11
|
require 'slim'
|
13
|
-
require 'tenjin'
|
14
|
-
require 'tilt'
|
15
12
|
require 'hamlit'
|
16
13
|
|
17
14
|
class Benchmarks
|
@@ -20,32 +17,22 @@ class Benchmarks
|
|
20
17
|
@benches = []
|
21
18
|
@versions = {}
|
22
19
|
|
23
|
-
@erb_code
|
24
|
-
@haml_code
|
25
|
-
@slim_code
|
26
|
-
@rbhtml_path = File.dirname(__FILE__) + '/view.rbhtml'
|
20
|
+
@erb_code = File.read(File.dirname(__FILE__) + '/view.erb')
|
21
|
+
@haml_code = File.read(File.dirname(__FILE__) + '/view.haml')
|
22
|
+
@slim_code = File.read(File.dirname(__FILE__) + '/view.slim')
|
27
23
|
|
28
24
|
init_compiled_benches
|
29
25
|
end
|
30
26
|
|
31
27
|
def init_compiled_benches
|
32
|
-
erb = ERB.new(@erb_code)
|
33
|
-
erubis = Erubis::Eruby.new(@erb_code)
|
34
|
-
fast_erubis = Erubis::FastEruby.new(@erb_code)
|
35
|
-
haml_ugly = Haml::Engine.new(@haml_code, format: :html5, ugly: true)
|
36
|
-
tenjin = Tenjin::Engine.new.get_template(@rbhtml_path)
|
37
|
-
|
38
28
|
context = Context.new
|
39
29
|
|
30
|
+
haml_ugly = Haml::Engine.new(@haml_code, format: :html5, ugly: true)
|
40
31
|
haml_ugly.def_method(context, :run_haml_ugly)
|
41
32
|
context.instance_eval %{
|
42
|
-
def
|
43
|
-
def run_erubis; #{erubis.src}; end
|
44
|
-
def run_temple_erb; #{Temple::ERB::Engine.new.call @erb_code}; end
|
45
|
-
def run_fast_erubis; #{fast_erubis.src}; end
|
33
|
+
def run_erubis; #{Erubis::Eruby.new(@erb_code).src}; end
|
46
34
|
def run_slim_ugly; #{Slim::Engine.new.call @slim_code}; end
|
47
35
|
def run_faml; #{Faml::Engine.new.call @haml_code}; end
|
48
|
-
def run_tenjin; _buf = ''; #{tenjin.script}; end
|
49
36
|
def run_hamlit; #{Hamlit::Engine.new.call @haml_code}; end
|
50
37
|
}
|
51
38
|
|
@@ -54,14 +41,6 @@ class Benchmarks
|
|
54
41
|
bench('slim', Slim::VERSION) { context.run_slim_ugly }
|
55
42
|
bench('faml', Faml::VERSION) { context.run_faml }
|
56
43
|
bench('haml', Haml::VERSION) { context.run_haml_ugly }
|
57
|
-
|
58
|
-
if ENV['ALL']
|
59
|
-
erb_version = ERB.version.match(/\[([^ ]+)/)[1]
|
60
|
-
bench('tenjin', Tenjin::RELEASE) { context.run_tenjin }
|
61
|
-
bench('fast erubis', Erubis::VERSION) { context.run_fast_erubis }
|
62
|
-
bench('temple erb', Temple::VERSION) { context.run_temple_erb }
|
63
|
-
bench('erb', erb_version) { context.run_erb }
|
64
|
-
end
|
65
44
|
end
|
66
45
|
|
67
46
|
def run
|
data/doc/README.md
CHANGED
@@ -5,6 +5,5 @@ Showing incompatibilities against [Haml](https://github.com/haml/haml) and [Faml
|
|
5
5
|
|
6
6
|
## engine
|
7
7
|
|
8
|
-
- [engine/old\_attributes\_spec.rb](
|
9
|
-
- [engine/
|
10
|
-
- [engine/text\_spec.rb](https://github.com/k0kubun/hamlit/blob/master/doc/engine/text.md)
|
8
|
+
- [engine/old\_attributes\_spec.rb](engine/old_attributes.md)
|
9
|
+
- [engine/text\_spec.rb](engine/text.md)
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# [old\_attributes\_spec.rb:43](
|
1
|
+
# [old\_attributes\_spec.rb:43](/spec/hamlit/engine/old_attributes_spec.rb#L43)
|
2
2
|
## Input
|
3
3
|
```haml
|
4
4
|
%span{ class: '}}}', id: '{}}' } }{
|
@@ -26,7 +26,7 @@ Faml::Compiler::UnparsableRubyCode: Unparsable Ruby code is given to attributes:
|
|
26
26
|
```
|
27
27
|
|
28
28
|
|
29
|
-
# [old\_attributes\_spec.rb:201](
|
29
|
+
# [old\_attributes\_spec.rb:201](/spec/hamlit/engine/old_attributes_spec.rb#L201)
|
30
30
|
## Input
|
31
31
|
```haml
|
32
32
|
/ wontfix: Non-boolean attributes are not escaped for optimization.
|
data/doc/engine/text.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# [text\_spec.rb:15](
|
1
|
+
# [text\_spec.rb:15](/spec/hamlit/engine/text_spec.rb#L15)
|
2
2
|
## Input
|
3
3
|
```haml
|
4
4
|
.
|
@@ -33,7 +33,7 @@ Haml::SyntaxError: Illegal element: classes and ids must have values.
|
|
33
33
|
```
|
34
34
|
|
35
35
|
|
36
|
-
# [text\_spec.rb:99](
|
36
|
+
# [text\_spec.rb:99](/spec/hamlit/engine/text_spec.rb#L99)
|
37
37
|
## Input
|
38
38
|
```haml
|
39
39
|
|
@@ -62,27 +62,3 @@ hello
|
|
62
62
|
|
63
63
|
```
|
64
64
|
|
65
|
-
|
66
|
-
# [text\_spec.rb:175](https://github.com/k0kubun/hamlit/blob/master/spec/hamlit/engine/text_spec.rb#L175)
|
67
|
-
## Input
|
68
|
-
```haml
|
69
|
-
1#{2
|
70
|
-
```
|
71
|
-
|
72
|
-
## Output
|
73
|
-
### Haml
|
74
|
-
```html
|
75
|
-
Haml::SyntaxError: Unbalanced brackets.
|
76
|
-
```
|
77
|
-
|
78
|
-
### Faml
|
79
|
-
```html
|
80
|
-
Faml::TextCompiler::InvalidInterpolation: 1#{2
|
81
|
-
```
|
82
|
-
|
83
|
-
### Hamlit
|
84
|
-
```html
|
85
|
-
1#{2
|
86
|
-
|
87
|
-
```
|
88
|
-
|
data/doc/filters/coffee.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# [coffee\_spec.rb:3](
|
1
|
+
# [coffee\_spec.rb:3](/spec/hamlit/filters/coffee_spec.rb#L3)
|
2
2
|
## Input
|
3
3
|
```haml
|
4
4
|
:coffee
|
@@ -40,7 +40,7 @@
|
|
40
40
|
```
|
41
41
|
|
42
42
|
|
43
|
-
# [coffee\_spec.rb:22](
|
43
|
+
# [coffee\_spec.rb:22](/spec/hamlit/filters/coffee_spec.rb#L22)
|
44
44
|
## Input
|
45
45
|
```haml
|
46
46
|
:coffee
|
@@ -82,7 +82,7 @@
|
|
82
82
|
```
|
83
83
|
|
84
84
|
|
85
|
-
# [coffee\_spec.rb:41](
|
85
|
+
# [coffee\_spec.rb:41](/spec/hamlit/filters/coffee_spec.rb#L41)
|
86
86
|
## Input
|
87
87
|
```haml
|
88
88
|
:coffee
|
data/doc/filters/erb.md
CHANGED
data/doc/filters/javascript.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# [javascript\_spec.rb:3](
|
1
|
+
# [javascript\_spec.rb:3](/spec/hamlit/filters/javascript_spec.rb#L3)
|
2
2
|
## Input
|
3
3
|
```haml
|
4
4
|
before
|
@@ -36,7 +36,7 @@ after
|
|
36
36
|
```
|
37
37
|
|
38
38
|
|
39
|
-
# [javascript\_spec.rb:32](
|
39
|
+
# [javascript\_spec.rb:32](/spec/hamlit/filters/javascript_spec.rb#L32)
|
40
40
|
## Input
|
41
41
|
```haml
|
42
42
|
:javascript
|
data/doc/filters/less.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# [less\_spec.rb:3](
|
1
|
+
# [less\_spec.rb:3](/spec/hamlit/filters/less_spec.rb#L3)
|
2
2
|
## Input
|
3
3
|
```haml
|
4
4
|
:less
|
@@ -29,7 +29,7 @@ Faml::FilterCompilers::NotFound: Unable to find compiler for less
|
|
29
29
|
```
|
30
30
|
|
31
31
|
|
32
|
-
# [less\_spec.rb:22](
|
32
|
+
# [less\_spec.rb:22](/spec/hamlit/filters/less_spec.rb#L22)
|
33
33
|
## Input
|
34
34
|
```haml
|
35
35
|
:less
|
data/doc/filters/markdown.md
CHANGED
data/doc/filters/plain.md
CHANGED
data/doc/filters/sass.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# [sass\_spec.rb:3](
|
1
|
+
# [sass\_spec.rb:3](/spec/hamlit/filters/sass_spec.rb#L3)
|
2
2
|
## Input
|
3
3
|
```haml
|
4
4
|
:sass
|
@@ -31,7 +31,7 @@
|
|
31
31
|
```
|
32
32
|
|
33
33
|
|
34
|
-
# [sass\_spec.rb:19](
|
34
|
+
# [sass\_spec.rb:19](/spec/hamlit/filters/sass_spec.rb#L19)
|
35
35
|
## Input
|
36
36
|
```haml
|
37
37
|
:sass
|
data/doc/filters/scss.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# [scss\_spec.rb:3](
|
1
|
+
# [scss\_spec.rb:3](/spec/hamlit/filters/scss_spec.rb#L3)
|
2
2
|
## Input
|
3
3
|
```haml
|
4
4
|
:scss
|
@@ -34,7 +34,7 @@
|
|
34
34
|
```
|
35
35
|
|
36
36
|
|
37
|
-
# [scss\_spec.rb:21](
|
37
|
+
# [scss\_spec.rb:21](/spec/hamlit/filters/scss_spec.rb#L21)
|
38
38
|
## Input
|
39
39
|
```haml
|
40
40
|
:scss
|
data/hamlit.gemspec
CHANGED
@@ -36,7 +36,6 @@ Gem::Specification.new do |spec|
|
|
36
36
|
spec.add_development_dependency "rspec", ">= 3"
|
37
37
|
spec.add_development_dependency "sass"
|
38
38
|
spec.add_development_dependency "slim"
|
39
|
-
spec.add_development_dependency "tenjin"
|
40
39
|
spec.add_development_dependency "therubyracer"
|
41
40
|
spec.add_development_dependency "unindent"
|
42
41
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'hamlit/concerns/error'
|
1
2
|
require 'hamlit/concerns/escapable'
|
2
3
|
require 'hamlit/concerns/included'
|
3
4
|
require 'hamlit/concerns/string_interpolation'
|
@@ -6,6 +7,7 @@ module Hamlit
|
|
6
7
|
module Compilers
|
7
8
|
module Text
|
8
9
|
extend Concerns::Included
|
10
|
+
include Concerns::Error
|
9
11
|
include Concerns::StringInterpolation
|
10
12
|
|
11
13
|
included do
|
@@ -20,6 +22,7 @@ module Hamlit
|
|
20
22
|
# Return static and dynamic temple ast.
|
21
23
|
# It splits expression to optimize because string interpolation is slow.
|
22
24
|
def on_haml_text(exp, escape_html = true)
|
25
|
+
return syntax_error('Unbalanced brackets.') unless valid_interpolation?(exp)
|
23
26
|
return static_text(exp) unless contains_interpolation?(exp)
|
24
27
|
|
25
28
|
marker = find_string_marker(exp)
|
@@ -62,6 +65,24 @@ module Hamlit
|
|
62
65
|
|
63
66
|
private
|
64
67
|
|
68
|
+
def valid_interpolation?(exp)
|
69
|
+
marker = find_string_marker(exp)
|
70
|
+
return true unless marker # give up checking
|
71
|
+
|
72
|
+
literal = literalify_string(exp, marker)
|
73
|
+
open_count = 0
|
74
|
+
|
75
|
+
Ripper.lex(literal).each do |(row, col), type, str|
|
76
|
+
case type
|
77
|
+
when :on_embexpr_beg
|
78
|
+
open_count += 1
|
79
|
+
when :on_embexpr_end
|
80
|
+
open_count -= 1
|
81
|
+
end
|
82
|
+
end
|
83
|
+
open_count == 0
|
84
|
+
end
|
85
|
+
|
65
86
|
# :static can't treat backslash properly
|
66
87
|
def static_text(exp)
|
67
88
|
return [:dynamic, string_literal(exp)] if exp.include?('\\')
|
data/lib/hamlit/parser.rb
CHANGED
@@ -121,8 +121,9 @@ module Hamlit
|
|
121
121
|
|
122
122
|
def skip_newline?(ast)
|
123
123
|
SKIP_NEWLINE_EXPS.include?(ast.first) ||
|
124
|
-
(ast[0..1] == [:haml, :doctype]) ||
|
125
124
|
newline_skip_filter?(ast) ||
|
125
|
+
doctype?(ast) ||
|
126
|
+
block_script?(ast) ||
|
126
127
|
outer_remove?
|
127
128
|
end
|
128
129
|
|
@@ -134,5 +135,13 @@ module Hamlit
|
|
134
135
|
return str if str.is_a?(StringScanner)
|
135
136
|
StringScanner.new(str)
|
136
137
|
end
|
138
|
+
|
139
|
+
def doctype?(ast)
|
140
|
+
ast[0..1] == [:haml, :doctype]
|
141
|
+
end
|
142
|
+
|
143
|
+
def block_script?(ast)
|
144
|
+
ast[0..1] == [:haml, :script]
|
145
|
+
end
|
137
146
|
end
|
138
147
|
end
|
data/lib/hamlit/version.rb
CHANGED
@@ -52,5 +52,12 @@ describe Hamlit::Engine do
|
|
52
52
|
HAML
|
53
53
|
to raise_error(Hamlit::SyntaxError, 'Inconsistent indentation: 2 tabs used for indentation, but the rest of the document was indented using 2 spaces.')
|
54
54
|
end
|
55
|
+
|
56
|
+
it 'raises syntax error for an inconsistent indentation' do
|
57
|
+
expect { render_string(<<-'HAML'.unindent) }.
|
58
|
+
1#{2
|
59
|
+
HAML
|
60
|
+
to raise_error(Hamlit::SyntaxError, 'Unbalanced brackets.')
|
61
|
+
end
|
55
62
|
end
|
56
63
|
end
|
@@ -39,7 +39,7 @@ describe Hamlit::Engine do
|
|
39
39
|
end
|
40
40
|
|
41
41
|
it 'renders block script' do
|
42
|
-
assert_render(<<-HAML, <<-HTML
|
42
|
+
assert_render(<<-HAML, <<-HTML)
|
43
43
|
= 3.times do |i|
|
44
44
|
= i
|
45
45
|
4
|
@@ -47,21 +47,19 @@ describe Hamlit::Engine do
|
|
47
47
|
0
|
48
48
|
1
|
49
49
|
2
|
50
|
-
|
51
|
-
4
|
50
|
+
34
|
52
51
|
HTML
|
53
52
|
end
|
54
53
|
|
55
54
|
it 'renders tag internal block script' do
|
56
|
-
assert_render(<<-HAML, <<-HTML
|
55
|
+
assert_render(<<-HAML, <<-HTML)
|
57
56
|
%span
|
58
57
|
= 1.times do |i|
|
59
58
|
= i
|
60
59
|
HAML
|
61
60
|
<span>
|
62
61
|
0
|
63
|
-
1
|
64
|
-
</span>
|
62
|
+
1</span>
|
65
63
|
HTML
|
66
64
|
end
|
67
65
|
|
@@ -85,7 +83,7 @@ describe Hamlit::Engine do
|
|
85
83
|
end
|
86
84
|
|
87
85
|
it 'renders !=' do
|
88
|
-
assert_render(<<-HAML, <<-HTML, escape_html: true
|
86
|
+
assert_render(<<-HAML, <<-HTML.rstrip, escape_html: true)
|
89
87
|
!= '<"&>'
|
90
88
|
!= '<"&>'.tap do |str|
|
91
89
|
-# no operation
|
@@ -96,7 +94,7 @@ describe Hamlit::Engine do
|
|
96
94
|
end
|
97
95
|
|
98
96
|
it 'renders &=' do
|
99
|
-
assert_render(<<-HAML, <<-HTML, escape_html: false
|
97
|
+
assert_render(<<-HAML, <<-HTML.rstrip, escape_html: false)
|
100
98
|
&= '<"&>'
|
101
99
|
&= '<"&>'.tap do |str|
|
102
100
|
-# no operation
|
@@ -237,7 +237,7 @@ describe Hamlit::Engine do
|
|
237
237
|
end
|
238
238
|
|
239
239
|
it 'removes whitespace inside script inside silent script' do
|
240
|
-
assert_render(<<-HAML, <<-HTML
|
240
|
+
assert_render(<<-HAML, <<-HTML)
|
241
241
|
.bar<
|
242
242
|
- 3.times do
|
243
243
|
= 'foo'
|
@@ -247,7 +247,7 @@ describe Hamlit::Engine do
|
|
247
247
|
end
|
248
248
|
|
249
249
|
it 'removes whitespace inside script recursively' do
|
250
|
-
assert_render(<<-HAML, <<-HTML
|
250
|
+
assert_render(<<-HAML, <<-HTML)
|
251
251
|
.foo<
|
252
252
|
- 1.times do
|
253
253
|
= 2.times do
|
@@ -173,7 +173,6 @@ describe Hamlit::Engine do
|
|
173
173
|
specify { assert_render('#{}', "\n") }
|
174
174
|
specify { assert_render('1#{}', "1\n") }
|
175
175
|
specify { assert_render('1#{2}', "12\n") }
|
176
|
-
specify { assert_render('1#{2', "1\#{2\n", error_with: [:haml, :faml]) }
|
177
176
|
specify { assert_render('}#{1}', "}1\n") }
|
178
177
|
specify { assert_render('#{1}2', "12\n") }
|
179
178
|
specify { assert_render('1#{ "2#{3}4" }5', "12345\n") }
|
data/spec/spec_helper.rb
CHANGED
@@ -165,8 +165,7 @@ class TestCase < Struct.new(:file, :dir, :lineno, :src_haml, :haml_html, :faml_h
|
|
165
165
|
tests.group_by(&:doc_path).each do |path, tests|
|
166
166
|
test = tests.first
|
167
167
|
file_path = File.join(test.dir, test.file)
|
168
|
-
|
169
|
-
table_of_contents << "\n- [#{escape_markdown(file_path)}](#{File.join(base_url, path)})"
|
168
|
+
table_of_contents << "\n- [#{escape_markdown(file_path)}](#{path})"
|
170
169
|
end
|
171
170
|
table_of_contents << "\n"
|
172
171
|
end
|
@@ -192,10 +191,10 @@ class TestCase < Struct.new(:file, :dir, :lineno, :src_haml, :haml_html, :faml_h
|
|
192
191
|
end
|
193
192
|
|
194
193
|
def document
|
195
|
-
|
196
|
-
|
194
|
+
base_path = '/spec/hamlit'
|
195
|
+
path = File.join(base_path, dir, file)
|
197
196
|
doc = <<-DOC
|
198
|
-
# [#{escape_markdown("#{file}:#{lineno}")}](#{
|
197
|
+
# [#{escape_markdown("#{file}:#{lineno}")}](#{path}#L#{lineno})
|
199
198
|
## Input
|
200
199
|
```haml
|
201
200
|
#{src_haml}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hamlit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takashi Kokubun
|
@@ -248,20 +248,6 @@ dependencies:
|
|
248
248
|
- - ">="
|
249
249
|
- !ruby/object:Gem::Version
|
250
250
|
version: '0'
|
251
|
-
- !ruby/object:Gem::Dependency
|
252
|
-
name: tenjin
|
253
|
-
requirement: !ruby/object:Gem::Requirement
|
254
|
-
requirements:
|
255
|
-
- - ">="
|
256
|
-
- !ruby/object:Gem::Version
|
257
|
-
version: '0'
|
258
|
-
type: :development
|
259
|
-
prerelease: false
|
260
|
-
version_requirements: !ruby/object:Gem::Requirement
|
261
|
-
requirements:
|
262
|
-
- - ">="
|
263
|
-
- !ruby/object:Gem::Version
|
264
|
-
version: '0'
|
265
251
|
- !ruby/object:Gem::Dependency
|
266
252
|
name: therubyracer
|
267
253
|
requirement: !ruby/object:Gem::Requirement
|
@@ -310,12 +296,10 @@ files:
|
|
310
296
|
- benchmarks/context.rb
|
311
297
|
- benchmarks/view.erb
|
312
298
|
- benchmarks/view.haml
|
313
|
-
- benchmarks/view.rbhtml
|
314
299
|
- benchmarks/view.slim
|
315
300
|
- bin/hamlit
|
316
301
|
- doc/README.md
|
317
302
|
- doc/engine/old_attributes.md
|
318
|
-
- doc/engine/script.md
|
319
303
|
- doc/engine/text.md
|
320
304
|
- doc/filters/coffee.md
|
321
305
|
- doc/filters/erb.md
|
data/benchmarks/view.rbhtml
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
<!DOCTYPE HTML>
|
2
|
-
|
3
|
-
<html>
|
4
|
-
<head>
|
5
|
-
<title>Simple Benchmark</title>
|
6
|
-
</head>
|
7
|
-
<body>
|
8
|
-
<h1>#{ header }</h1>
|
9
|
-
<?rb unless item.empty? ?>
|
10
|
-
<ul>
|
11
|
-
<?rb for i in item ?>
|
12
|
-
<?rb if i[:current] ?>
|
13
|
-
<li><strong>#{ i[:name] }</strong></li>
|
14
|
-
<?rb else ?>
|
15
|
-
<li><a href="#{ i[:url] }">#{ i[:name] }</a></li>
|
16
|
-
<?rb end ?>
|
17
|
-
<?rb end ?>
|
18
|
-
</ul>
|
19
|
-
<?rb else ?>
|
20
|
-
<p>The list is empty.</p>
|
21
|
-
<?rb end ?>
|
22
|
-
</body>
|
23
|
-
</html>
|
data/doc/engine/script.md
DELETED
@@ -1,105 +0,0 @@
|
|
1
|
-
# [script\_spec.rb:41](https://github.com/k0kubun/hamlit/blob/master/spec/hamlit/engine/script_spec.rb#L41)
|
2
|
-
## Input
|
3
|
-
```haml
|
4
|
-
= 3.times do |i|
|
5
|
-
= i
|
6
|
-
4
|
7
|
-
|
8
|
-
```
|
9
|
-
|
10
|
-
## Output
|
11
|
-
### Haml, Faml
|
12
|
-
```html
|
13
|
-
0
|
14
|
-
1
|
15
|
-
2
|
16
|
-
34
|
17
|
-
|
18
|
-
```
|
19
|
-
|
20
|
-
### Hamlit
|
21
|
-
```html
|
22
|
-
0
|
23
|
-
1
|
24
|
-
2
|
25
|
-
3
|
26
|
-
4
|
27
|
-
|
28
|
-
```
|
29
|
-
|
30
|
-
|
31
|
-
# [script\_spec.rb:55](https://github.com/k0kubun/hamlit/blob/master/spec/hamlit/engine/script_spec.rb#L55)
|
32
|
-
## Input
|
33
|
-
```haml
|
34
|
-
%span
|
35
|
-
= 1.times do |i|
|
36
|
-
= i
|
37
|
-
|
38
|
-
```
|
39
|
-
|
40
|
-
## Output
|
41
|
-
### Haml, Faml
|
42
|
-
```html
|
43
|
-
<span>
|
44
|
-
0
|
45
|
-
1</span>
|
46
|
-
|
47
|
-
```
|
48
|
-
|
49
|
-
### Hamlit
|
50
|
-
```html
|
51
|
-
<span>
|
52
|
-
0
|
53
|
-
1
|
54
|
-
</span>
|
55
|
-
|
56
|
-
```
|
57
|
-
|
58
|
-
|
59
|
-
# [script\_spec.rb:87](https://github.com/k0kubun/hamlit/blob/master/spec/hamlit/engine/script_spec.rb#L87)
|
60
|
-
## Input
|
61
|
-
```haml
|
62
|
-
!= '<"&>'
|
63
|
-
!= '<"&>'.tap do |str|
|
64
|
-
-# no operation
|
65
|
-
|
66
|
-
```
|
67
|
-
|
68
|
-
## Output
|
69
|
-
### Haml, Faml
|
70
|
-
```html
|
71
|
-
<"&>
|
72
|
-
<"&>
|
73
|
-
```
|
74
|
-
|
75
|
-
### Hamlit
|
76
|
-
```html
|
77
|
-
<"&>
|
78
|
-
<"&>
|
79
|
-
|
80
|
-
```
|
81
|
-
|
82
|
-
|
83
|
-
# [script\_spec.rb:98](https://github.com/k0kubun/hamlit/blob/master/spec/hamlit/engine/script_spec.rb#L98)
|
84
|
-
## Input
|
85
|
-
```haml
|
86
|
-
&= '<"&>'
|
87
|
-
&= '<"&>'.tap do |str|
|
88
|
-
-# no operation
|
89
|
-
|
90
|
-
```
|
91
|
-
|
92
|
-
## Output
|
93
|
-
### Haml, Faml
|
94
|
-
```html
|
95
|
-
<"&>
|
96
|
-
<"&>
|
97
|
-
```
|
98
|
-
|
99
|
-
### Hamlit
|
100
|
-
```html
|
101
|
-
<"&>
|
102
|
-
<"&>
|
103
|
-
|
104
|
-
```
|
105
|
-
|