mustache 0.99.0 → 0.99.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mustache/generator.rb +1 -1
- data/lib/mustache/version.rb +1 -1
- data/test/mustache_test.rb +9 -0
- metadata +4 -4
data/lib/mustache/generator.rb
CHANGED
@@ -105,7 +105,7 @@ class Mustache
|
|
105
105
|
Mustache::Template.new(v.call(#{raw.inspect}).to_s).render(ctx.dup)
|
106
106
|
else
|
107
107
|
# Shortcut when passed non-array
|
108
|
-
v = [v]
|
108
|
+
v = [v] unless v.is_a?(Array) || defined?(Enumerator) && v.is_a?(Enumerator)
|
109
109
|
|
110
110
|
v.map { |h| ctx.push(h); r = #{code}; ctx.pop; r }.join
|
111
111
|
end
|
data/lib/mustache/version.rb
CHANGED
data/test/mustache_test.rb
CHANGED
@@ -57,6 +57,15 @@ end_complex
|
|
57
57
|
assert_equal %Q'<p class="flash-notice" style="display: none;">', instance.render
|
58
58
|
end
|
59
59
|
|
60
|
+
def test_strings_as_sections_do_not_enumerate
|
61
|
+
instance = Mustache.new
|
62
|
+
instance[:contact] = "Call 1-888-FLOWERS\nAsk for Johnson."
|
63
|
+
instance.template = "{{#contact}}<div id='contact'>{{contact}}</div>{{/contact}}"
|
64
|
+
|
65
|
+
assert_equal "<div id='contact'>Call 1-888-FLOWERS\nAsk for Johnson.</div>",
|
66
|
+
instance.render
|
67
|
+
end
|
68
|
+
|
60
69
|
def test_sassy_single_line_sections
|
61
70
|
instance = Mustache.new
|
62
71
|
instance[:full_time] = true
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mustache
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 401
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 99
|
9
|
-
-
|
10
|
-
version: 0.99.
|
9
|
+
- 1
|
10
|
+
version: 0.99.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Chris Wanstrath
|
@@ -17,7 +17,7 @@ autorequire:
|
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
19
|
|
20
|
-
date: 2011-
|
20
|
+
date: 2011-03-01 00:00:00 -08:00
|
21
21
|
default_executable:
|
22
22
|
dependencies: []
|
23
23
|
|