bob-compiler 0.0.1 → 0.0.2

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: 61eb15e3c30c2bc86d29a782bdb6252ad1bde448
4
- data.tar.gz: 2bac9022339fd3d22528a49f5211243304b7de1f
3
+ metadata.gz: 7c15e6a8c59113301408089f9669277eb3d58977
4
+ data.tar.gz: 002a11a888823e3d548cd9643206472ee045ecbd
5
5
  SHA512:
6
- metadata.gz: d5eaaa22cfbd87d1b0c2c4a606cbeb18d0b08af6e9f984c3092d68aa6f45f0dc7431ca2d1c86eabeb370cff220f78ac45fab4902e1a6c6889d9fd4ea59c58543
7
- data.tar.gz: ba8f418b9f47e9e8096866b145508a22914cef9a8fe8b9900ce71e63597a42c8c8c84a492c92bfa568944ea28d21a1efdfe60784afc4c62785161fa4702c80ff
6
+ metadata.gz: 09365467c788c9b4866c057071b4b39002d6519b9ccdc1008873f4e24c84616a7d3744e49372e3c21f0174abcf375a4a79a9ae08f24f54803ab1c14cbeda099f
7
+ data.tar.gz: 11c1b125bf2e70a1923c30ae9edf12fcc515a154d5623169f624aa0b7e5dfcd6f3be19df533dd7efba9bdda4855c44a706f3cde83341d43d6181e9932ecb11d3
@@ -30,16 +30,20 @@ module Bob
30
30
  else
31
31
  parts.map { |str|
32
32
 
33
- if SUBSTITUTION_SCANNER =~ str && str[0] != "/"
34
- if (parsed = SUBSTITUTION_PARSER.match(str))
35
- if parsed[:fallback]
36
- "env.get(#{quote parsed[:path]}, #{quote unescape parsed[:fallback]})"
33
+ if SUBSTITUTION_SCANNER =~ str
34
+ if str[0] == "\\"
35
+ quote(str[1..-1] || "")
36
+ else
37
+ if (parsed = SUBSTITUTION_PARSER.match(str))
38
+ if parsed[:fallback]
39
+ "env.get(#{quote parsed[:path]}, #{quote unescape parsed[:fallback]})"
40
+ else
41
+ "env.get(#{quote parsed[:path]})"
42
+ end
37
43
  else
38
- "env.get(#{quote parsed[:path]})"
44
+ warn "Treating invalid substitution as string: #{str.inspect}", node.parent.line
45
+ quote str
39
46
  end
40
- else
41
- warn "Treating invalid substitution as string: #{str.inspect}", node.parent.line
42
- quote str
43
47
  end
44
48
  else
45
49
  quote str
@@ -1,5 +1,5 @@
1
1
  module Bob
2
2
  module Compiler
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
@@ -48,7 +48,7 @@ function(dom, env) {
48
48
  dom.appendElement();
49
49
  dom.appendTextNode("\n ");
50
50
  dom.appendComment(" " + env.get("some_stuff", "\" {{ 'escaped' }} \"") + " ");
51
- dom.appendTextNode("\n " + "\\{{ escaped }}" + "\n");
51
+ dom.appendTextNode("\n " + "{{ escaped }}" + "\n");
52
52
 
53
53
  descriptor.element = dom.getElement();
54
54
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bob-compiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Godfrey Chan
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-01-13 00:00:00.000000000 Z
12
+ date: 2015-04-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
@@ -178,3 +178,4 @@ test_files:
178
178
  - test/layouts_test.rb
179
179
  - test/templates_test.rb
180
180
  - test/test_helper.rb
181
+ has_rdoc: