[DRE-commits] [ruby-mustache] 01/04: Imported Upstream version 1.0.2

zeha at debian.org zeha at debian.org
Sun Sep 27 05:55:09 UTC 2015


This is an automated email from the git hooks/post-receive script.

zeha pushed a commit to annotated tag debian/1.0.2-1
in repository ruby-mustache.

commit 7fd726e303bb308b75187567f4306be22a59a50f
Author: Christian Hofstaedtler <zeha at debian.org>
Date:   Sun Sep 27 05:45:42 2015 +0000

    Imported Upstream version 1.0.2
---
 README.md               | 16 ++++++++++------
 lib/mustache/context.rb |  9 +++++++--
 lib/mustache/parser.rb  |  4 ++--
 lib/mustache/version.rb |  2 +-
 man/mustache.1          |  2 +-
 man/mustache.1.html     |  2 +-
 man/mustache.5          |  6 +++---
 man/mustache.5.html     |  8 ++++----
 man/mustache.5.ron      |  6 +++---
 metadata.yml            | 18 ++++++++++++++++--
 10 files changed, 48 insertions(+), 25 deletions(-)

diff --git a/README.md b/README.md
index 6d7c661..9c10552 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,7 @@
 # Mustache
 
-[![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)
+[![Gem Version](https://badge.fury.io/rb/mustache.svg)](http://badge.fury.io/rb/mustache)
+[![Build Status](https://travis-ci.org/mustache/mustache.svg?branch=master)](https://travis-ci.org/mustache/mustache)
 
 Inspired by [ctemplate][1] and [et][2], Mustache is a
 framework-agnostic way to render logic-free views.
@@ -359,12 +360,18 @@ Once you've made your great commits:
 
 ## Mailing List
 
-To join the list simply send an email to <mustache at librelist.com>. This
+~~To join the list simply send an email to <mustache at librelist.com>. This
 will subscribe you and send you information about your subscription,
 including unsubscribe information.
 
-The archive can be found at <http://librelist.com/browser/mustache/>.
+The archive can be found at <http://librelist.com/browser/mustache/>.~~
+
+The mailing list hasn't been updated in quite a while, please join us on Gitter
+or IRC:
+
+[![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)
 
+[#{ on Freenode][irc]
 
 ## Meta
 
@@ -374,9 +381,6 @@ The archive can be found at <http://librelist.com/browser/mustache/>.
 * List: <mustache at librelist.com>
 * Gems: <http://rubygems.org/gems/mustache>
 
-You can also find us in #{ on [irc.freenode.net][irc].
-
-
 [1]: http://code.google.com/p/google-ctemplate/
 [2]: http://www.ivan.fomichev.name/2008/05/erlang-template-engine-prototype.html
 [3]: http://google-ctemplate.googlecode.com/svn/trunk/doc/howto.html
diff --git a/lib/mustache/context.rb b/lib/mustache/context.rb
index 06efbfc..ce7be72 100644
--- a/lib/mustache/context.rb
+++ b/lib/mustache/context.rb
@@ -13,6 +13,7 @@ class Mustache
     #
     def initialize(mustache)
       @stack = [mustache]
+      @partial_template_cache = {}
     end
 
     # A {{>partial}} tag translates into a call to the context's
@@ -29,8 +30,12 @@ class Mustache
       # Indent the partial template by the given indentation.
       part = mustache.partial(name).to_s.gsub(/^/, indentation)
 
-      # Call the Mustache's `partial` method and render the result.
-      mustache.render(part, self)
+      # Get a template object for the partial and render the result.
+      template_for_partial(part).render(self)
+    end
+
+    def template_for_partial(partial)
+      @partial_template_cache[partial] ||= Template.new(partial)
     end
 
     # Find the first Mustache in the stack.
diff --git a/lib/mustache/parser.rb b/lib/mustache/parser.rb
index 8462e1e..4154eb7 100644
--- a/lib/mustache/parser.rb
+++ b/lib/mustache/parser.rb
@@ -45,7 +45,7 @@ EOF
     end
 
     # The sigil types which are valid after an opening `{{`
-    VALID_TYPES = [ '#', '^', '/', '=', '!', '<', '>', '&', '{' ].map &:freeze
+    VALID_TYPES = [ '#', '^', '/', '=', '!', '<', '>', '&', '{' ].map(&:freeze)
 
     def self.valid_types
       @valid_types ||= Regexp.new(VALID_TYPES.map { |t| Regexp.escape(t) }.join('|') )
@@ -158,7 +158,7 @@ EOF
       pre_match_position = @scanner.pos
       last_index = @result.length
 
-      return unless x = @scanner.scan(/([ \t]*)?#{Regexp.escape(otag)}/)
+      return unless @scanner.scan(/([ \t]*)?#{Regexp.escape(otag)}/)
       padding = @scanner[1] || ''
 
       # Don't touch the preceding whitespace unless we're matching the start
diff --git a/lib/mustache/version.rb b/lib/mustache/version.rb
index 585dc84..d6489e4 100644
--- a/lib/mustache/version.rb
+++ b/lib/mustache/version.rb
@@ -1,3 +1,3 @@
 class Mustache
-  VERSION = '1.0.1'
+  VERSION = '1.0.2'
 end
diff --git a/man/mustache.1 b/man/mustache.1
index 96ef6bd..00905d5 100644
--- a/man/mustache.1
+++ b/man/mustache.1
@@ -1,7 +1,7 @@
 .\" generated with Ronn/v0.7.3
 .\" http://github.com/rtomayko/ronn/tree/0.7.3
 .
-.TH "MUSTACHE" "1" "October 2014" "DEFUNKT" "Mustache Manual"
+.TH "MUSTACHE" "1" "February 2015" "DEFUNKT" "Mustache Manual"
 .
 .SH "NAME"
 \fBmustache\fR \- Mustache processor
diff --git a/man/mustache.1.html b/man/mustache.1.html
index 5d3eb47..d3e73cb 100644
--- a/man/mustache.1.html
+++ b/man/mustache.1.html
@@ -204,7 +204,7 @@ data
 
   <ol class='man-decor man-foot man foot'>
     <li class='tl'>DEFUNKT</li>
-    <li class='tc'>October 2014</li>
+    <li class='tc'>February 2015</li>
     <li class='tr'>mustache(1)</li>
   </ol>
 
diff --git a/man/mustache.5 b/man/mustache.5
index b652ec7..124efc3 100644
--- a/man/mustache.5
+++ b/man/mustache.5
@@ -1,7 +1,7 @@
 .\" generated with Ronn/v0.7.3
 .\" http://github.com/rtomayko/ronn/tree/0.7.3
 .
-.TH "MUSTACHE" "5" "October 2014" "DEFUNKT" "Mustache Manual"
+.TH "MUSTACHE" "5" "February 2015" "DEFUNKT" "Mustache Manual"
 .
 .SH "NAME"
 \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
 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\.
 .
 .P
-All variables are HTML escaped by default\. If you want to return unescaped HTML, use the triple mustache: \fB{{{name}}}\fR\.
+All variables are HTML escaped by default\. If you want to return raw contents without escaping, use the triple mustache: \fB{{{name}}}\fR\.
 .
 .P
-You can also use \fB&\fR to unescape a variable: \fB{{& name}}\fR\. This may be useful when changing delimiters (see "Set Delimiter" below)\.
+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)\.
 .
 .P
 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\.
diff --git a/man/mustache.5.html b/man/mustache.5.html
index 951dee3..477daee 100644
--- a/man/mustache.5.html
+++ b/man/mustache.5.html
@@ -125,10 +125,10 @@ there is no <code>name</code> key, the parent contexts will be checked recursive
 If the top context is reached and the <code>name</code> key is still not found,
 nothing will be rendered.</p>
 
-<p>All variables are HTML escaped by default. If you want to return
-unescaped HTML, use the triple mustache: <code>{{{name}}}</code>.</p>
+<p>All variables are HTML escaped by default. If you want to return raw contents
+without escaping, use the triple mustache: <code>{{{name}}}</code>.</p>
 
-<p>You can also use <code>&</code> to unescape a variable: <code>{{& name}}</code>. This may be
+<p>You can also use <code>&</code> to return its raw contents: <code>{{& name}}</code>. This may be
 useful when changing delimiters (see "Set Delimiter" below).</p>
 
 <p>By default a variable "miss" returns an empty string. This can usually
@@ -415,7 +415,7 @@ markup."</p>
 
   <ol class='man-decor man-foot man foot'>
     <li class='tl'>DEFUNKT</li>
-    <li class='tc'>October 2014</li>
+    <li class='tc'>February 2015</li>
     <li class='tr'>mustache(5)</li>
   </ol>
 
diff --git a/man/mustache.5.ron b/man/mustache.5.ron
index 755db9e..17ddeec 100644
--- a/man/mustache.5.ron
+++ b/man/mustache.5.ron
@@ -54,10 +54,10 @@ there is no `name` key, the parent contexts will be checked recursively.
 If the top context is reached and the `name` key is still not found,
 nothing will be rendered.
 
-All variables are HTML escaped by default. If you want to return
-unescaped HTML, use the triple mustache: `{{{name}}}`.
+All variables are HTML escaped by default. If you want to return raw contents
+without escaping, use the triple mustache: `{{{name}}}`.
 
-You can also use `&` to unescape a variable: `{{& name}}`. This may be
+You can also use `&` to return its raw contents: `{{& name}}`. This may be
 useful when changing delimiters (see "Set Delimiter" below).
 
 By default a variable "miss" returns an empty string. This can usually
diff --git a/metadata.yml b/metadata.yml
index e4d71dd..bb4a5a5 100644
--- a/metadata.yml
+++ b/metadata.yml
@@ -1,7 +1,7 @@
 --- !ruby/object:Gem::Specification
 name: mustache
 version: !ruby/object:Gem::Version
-  version: 1.0.1
+  version: 1.0.2
 platform: ruby
 authors:
 - Chris Wanstrath
@@ -11,7 +11,7 @@ authors:
 autorequire: 
 bindir: bin
 cert_chain: []
-date: 2015-02-23 00:00:00.000000000 Z
+date: 2015-06-24 00:00:00.000000000 Z
 dependencies:
 - !ruby/object:Gem::Dependency
   name: bundler
@@ -70,6 +70,20 @@ dependencies:
       - !ruby/object:Gem::Version
         version: '0'
 - !ruby/object:Gem::Dependency
+  name: ruby-prof
+  requirement: !ruby/object:Gem::Requirement
+    requirements:
+    - - ! '>='
+      - !ruby/object:Gem::Version
+        version: '0'
+  type: :development
+  prerelease: false
+  version_requirements: !ruby/object:Gem::Requirement
+    requirements:
+    - - ! '>='
+      - !ruby/object:Gem::Version
+        version: '0'
+- !ruby/object:Gem::Dependency
   name: rdoc
   requirement: !ruby/object:Gem::Requirement
     requirements:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-mustache.git



More information about the Pkg-ruby-extras-commits mailing list