faml 0.2.7 → 0.2.8

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: fd9450955cdd17a06278c80b23b5b4b566e3ac15
4
- data.tar.gz: e115460cd407681b8c8768f976ad9f4a33b74313
3
+ metadata.gz: 00278629939c45cb0b99bb33b4804a1632fe9e2b
4
+ data.tar.gz: 8c70078e0c7da99320775bd7b1e9fbadae654aa3
5
5
  SHA512:
6
- metadata.gz: 89aab3814554aef1673f164c666bc974f3fc7e8b2ff45b2e4bb438861caaac7796d4a2b76b9ccb612259e5737aac0001877d1d1d20e42bfb49867054e5547010
7
- data.tar.gz: ab7478d4edefc0e5d3fc6f70cd1b6af2a6c1b8e40ea4d73175592b1e67d72500fc767ecaf2d9d7fc4022f684e0b78b0fa99112544f5dc22a8ad033101c87076b
6
+ metadata.gz: 0d4a3d25800c968bd0499386817e64293bd8bc99cfe2df3d8bc05d827c2fee83e663f9d7b793429a3f0ded1f8d2b662e656ed89dc76ae801c0084394506f3bb1
7
+ data.tar.gz: aacf989f3c254913503803e8596cb05c90fcc839f43344bcca6a3379132a06ccfac92a62db9738dd7886cbc54928d12c2e5703c5a298c3cbd0b244a7b08009fe
@@ -1,3 +1,10 @@
1
+ ## 0.2.8 (2015-04-02)
2
+ - Allow empty silent script body
3
+ - For compatibility with haml
4
+ - https://github.com/eagletmt/faml/issues/16
5
+ - Fix parse error at multiline in attribute list
6
+ - https://github.com/eagletmt/faml/issues/15
7
+
1
8
  ## 0.2.7 (2015-03-31)
2
9
  - Improve backtrace of compile time errors
3
10
  - Annotate Faml::Ast with filename and line number (internal)
@@ -98,7 +98,7 @@ module Faml
98
98
  attr = s.pre_match + s.matched
99
99
  return [attr[1, attr.size-2], s.rest]
100
100
  else
101
- if text[-1] == ',' && @line_parser.has_next?
101
+ if /,\s*\z/ === text && @line_parser.has_next?
102
102
  text << @line_parser.next_line
103
103
  else
104
104
  syntax_error!('Unmatched brace')
@@ -146,9 +146,6 @@ module Faml
146
146
  end
147
147
  node = create_node(Ast::SilentScript)
148
148
  node.script = text[/\A- *(.*)\z/, 1]
149
- if node.script.empty?
150
- syntax_error!("No Ruby code to evaluate")
151
- end
152
149
  node.script += RubyMultiline.read(@line_parser, node.script)
153
150
  @ast << node
154
151
  end
@@ -1,3 +1,3 @@
1
1
  module Faml
2
- VERSION = "0.2.7"
2
+ VERSION = "0.2.8"
3
3
  end
@@ -34,6 +34,13 @@ HAML
34
34
  hello
35
35
  |
36
36
  world
37
+ HAML
38
+ end
39
+
40
+ it 'can be used in attribute list' do
41
+ expect(render_string(<<HAML)).to eq("<div bar='2' foo='1'></div>\n")
42
+ %div{foo: 1, |
43
+ bar: 2}
37
44
  HAML
38
45
  end
39
46
  end
@@ -80,8 +80,8 @@ HAML
80
80
  HAML
81
81
  end
82
82
 
83
- it 'raises error if no Ruby code is given' do
84
- expect { render_string('-') }.to raise_error(Faml::SyntaxError)
83
+ it 'allows empty silent script body' do
84
+ expect(render_string("%br\n-\n%br")).to eq("<br>\n<br>\n")
85
85
  end
86
86
 
87
87
  it 'checks indent levels' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.8
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-03-31 00:00:00.000000000 Z
11
+ date: 2015-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: escape_utils
@@ -432,7 +432,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
432
432
  version: '0'
433
433
  requirements: []
434
434
  rubyforge_project:
435
- rubygems_version: 2.4.5
435
+ rubygems_version: 2.2.2
436
436
  signing_key:
437
437
  specification_version: 4
438
438
  summary: Faster implementation of Haml template language.