mustache 0.11.0 → 0.11.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -75,9 +75,9 @@ reference others, some return values, some return only booleans.
75
75
  Now let's write the template:
76
76
 
77
77
  Hello {{name}}
78
- You have just won ${{value}}!
78
+ You have just won {{value}} dollars!
79
79
  {{#in_ca}}
80
- Well, ${{taxed_value}}, after taxes.
80
+ Well, {{taxed_value}} dollars, after taxes.
81
81
  {{/in_ca}}
82
82
 
83
83
  This template references our view methods. To bring it all together,
@@ -88,8 +88,8 @@ here's the code to render actual HTML;
88
88
  Which returns the following:
89
89
 
90
90
  Hello Chris
91
- You have just won $10000!
92
- Well, $6000.0, after taxes.
91
+ You have just won 10000 dollars!
92
+ Well, 6000.0 dollars, after taxes.
93
93
 
94
94
  Simple.
95
95
 
@@ -125,7 +125,7 @@ class-based and this more procedural style at your leisure.
125
125
  Given this template (winner.mustache):
126
126
 
127
127
  Hello {{name}}
128
- You have just won ${{value}}!
128
+ You have just won {{value}} bucks!
129
129
 
130
130
  We can fill in the values at will:
131
131
 
@@ -137,14 +137,14 @@ We can fill in the values at will:
137
137
  Which returns:
138
138
 
139
139
  Hello George
140
- You have just won $100!
140
+ You have just won 100 bucks!
141
141
 
142
142
  We can re-use the same object, too:
143
143
 
144
144
  view[:name] = 'Tony'
145
145
  view.render
146
146
  Hello Tony
147
- You have just won $100!
147
+ You have just won 100 bucks!
148
148
 
149
149
 
150
150
  Templates
@@ -73,7 +73,7 @@ class Mustache
73
73
  puts Mustache.render(template, data)
74
74
  end
75
75
  else
76
- puts doc
76
+ puts Mustache.render(doc)
77
77
  end
78
78
  end
79
79
  end
@@ -1,3 +1,3 @@
1
1
  class Mustache
2
- Version = VERSION = '0.11.0'
2
+ Version = VERSION = '0.11.1'
3
3
  end
@@ -14,9 +14,9 @@ A typical Mustache template:
14
14
  .nf
15
15
 
16
16
  Hello {{name}}
17
- You have just won ${{value}}!
17
+ You have just won {{value}} dollars!
18
18
  {{#in_ca}}
19
- Well, ${{taxed_value}}, after taxes.
19
+ Well, {{taxed_value}} dollars, after taxes.
20
20
  {{/in_ca}}
21
21
  .
22
22
  .fi
@@ -49,8 +49,8 @@ Will produce the following:
49
49
  .nf
50
50
 
51
51
  Hello Chris
52
- You have just won $10000!
53
- Well, $6000.0, after taxes.
52
+ You have just won 10000 dollars!
53
+ Well, 6000.0 dollars, after taxes.
54
54
  .
55
55
  .fi
56
56
  .
@@ -70,9 +70,9 @@
70
70
  <p>A typical Mustache template:</p>
71
71
 
72
72
  <pre><code>Hello {{name}}
73
- You have just won ${{value}}!
73
+ You have just won {{value}} dollars!
74
74
  {{#in_ca}}
75
- Well, ${{taxed_value}}, after taxes.
75
+ Well, {{taxed_value}} dollars, after taxes.
76
76
  {{/in_ca}}
77
77
  </code></pre>
78
78
 
@@ -89,8 +89,8 @@ Well, ${{taxed_value}}, after taxes.
89
89
  <p>Will produce the following:</p>
90
90
 
91
91
  <pre><code>Hello Chris
92
- You have just won $10000!
93
- Well, $6000.0, after taxes.
92
+ You have just won 10000 dollars!
93
+ Well, 6000.0 dollars, after taxes.
94
94
  </code></pre>
95
95
 
96
96
  <h2>DESCRIPTION</h2>
@@ -6,9 +6,9 @@ mustache(5) -- Logic-less templates.
6
6
  A typical Mustache template:
7
7
 
8
8
  Hello {{name}}
9
- You have just won ${{value}}!
9
+ You have just won {{value}} dollars!
10
10
  {{#in_ca}}
11
- Well, ${{taxed_value}}, after taxes.
11
+ Well, {{taxed_value}} dollars, after taxes.
12
12
  {{/in_ca}}
13
13
 
14
14
  Given the following hash:
@@ -23,8 +23,8 @@ Given the following hash:
23
23
  Will produce the following:
24
24
 
25
25
  Hello Chris
26
- You have just won $10000!
27
- Well, $6000.0, after taxes.
26
+ You have just won 10000 dollars!
27
+ Well, 6000.0 dollars, after taxes.
28
28
 
29
29
 
30
30
  ## DESCRIPTION
@@ -57,6 +57,22 @@ rendered
57
57
  rendered
58
58
  end
59
59
 
60
+ def test_multi_line_sections_preserve_trailing_newline
61
+ view = Mustache.new
62
+ view.template = <<template
63
+ {{#something}}
64
+ yay
65
+ {{/something}}
66
+ Howday.
67
+ template
68
+
69
+ view[:something] = true
70
+ assert_equal <<-rendered.strip, view.render.strip
71
+ yay
72
+ Howday.
73
+ rendered
74
+ end
75
+
60
76
  def test_single_line_inverted_sections
61
77
  html = %(<p class="flash-notice" {{^ flash }}style="display: none;"{{/ flash }}>)
62
78
 
@@ -448,7 +464,7 @@ template
448
464
  base = Class.new(Mustache)
449
465
  tmpl = Class.new(base)
450
466
 
451
- {:template_path => File.expand_path('./foo'),
467
+ {:template_path => File.expand_path('./foo'),
452
468
  :template_extension => 'stache',
453
469
  :view_namespace => TestNamespace,
454
470
  :view_path => './foo'
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 11
8
- - 0
9
- version: 0.11.0
8
+ - 1
9
+ version: 0.11.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Chris Wanstrath
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-04-18 00:00:00 -04:00
17
+ date: 2010-05-12 00:00:00 -07:00
18
18
  default_executable:
19
19
  dependencies: []
20
20