fast_haml 0.1.4 → 0.1.5
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 +3 -0
- data/lib/fast_haml/compiler.rb +7 -1
- data/lib/fast_haml/version.rb +1 -1
- data/spec/compiler_newline_spec.rb +10 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4dbc3b15e30a6c37e0c932d0dc6e2407cc3102e
|
4
|
+
data.tar.gz: 0e6c9d24076c83e7b5f76fdf88112db10f4bf854
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af1d8ee121870759f5215c9efa0de024c6e48d74e46b15ba142793df427f8eb8cb53fd8182633b6d59262628e8916382fc00eec8b818ae82b1a28687d8f5b6a5
|
7
|
+
data.tar.gz: 482e94239ea3a5f2b5c124f7fe1ae3c89a7bbcd412c70a12db1a2ecbf44a9e58886f9cfbc7e5f63fc215de4a0b3bb944b1043a49e6e3a8612ea5ac03363362a0
|
data/CHANGELOG.md
CHANGED
data/lib/fast_haml/compiler.rb
CHANGED
@@ -51,7 +51,9 @@ module FastHaml
|
|
51
51
|
compile_doctype(ast)
|
52
52
|
when Ast::HtmlComment
|
53
53
|
compile_html_comment(ast)
|
54
|
-
when Ast::HamlComment
|
54
|
+
when Ast::HamlComment
|
55
|
+
compile_haml_comment(ast)
|
56
|
+
when Ast::Empty
|
55
57
|
[:multi]
|
56
58
|
when Ast::Element
|
57
59
|
compile_element(ast)
|
@@ -170,6 +172,10 @@ module FastHaml
|
|
170
172
|
end
|
171
173
|
end
|
172
174
|
|
175
|
+
def compile_haml_comment(ast)
|
176
|
+
[:multi].concat([[:newline]] * ast.children.size)
|
177
|
+
end
|
178
|
+
|
173
179
|
def compile_element(ast)
|
174
180
|
temple = [
|
175
181
|
:haml, :tag,
|
data/lib/fast_haml/version.rb
CHANGED
@@ -51,7 +51,7 @@ HAML
|
|
51
51
|
HAML
|
52
52
|
end
|
53
53
|
|
54
|
-
it do
|
54
|
+
it 'keeps empty lines' do
|
55
55
|
expect { render_string(<<HAML) }.to raise_error(LineVerifier, raised_at(4))
|
56
56
|
%div
|
57
57
|
%span= 1
|
@@ -60,11 +60,19 @@ HAML
|
|
60
60
|
HAML
|
61
61
|
end
|
62
62
|
|
63
|
-
it do
|
63
|
+
it 'keeps leading empty lines' do
|
64
64
|
expect { render_string(<<HAML) }.to raise_error(LineVerifier, raised_at(3))
|
65
65
|
%div
|
66
66
|
|
67
67
|
%span= raise LineVerifier
|
68
|
+
HAML
|
69
|
+
end
|
70
|
+
|
71
|
+
it 'counts haml comments' do
|
72
|
+
expect { render_string(<<HAML) }.to raise_error(LineVerifier, raised_at(3))
|
73
|
+
-# foo
|
74
|
+
bar
|
75
|
+
%span= raise LineVerifier
|
68
76
|
HAML
|
69
77
|
end
|
70
78
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fast_haml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kohei Suzuki
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: escape_utils
|
@@ -347,7 +347,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
347
347
|
version: '0'
|
348
348
|
requirements: []
|
349
349
|
rubyforge_project:
|
350
|
-
rubygems_version: 2.
|
350
|
+
rubygems_version: 2.2.2
|
351
351
|
signing_key:
|
352
352
|
specification_version: 4
|
353
353
|
summary: Faster implementation of Haml template language.
|