mustache 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- N2MzZDViZWQ0ODY5NmZhYzc2NjdmZThkNWYzOWUxMjg1NDMzOWUwMw==
4
+ N2E0NDQ2MDc0ZDI0ZWM1NGU2N2M4MTdlMTAxOTkyY2JkZDYzOWE3Yw==
5
5
  data.tar.gz: !binary |-
6
- ZTY0MmE3MmU4M2RkM2RmNjg5N2Q5ZjBiNWRlZTZiN2UxY2ZhM2U0Zg==
6
+ NzFlMjg3YmFjNWY5NTY4MmQ2NmQ3OTkyNjgxYTQyYWEzY2VlN2Q0Mw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YjYyMTdmOTgwMTQ3NGE3MjU1MGI3Nzg4Yzg2Mjk1YTJhY2UzNDZhNjVlMDBi
10
- MmZiYTJjYzZmOTA4ZmEyN2VhNDAyNjA5ZmZkM2I4YWUyMGI5ZDQ5ZWVhMWRh
11
- ODk3YTk0NDBhYzZkOGYyZDlhMjA1ODA2NWJmYmFlNjA3MTE2YzQ=
9
+ YTM2ZTgwMzEzOWY2MjFhY2FkMGQ5OWY5NWY3OWRhNjQ2YmUyNTc1ZDdhNGZl
10
+ MWU3OWQ4ZjE1ZmExZWY3Nzg5Y2E3N2ZkMmEyZWE0ZWZmYmQwNmM5YjMwOGQy
11
+ ZjA5MTUxMzkxMTZjMWFmNGY3YmY5YmMwOGY0ZGFlYTViOGE1ZjI=
12
12
  data.tar.gz: !binary |-
13
- MGM4M2U2NDI4ZjRkZTU4ZTIzOTQwZjQ4MmMzZmE4NDczNDI4NTY2YzE3ZmNk
14
- NDIzMWJlOWE5NDVmMzUwYWU0MjRiM2VjMTVhODllMTdhNGVkZjAwMTQ2NzAy
15
- OWIwMGE2YWY3MjA4ZGIzZmZlZDZkNWI0YjJlMzc1NWEzZGY3NjY=
13
+ NzAwNzI4YjUzNzM5MDY1OGQ5YzZjMGVlMDAxZjg0NWVmMmRjZjg5MWY5OGU5
14
+ OTI2YWY0NmVjZTEzZGNkNGMwYWQ3ZGIzNmVmOGNhYjY2MmYyYmFjYWM4MDkx
15
+ ZjQ3YjY5ODM2ZmUwNGVkZjQyODI0OWUyZGI1OGUwNzkxYjM0MmY=
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # Mustache
2
2
 
