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 +4 -4
- data/lib/bob/compiler/substitution.rb +12 -8
- data/lib/bob/compiler/version.rb +1 -1
- data/test/fixtures/blocks/substitions.js +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c15e6a8c59113301408089f9669277eb3d58977
|
4
|
+
data.tar.gz: 002a11a888823e3d548cd9643206472ee045ecbd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
34
|
-
if
|
35
|
-
|
36
|
-
|
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
|
-
"
|
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
|
data/lib/bob/compiler/version.rb
CHANGED
@@ -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 " + "
|
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.
|
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-
|
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:
|