[Pkg-javascript-commits] [mustache.js] 14/31: Imported Upstream version 0.4.2
Martín Ferrari
tincho at debian.org
Sun Nov 13 22:20:13 UTC 2016
This is an automated email from the git hooks/post-receive script.
tincho pushed a commit to branch master
in repository mustache.js.
commit d2407f30a09deaaff00694ff1cceba4c0c72185c
Author: David Paleino <dapal at debian.org>
Date: Thu Mar 1 09:08:18 2012 +0100
Imported Upstream version 0.4.2
---
.gitignore | 2 ++
CHANGES.md | 49 ----------------------------
Rakefile | 8 +++++
TESTING.md | 13 ++++++++
mustache.js | 6 ++--
mustache.js.nuspec | 14 ++++++++
mustache.min.js | 6 ++++
spec/_files/escaped.js | 1 +
spec/_files/escaped.mustache | 1 +
spec/_files/escaped.txt | 1 +
wrappers/qooxdoo/qooxdoo.mustache.js.tpl.pre | 2 +-
11 files changed, 50 insertions(+), 53 deletions(-)
diff --git a/.gitignore b/.gitignore
index c44d96c..65128cd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,5 @@
+# ignore temp vim files
+*.swp
.DS_Store
.rvmrc
runner.js
diff --git a/CHANGES.md b/CHANGES.md
deleted file mode 100644
index 40d50b8..0000000
--- a/CHANGES.md
+++ /dev/null
@@ -1,49 +0,0 @@
-# mustache.js Changes
-
-## 0.3.1-dev-twitter-b (8/23/2011)
-
-* Cached regexes for improved performance
-
-## 0.3.1-dev-twitter (12/3/2010)
-
-* fixed double-rendering bug
-* added Rhino test-runner alongside JavaScriptCore
-
-## 0.3.1 (??-??-????)
-
-## 0.3.0 (21-07-2010)
-
-* Improved whitespace handling.
-* Make IMPLICIT ITERATORS a first class feature.
-* Fix Rhino compat.
-* CommonJS packaging is no longer a special case.
-* DRY Rakefile.
-* Allow whitespace around tag names.
-* Fix partial scope.
-* Fix Comments.
-* Added inverted sections.
-* Avoid double encoding of entities.
-* Use sections to dereference subcontexts.
-* Added higher order sections.
-
-
-## 0.2.3 (28-03-2010)
-
-* Better error message for missing partials.
-* Added more robust type detection.
-* Parse pragmas only once.
-* Throw exception when encountering an unknown pragma.
-* Ignore undefined partial contexts. Returns verbatim partials.
-* Added yui3 packaging.
-
-
-## 0.2.2 (11-02-2010)
-
-* ctemplate compat: Partials are indicated by >, not <.
-* Add support for {{%PRAGMA}} to enable features.
-* Made array of strings an option. Enable with `{{%JSTACHE-ENABLE-STRING-ARRAYS}}`.
-* mustache compat: Don't barf on unknown variables.
-* Add `rake dojo` target to create a dojo package.
-* Add streaming api.
-* Rename JSTACHE-ENABLE-STRING-ARRAYS to IMPLICIT-ITERATOR.
-* Add support for pragma options.
diff --git a/Rakefile b/Rakefile
index 16bc724..f546b74 100644
--- a/Rakefile
+++ b/Rakefile
@@ -52,3 +52,11 @@ templated_build "Dojo", :location => "dojox/string"
templated_build "YUI3", :location => "yui3/mustache"
templated_build "RequireJS"
templated_build "qooxdoo"
+
+task :minify do
+ # npm install uglify-js
+ mmjs = "mustache.min.js"
+ `echo "/*! Version: 0.4.2 */" > #{mmjs}`
+ `uglifyjs mustache.js >> #{mmjs}`
+ puts "Created #{mmjs}"
+end
diff --git a/TESTING.md b/TESTING.md
index 6abec93..0be439b 100644
--- a/TESTING.md
+++ b/TESTING.md
@@ -1,5 +1,7 @@
## Running the mustache.js Test Suite
+Notice: the tests are only expected to run on unixoid systems.
+
The mustache.js test suite uses the [RSpec](http://rspec.info/) testing
framework. In order to run the tests you'll need to install [Ruby](http://ruby-lang.org/)
as well as the `rake`, `rspec` (>=2), and `json` [RubyGems](http://rubygems.org/).
@@ -34,6 +36,17 @@ Install the required gems:
That's it!
+### How to install node.js from source
+
+ $ git clone https://github.com/joyent/node.git
+ $ cd node
+ $ # select the version to install, master is unstable;
+ $ # latest stable version is advertised on http://nodejs.org
+ $ git checkout v0.6.11
+ $ ./configure
+ $ make
+ $ sudo make install
+
### How to run the tests
The mustache.js test suite currently uses 4 different JavaScript runtime engines
diff --git a/mustache.js b/mustache.js
index 91ec828..4ac3fae 100644
--- a/mustache.js
+++ b/mustache.js
@@ -44,7 +44,7 @@ var Mustache = function () {
};
function escapeHTML(string) {
- return String(string).replace(/&(?!\w+;)|[<>"']/g, function (s) {
+ return String(string).replace(/&(?!#?\w+;)|[<>"']/g, function (s) {
return escapeMap[s] || s;
});
}
@@ -176,7 +176,7 @@ var Mustache = function () {
"^([\\s\\S]*?)" + // all the crap at the beginning that is not {{*}} ($1)
otag + // {{
- "(\\^|\\#)\\s*(.+)\\s*" + // #foo (# == $2, foo == $3)
+ "(\\^|\\#)\\s*(.+?)\\s*" +// #foo (# == $2, foo == $3), not greedy
ctag + // }}
"\n*([\\s\\S]*?)" + // between the tag ($2). leading newlines are dropped
@@ -417,7 +417,7 @@ var Mustache = function () {
return({
name: "mustache.js",
- version: "0.4.0",
+ version: "0.4.2",
/*
Turns a template and view into HTML
diff --git a/mustache.js.nuspec b/mustache.js.nuspec
new file mode 100644
index 0000000..5ca1bb5
--- /dev/null
+++ b/mustache.js.nuspec
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<package >
+ <metadata>
+ <id>mustache.js</id>
+ <version>0.4.2</version>
+ <authors>mustache.js Authors</authors>
+ <licenseUrl>https://github.com/janl/mustache.js/blob/master/LICENSE</licenseUrl>
+ <projectUrl>http://mustache.github.com/</projectUrl>
+ <requireLicenseAcceptance>false</requireLicenseAcceptance>
+ <description>Logic-less templates in JavaScript.</description>
+ <releaseNotes></releaseNotes>
+ <tags>mustache template templates javascript</tags>
+ </metadata>
+</package>
\ No newline at end of file
diff --git a/mustache.min.js b/mustache.min.js
new file mode 100644
index 0000000..8014bcf
--- /dev/null
+++ b/mustache.min.js
@@ -0,0 +1,6 @@
+/*! Version: 0.4.2 */
+/*
+ mustache.js — Logic-less templates in JavaScript
+
+ See http://mustache.github.com/ for more info.
+*/var Mustache=function(){function g(a){return String(a).replace(/&(?!#?\w+;)|[<>"']/g,function(a){return f[a]||a})}var a=Object.prototype.toString;Array.isArray=Array.isArray||function(b){return a.call(b)=="[object Array]"};var b=String.prototype.trim,c;if(b)c=function(a){return a==null?"":b.call(a)};else{var d,e;/\S/.test(" ")?(d=/^[\s\xA0]+/,e=/[\s\xA0]+$/):(d=/^\s+/,e=/\s+$/),c=function(a){return a==null?"":a.toString().replace(d,"").replace(e,"")}}var f={"&":"&","<":"<",">":" [...]
\ No newline at end of file
diff --git a/spec/_files/escaped.js b/spec/_files/escaped.js
index 7a8baef..875776a 100644
--- a/spec/_files/escaped.js
+++ b/spec/_files/escaped.js
@@ -2,5 +2,6 @@ var escaped = {
title: function() {
return "Bear > Shark";
},
+ subtitle: 'Rock 'n Roll',
entities: """
};
diff --git a/spec/_files/escaped.mustache b/spec/_files/escaped.mustache
index ea25951..b8f82d0 100644
--- a/spec/_files/escaped.mustache
+++ b/spec/_files/escaped.mustache
@@ -1,2 +1,3 @@
<h1>{{title}}</h1>
+<h2>{{subtitle}}</h2>
But not {{entities}}.
diff --git a/spec/_files/escaped.txt b/spec/_files/escaped.txt
index 73ac5ce..7f750d4 100644
--- a/spec/_files/escaped.txt
+++ b/spec/_files/escaped.txt
@@ -1,2 +1,3 @@
<h1>Bear > Shark</h1>
+<h2>Rock 'n Roll</h2>
But not ".
diff --git a/wrappers/qooxdoo/qooxdoo.mustache.js.tpl.pre b/wrappers/qooxdoo/qooxdoo.mustache.js.tpl.pre
index a70d0a4..f7d1014 100644
--- a/wrappers/qooxdoo/qooxdoo.mustache.js.tpl.pre
+++ b/wrappers/qooxdoo/qooxdoo.mustache.js.tpl.pre
@@ -19,7 +19,7 @@
This class contains code based on the following work:
- * Mustache.js version 0.4.0-dev
+ * Mustache.js version 0.4.2
Code:
https://github.com/janl/mustache.js
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/mustache.js.git
More information about the Pkg-javascript-commits
mailing list