mustache 0.99.0 → 0.99.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -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] if v.respond_to?(:has_key?) || !v.respond_to?(:map) || v.is_a?(Struct)
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
@@ -1,3 +1,3 @@
1
1
  class Mustache
2
- Version = VERSION = '0.99.0'
2
+ Version = VERSION = '0.99.1'
3
3
  end
@@ -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: 403
4
+ hash: 401
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 99
9
- - 0
10
- version: 0.99.0
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-02-28 00:00:00 -08:00
20
+ date: 2011-03-01 00:00:00 -08:00
21
21
  default_executable:
22
22
  dependencies: []
23
23