fast_haml 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e6d99c4413e3858045374b49a571cd49b41a6bdd
4
- data.tar.gz: 9cca499f18f80fbd21e45fc661feafdf133342a2
3
+ metadata.gz: e4dbc3b15e30a6c37e0c932d0dc6e2407cc3102e
4
+ data.tar.gz: 0e6c9d24076c83e7b5f76fdf88112db10f4bf854
5
5
  SHA512:
6
- metadata.gz: b7823392fa8c824f2658a6f2e565cc0c31a142e0dcff1e7e087f290248ff1775f1898ba8afcf33ca762c595f608f32ca29960f821be97841b515e4d23fd17ad0
7
- data.tar.gz: 445518be81a78566281badd2336ec90f6c2a7b9cd1b515f2276bf32d8e285f9d7a8380634116fd3aee58d654064f04059075d4f322598f525534d410b59f8a9b
6
+ metadata.gz: af1d8ee121870759f5215c9efa0de024c6e48d74e46b15ba142793df427f8eb8cb53fd8182633b6d59262628e8916382fc00eec8b818ae82b1a28687d8f5b6a5
7
+ data.tar.gz: 482e94239ea3a5f2b5c124f7fe1ae3c89a7bbcd412c70a12db1a2ecbf44a9e58886f9cfbc7e5f63fc215de4a0b3bb944b1043a49e6e3a8612ea5ac03363362a0
@@ -1,3 +1,6 @@
1
+ ## 0.1.5 (2015-03-01)
2
+ - Fix minor newline generation bug with Haml comment
3
+
1
4
  ## 0.1.4 (2015-02-28)
2
5
  - Fix newline generation around empty lines
3
6
  - Internal: introduce Ast::Empty and remove LineCounter
@@ -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, Ast::Empty
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,
@@ -1,3 +1,3 @@
1
1
  module FastHaml
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
@@ -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
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-02-27 00:00:00.000000000 Z
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.4.5
350
+ rubygems_version: 2.2.2
351
351
  signing_key:
352
352
  specification_version: 4
353
353
  summary: Faster implementation of Haml template language.