3
- [![Join the chat at https://gitter.im/mustache/mustache](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/mustache/mustache?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
3
+ [![Gem Version](https://badge.fury.io/rb/mustache.svg)](http://badge.fury.io/rb/mustache)
4
+ [![Build Status](https://travis-ci.org/mustache/mustache.svg?branch=master)](https://travis-ci.org/mustache/mustache)
4
5
 
5
6
  Inspired by [ctemplate][1] and [et][2], Mustache is a
6
7
  framework-agnostic way to render logic-free views.
@@ -359,12 +360,18 @@ Once you've made your great commits:
359
360
 
360
361
  ## Mailing List
361
362
 
362
- To join the list simply send an email to <mustache@librelist.com>. This
363
+ ~~To join the list simply send an email to <mustache@librelist.com>. This
363
364
  will subscribe you and send you information about your subscription,
364
365
  including unsubscribe information.
365
366
 
366
- The archive can be found at <http://librelist.com/browser/mustache/>.
367
+ The archive can be found at <http://librelist.com/browser/mustache/>.~~
368
+
369
+ The mailing list hasn't been updated in quite a while, please join us on Gitter
370
+ or IRC:
371
+
372
+ [![Join the chat at https://gitter.im/mustache/mustache](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/mustache/mustache?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
367
373
 
374
+ [#{ on Freenode][irc]
368
375
 
369
376
  ## Meta
370
377
 
@@ -374,9 +381,6 @@ The archive can be found at <http://librelist.com/browser/mustache/>.
374
381
  * List: <mustache@librelist.com>
375
382
  * Gems: <http://rubygems.org/gems/mustache>
376
383
 
377
- You can also find us in #{ on [irc.freenode.net][irc].
378
-
379
-
380
384
  [1]: http://code.google.com/p/google-ctemplate/
381
385
  [2]: http://www.ivan.fomichev.name/2008/05/erlang-template-engine-prototype.html
382
386
  [3]: http://google-ctemplate.googlecode.com/svn/trunk/doc/howto.html
@@ -13,6 +13,7 @@ class Mustache
13
13
  #
14
14
  def initialize(mustache)
15
15
  @stack = [mustache]
16
+ @partial_template_cache = {}
16
17
  end
17
18
 
18
19
  # A {{>partial}} tag translates into a call to the context's
@@ -29,8 +30,12 @@ class Mustache
29
30
  # Indent the partial template by the given indentation.
30
31
  part = mustache.partial(name).to_s.gsub(/^/, indentation)
31
32
 
32
- # Call the Mustache's `partial` method and render the result.
33
- mustache.render(part, self)
33
+ # Get a template object for the partial and render the result.
34
+ template_for_partial(part).render(self)
35
+ end
36
+
37
+ def template_for_partial(partial)
38
+ @partial_template_cache[partial] ||= Template.new(partial)
34
39
  end
35
40
 
36
41
  # Find the first Mustache in the stack.
@@ -45,7 +45,7 @@ EOF
45
45
  end
46
46
 
47
47
  # The sigil types which are valid after an opening `{{`
48
- VALID_TYPES = [ '#', '^', '/', '=', '!', '<', '>', '&', '{' ].map &:freeze
48
+ VALID_TYPES = [ '#', '^', '/', '=', '!', '<', '>', '&', '{' ].map(&:freeze)
49
49
 
50
50
  def self.valid_types
51
51
  @valid_types ||= Regexp.new(VALID_TYPES.map { |t| Regexp.escape(t) }.join('|') )
@@ -158,7 +158,7 @@ EOF
158
158
  pre_match_position = @scanner.pos
159
159
  last_index = @result.length
160
160
 
161
- return unless x = @scanner.scan(/([ \t]*)?#{Regexp.escape(otag)}/)
161
+ return unless @scanner.scan(/([ \t]*)?#{Regexp.escape(otag)}/)
162
162
  padding = @scanner[1] || ''
163
163
 
164
164
  # Don't touch the preceding whitespace unless we're matching the start
@@ -1,3 +1,3 @@
1
1
  class Mustache
2
- VERSION = '1.0.1'
2
+ VERSION = '1.0.2'
3
3
  end
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "MUSTACHE" "1" "October 2014" "DEFUNKT" "Mustache Manual"
4
+ .TH "MUSTACHE" "1" "February 2015" "DEFUNKT" "Mustache Manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBmustache\fR \- Mustache processor
@@ -204,7 +204,7 @@ data
204
204
 
205
205
  <ol class='man-decor man-foot man foot'>
206
206
  <li class='tl'>DEFUNKT</li>
207
- <li class='tc'>October 2014</li>
207
+ <li class='tc'>February 2015</li>
208
208
  <li class='tr'>mustache(1)</li>
209
209
  </ol>
210
210
 
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "MUSTACHE" "5" "October 2014" "DEFUNKT" "Mustache Manual"
4
+ .TH "MUSTACHE" "5" "February 2015" "DEFUNKT" "Mustache Manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBmustache\fR \- Logic\-less templates\.
@@ -69,10 +69,10 @@ Tags are indicated by the double mustaches\. \fB{{person}}\fR is a tag, as is \f
69
69
  The most basic tag type is the variable\. A \fB{{name}}\fR tag in a basic template will try to find the \fBname\fR key in the current context\. If there is no \fBname\fR key, the parent contexts will be checked recursively\. If the top context is reached and the \fBname\fR key is still not found, nothing will be rendered\.
70
70
  .
71
71
  .P
72
- All variables are HTML escaped by default\. If you want to return unescaped HTML, use the triple mustache: \fB{{{name}}}\fR\.
72
+ All variables are HTML escaped by default\. If you want to return raw contents without escaping, use the triple mustache: \fB{{{name}}}\fR\.
73
73
  .
74
74
  .P
75
- You can also use \fB&\fR to unescape a variable: \fB{{& name}}\fR\. This may be useful when changing delimiters (see "Set Delimiter" below)\.
75
+ You can also use \fB&\fR to return its raw contents: \fB{{& name}}\fR\. This may be useful when changing delimiters (see "Set Delimiter" below)\.
76
76
  .
77
77
  .P
78
78
  By default a variable "miss" returns an empty string\. This can usually be configured in your Mustache library\. The Ruby version of Mustache supports raising an exception in this situation, for instance\.
@@ -125,10 +125,10 @@ there is no <code>name</code> key, the parent contexts will be checked recursive
125
125
  If the top context is reached and the <code>name</code> key is still not found,
126
126
  nothing will be rendered.</p>
127
127
 
128
- <p>All variables are HTML escaped by default. If you want to return
129
- unescaped HTML, use the triple mustache: <code>{{{name}}}</code>.</p>
128
+ <p>All variables are HTML escaped by default. If you want to return raw contents
129
+ without escaping, use the triple mustache: <code>{{{name}}}</code>.</p>
130
130
 
131
- <p>You can also use <code>&amp;</code> to unescape a variable: <code>{{&amp; name}}</code>. This may be
131
+ <p>You can also use <code>&amp;</code> to return its raw contents: <code>{{&amp; name}}</code>. This may be
132
132
  useful when changing delimiters (see "Set Delimiter" below).</p>
133
133
 
134
134
  <p>By default a variable "miss" returns an empty string. This can usually
@@ -415,7 +415,7 @@ markup."</p>
415
415
 
416
416
  <ol class='man-decor man-foot man foot'>
417
417
  <li class='tl'>DEFUNKT</li>
418
- <li class='tc'>October 2014</li>
418
+ <li class='tc'>February 2015</li>
419
419
  <li class='tr'>mustache(5)</li>
420
420
  </ol>
421
421
 
@@ -54,10 +54,10 @@ there is no `name` key, the parent contexts will be checked recursively.
54
54
  If the top context is reached and the `name` key is still not found,
55
55
  nothing will be rendered.
56
56
 
57
- All variables are HTML escaped by default. If you want to return
58
- unescaped HTML, use the triple mustache: `{{{name}}}`.
57
+ All variables are HTML escaped by default. If you want to return raw contents
58
+ without escaping, use the triple mustache: `{{{name}}}`.
59
59
 
60
- You can also use `&` to unescape a variable: `{{& name}}`. This may be
60
+ You can also use `&` to return its raw contents: `{{& name}}`. This may be
61
61
  useful when changing delimiters (see "Set Delimiter" below).
62
62
 
63
63
  By default a variable "miss" returns an empty string. This can usually
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mustache
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Wanstrath
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2015-02-23 00:00:00.000000000 Z
14
+ date: 2015-06-24 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler
@@ -69,6 +69,20 @@ dependencies:
69
69
  - - ! '>='
70
70
  - !ruby/object:Gem::Version
71
71
  version: '0'
72
+ - !ruby/object:Gem::Dependency
73
+ name: ruby-prof
74
+ requirement: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - ! '>='
77
+ - !ruby/object:Gem::Version
78
+ version: '0'
79
+ type: :development
80
+ prerelease: false
81
+ version_requirements: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
72
86
  - !ruby/object:Gem::Dependency
73
87
  name: rdoc
74
88
  requirement: !ruby/object:Gem::Requirement