diff --git a/admin/admin.db b/admin/admin.db index b4769e8..b69dfeb 100644 Binary files a/admin/admin.db and b/admin/admin.db differ diff --git a/pacotes/mustache.js-master/.gitignore b/pacotes/mustache.js-master/.gitignore new file mode 100644 index 0000000..a4c0df6 --- /dev/null +++ b/pacotes/mustache.js-master/.gitignore @@ -0,0 +1,7 @@ +node_modules +jquery.mustache.js +mootools.mustache.js +dojox +yui3 +qooxdoo.mustache.js + diff --git a/pacotes/mustache.js-master/.gitmodules b/pacotes/mustache.js-master/.gitmodules new file mode 100644 index 0000000..9e2fdf8 --- /dev/null +++ b/pacotes/mustache.js-master/.gitmodules @@ -0,0 +1,3 @@ +[submodule "test/spec"] + path = test/spec + url = https://github.com/mustache/spec diff --git a/pacotes/mustache.js-master/.jshintrc b/pacotes/mustache.js-master/.jshintrc new file mode 100644 index 0000000..28dff71 --- /dev/null +++ b/pacotes/mustache.js-master/.jshintrc @@ -0,0 +1,5 @@ +{ + "eqnull": true, + "evil": true +} + diff --git a/pacotes/mustache.js-master/.npmignore b/pacotes/mustache.js-master/.npmignore new file mode 100644 index 0000000..76e579a --- /dev/null +++ b/pacotes/mustache.js-master/.npmignore @@ -0,0 +1,2 @@ +test + diff --git a/pacotes/mustache.js-master/.travis.yml b/pacotes/mustache.js-master/.travis.yml new file mode 100644 index 0000000..3d839b0 --- /dev/null +++ b/pacotes/mustache.js-master/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.6 + diff --git a/pacotes/mustache.js-master/CHANGES b/pacotes/mustache.js-master/CHANGES new file mode 100644 index 0000000..dfdec93 --- /dev/null +++ b/pacotes/mustache.js-master/CHANGES @@ -0,0 +1,60 @@ += 0.8.2 / 17 Mar 2014 + + * Supporting Bower through a bower.json file. + += 0.8.1 / 3 Jan 2014 + + * Fix usage of partial templates. + += 0.8.0 / 2 Dec 2013 + + * Remove compile* writer functions, use mustache.parse instead. Smaller API. + * Throw an error when rendering a template that contains higher-order sections and + the original template is not provided. + * Remove low-level Context.make function. + * Better code readability and inline documentation. + * Stop caching templates by name. + += 0.7.3 / 5 Nov 2013 + + * Don't require the original template to be passed to the rendering function + when using compiled templates. This is still required when using higher-order + functions in order to be able to extract the portion of the template + that was contained by that section. Fixes #262. + * Performance improvements. + += 0.7.2 / 27 Dec 2012 + + * Fixed a rendering bug (#274) when using nested higher-order sections. + * Better error reporting on failed parse. + * Converted tests to use mocha instead of vows. + += 0.7.1 / 6 Dec 2012 + + * Handle empty templates gracefully. Fixes #265, #267, and #270. + * Cache partials by template, not by name. Fixes #257. + * Added Mustache.compileTokens to compile the output of Mustache.parse. Fixes + #258. + += 0.7.0 / 10 Sep 2012 + + * Rename Renderer => Writer. + * Allow partials to be loaded dynamically using a callback (thanks + @TiddoLangerak for the suggestion). + * Fixed a bug with higher-order sections that prevented them from being + passed the raw text of the section from the original template. + * More concise token format. Tokens also include start/end indices in the + original template. + * High-level API is consistent with the Writer API. + * Allow partials to be passed to the pre-compiled function (thanks + @fallenice). + * Don't use eval (thanks @cweider). + += 0.6.0 / 31 Aug 2012 + + * Use JavaScript's definition of falsy when determining whether to render an + inverted section or not. Issue #186. + * Use Mustache.escape to escape values inside {{}}. This function may be + reassigned to alter the default escaping behavior. Issue #244. + * Fixed a bug that clashed with QUnit (thanks @kannix). + * Added volo support (thanks @guybedford). diff --git a/pacotes/mustache.js-master/LICENSE b/pacotes/mustache.js-master/LICENSE new file mode 100644 index 0000000..aa1b831 --- /dev/null +++ b/pacotes/mustache.js-master/LICENSE @@ -0,0 +1,10 @@ +The MIT License + +Copyright (c) 2009 Chris Wanstrath (Ruby) +Copyright (c) 2010-2014 Jan Lehnardt (JavaScript) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/pacotes/mustache.js-master/README.md b/pacotes/mustache.js-master/README.md new file mode 100644 index 0000000..ab01e09 --- /dev/null +++ b/pacotes/mustache.js-master/README.md @@ -0,0 +1,495 @@ +# mustache.js - Logic-less {{mustache}} templates with JavaScript + +> What could be more logical awesome than no logic at all? + +[mustache.js](http://github.com/janl/mustache.js) is an implementation of the [mustache](http://mustache.github.com/) template system in JavaScript. + +[Mustache](http://mustache.github.com/) is a logic-less template syntax. It can be used for HTML, config files, source code - anything. It works by expanding tags in a template using values provided in a hash or object. + +We call it "logic-less" because there are no if statements, else clauses, or for loops. Instead there are only tags. Some tags are replaced with a value, some nothing, and others a series of values. + +For a language-agnostic overview of mustache's template syntax, see the `mustache(5)` [manpage](http://mustache.github.com/mustache.5.html). + +## Where to use mustache.js? + +You can use mustache.js to render mustache templates anywhere you can use JavaScript. This includes web browsers, server-side environments such as [node](http://nodejs.org/), and [CouchDB](http://couchdb.apache.org/) views. + +mustache.js ships with support for both the [CommonJS](http://www.commonjs.org/) module API and the [Asynchronous Module Definition](https://github.com/amdjs/amdjs-api/wiki/AMD) API, or AMD. + +## Who uses mustache.js? + +An updated list of mustache.js users is kept [on the Github wiki](http://wiki.github.com/janl/mustache.js/beard-competition). Add yourself or your company if you use mustache.js! + +## Usage + +Below is quick example how to use mustache.js: + +```js +var view = { + title: "Joe", + calc: function () { + return 2 + 4; + } +}; + +var output = Mustache.render("{{title}} spends {{calc}}", view); +``` + +In this example, the `Mustache.render` function takes two parameters: 1) the [mustache](http://mustache.github.com/) template and 2) a `view` object that contains the data and code needed to render the template. + +## Templates + +A [mustache](http://mustache.github.com/) template is a string that contains any number of mustache tags. Tags are indicated by the double mustaches that surround them. `{{person}}` is a tag, as is `{{#person}}`. In both examples we refer to `person` as the tag's key. There are several types of tags available in mustache.js, described below. + +There are several techniques that can be used to load templates and hand them to mustache.js, here are two of them: + +#### Include Templates + +If you need a template for a dynamic part in a static website, you can consider including the template in the static HTML file to avoid loading templates separately. Here's a small example using `jQuery`: + +```html + + +
Loading...
+ + + +``` + +```js +function loadUser() { + var template = $('#template').html(); + Mustache.parse(template); // optional, speeds up future uses + var rendered = Mustache.render(template, {name: "Luke"}); + $('#target').html(rendered); +} +``` + +#### Load External Templates + +If your templates reside in individual files, you can load them asynchronously and render them when they arrive. Another example using `jQuery`: + +```js +function loadUser() { + $.get('template.mst', function(template) { + var rendered = Mustache.render(template, {name: "Luke"}); + $('#target').html(rendered); + }); +} +``` + +### Variables + +The most basic tag type is a simple variable. A `{{name}}` tag renders the value of the `name` key in the current context. If there is no such key, nothing is rendered. + +All variables are HTML-escaped by default. If you want to render unescaped HTML, use the triple mustache: `{{{name}}}`. You can also use `&` to unescape a variable. + +View: + +```json +{ + "name": "Chris", + "company": "GitHub" +} +``` + +Template: + +```html +* {{name}} +* {{age}} +* {{company}} +* {{{company}}} +* {{&company}} +``` + +Output: + +```html +* Chris +* +* <b>GitHub</b> +* GitHub +* GitHub +``` + +JavaScript's dot notation may be used to access keys that are properties of objects in a view. + +View: + +```json +{ + "name": { + "first": "Michael", + "last": "Jackson" + }, + "age": "RIP" +} +``` + +Template: + +```html +* {{name.first}} {{name.last}} +* {{age}} +``` + +Output: + +```html +* Michael Jackson +* RIP +``` + +### Sections + +Sections render blocks of text one or more times, depending on the value of the key in the current context. + +A section begins with a pound and ends with a slash. That is, `{{#person}}` begins a `person` section, while `{{/person}}` ends it. The text between the two tags is referred to as that section's "block". + +The behavior of the section is determined by the value of the key. + +#### False Values or Empty Lists + +If the `person` key does not exist, or exists and has a value of `null`, `undefined`, `false`, `0`, or `NaN`, or is an empty string or an empty list, the block will not be rendered. + +View: + +```json +{ + "person": false +} +``` + +Template: + +```html +Shown. +{{#person}} +Never shown! +{{/person}} +``` + +Output: + +```html +Shown. +``` + +#### Non-Empty Lists + +If the `person` key exists and is not `null`, `undefined`, or `false`, and is not an empty list the block will be rendered one or more times. + +When the value is a list, the block is rendered once for each item in the list. The context of the block is set to the current item in the list for each iteration. In this way we can loop over collections. + +View: + +```json +{ + "stooges": [ + { "name": "Moe" }, + { "name": "Larry" }, + { "name": "Curly" } + ] +} +``` + +Template: + +```html +{{#stooges}} +{{name}} +{{/stooges}} +``` + +Output: + +```html +Moe +Larry +Curly +``` + +When looping over an array of strings, a `.` can be used to refer to the current item in the list. + +View: + +```json +{ + "musketeers": ["Athos", "Aramis", "Porthos", "D'Artagnan"] +} +``` + +Template: + +```html +{{#musketeers}} +* {{.}} +{{/musketeers}} +``` + +Output: + +```html +* Athos +* Aramis +* Porthos +* D'Artagnan +``` + +If the value of a section variable is a function, it will be called in the context of the current item in the list on each iteration. + +View: + +```js +{ + "beatles": [ + { "firstName": "John", "lastName": "Lennon" }, + { "firstName": "Paul", "lastName": "McCartney" }, + { "firstName": "George", "lastName": "Harrison" }, + { "firstName": "Ringo", "lastName": "Starr" } + ], + "name": function () { + return this.firstName + " " + this.lastName; + } +} +``` + +Template: + +```html +{{#beatles}} +* {{name}} +{{/beatles}} +``` + +Output: + +```html +* John Lennon +* Paul McCartney +* George Harrison +* Ringo Starr +``` + +#### Functions + +If the value of a section key is a function, it is called with the section's literal block of text, un-rendered, as its first argument. The second argument is a special rendering function that uses the current view as its view argument. It is called in the context of the current view object. + +View: + +```js +{ + "name": "Tater", + "bold": function () { + return function (text, render) { + return "" + render(text) + ""; + } + } +} +``` + +Template: + +```html +{{#bold}}Hi {{name}}.{{/bold}} +``` + +Output: + +```html +Hi Tater. +``` + +### Inverted Sections + +An inverted section opens with `{{^section}}` instead of `{{#section}}`. The block of an inverted section is rendered only if the value of that section's tag is `null`, `undefined`, `false`, or an empty list. + +View: + +```json +{ + "repos": [] +} +``` + +Template: + +```html +{{#repos}}{{name}}{{/repos}} +{{^repos}}No repos :({{/repos}} +``` + +Output: + +```html +No repos :( +``` + +### Comments + +Comments begin with a bang and are ignored. The following template: + +```html +

Today{{! ignore me }}.

+``` + +Will render as follows: + +```html +

Today.

+``` + +Comments may contain newlines. + +### Partials + +Partials begin with a greater than sign, like {{> box}}. + +Partials are rendered at runtime (as opposed to compile time), so recursive partials are possible. Just avoid infinite loops. + +They also inherit the calling context. Whereas in ERB you may have this: + +```html+erb +<%= partial :next_more, :start => start, :size => size %> +``` + +Mustache requires only this: + +```html +{{> next_more}} +``` + +Why? Because the `next_more.mustache` file will inherit the `size` and `start` variables from the calling context. In this way you may want to think of partials as includes, or template expansion, even though it's not literally true. + +For example, this template and partial: + + base.mustache: +

Names

+ {{#names}} + {{> user}} + {{/names}} + + user.mustache: + {{name}} + +Can be thought of as a single, expanded template: + +```html +

Names

+{{#names}} + {{name}} +{{/names}} +``` + +In mustache.js an object of partials may be passed as the third argument to `Mustache.render`. The object should be keyed by the name of the partial, and its value should be the partial text. + +```js +Mustache.render(template, view, { + user: userTemplate +}); +``` + +### Set Delimiter + +Set Delimiter tags start with an equals sign and change the tag delimiters from `{{` and `}}` to custom strings. + +Consider the following contrived example: + +``` +* {{ default_tags }} +{{=<% %>=}} +* <% erb_style_tags %> +<%={{ }}=%> +* {{ default_tags_again }} +``` + +Here we have a list with three items. The first item uses the default tag style, the second uses ERB style as defined by the Set Delimiter tag, and the third returns to the default style after yet another Set Delimiter declaration. + +According to [ctemplates](http://google-ctemplate.googlecode.com/svn/trunk/doc/howto.html), this "is useful for languages like TeX, where double-braces may occur in the text and are awkward to use for markup." + +Custom delimiters may not contain whitespace or the equals sign. + +## Pre-parsing and Caching Templates + +By default, when mustache.js first parses a template it keeps the full parsed token tree in a cache. The next time it sees that same template it skips the parsing step and renders the template much more quickly. If you'd like, you can do this ahead of time using `mustache.parse`. + +```js +Mustache.parse(template); + +// Then, sometime later. +Mustache.render(template, view); +``` + +## Plugins for JavaScript Libraries + +mustache.js may be built specifically for several different client libraries, including the following: + + - [jQuery](http://jquery.com/) + - [MooTools](http://mootools.net/) + - [Dojo](http://www.dojotoolkit.org/) + - [YUI](http://developer.yahoo.com/yui/) + - [qooxdoo](http://qooxdoo.org/) + +These may be built using [Rake](http://rake.rubyforge.org/) and one of the following commands: + + $ rake jquery + $ rake mootools + $ rake dojo + $ rake yui3 + $ rake qooxdoo + +## Testing + +The mustache.js test suite uses the [mocha](http://visionmedia.github.com/mocha/) testing framework. In order to run the tests you'll need to install [node](http://nodejs.org/). Once that's done you can install mocha using [npm](http://npmjs.org/). + + $ npm install -g mocha + +You also need to install the sub module containing [Mustache specifications](http://github.com/mustache/spec) in the project root. + + $ git submodule init + $ git submodule update + +Then run the tests. + + $ mocha test + +The test suite consists of both unit and integration tests. If a template isn't rendering correctly for you, you can make a test for it by doing the following: + + 1. Create a template file named `mytest.mustache` in the `test/_files` + directory. Replace `mytest` with the name of your test. + 2. Create a corresponding view file named `mytest.js` in the same directory. + This file should contain a JavaScript object literal enclosed in + parentheses. See any of the other view files for an example. + 3. Create a file with the expected output in `mytest.txt` in the same + directory. + +Then, you can run the test with: + + $ TEST=mytest mocha test/render-test.js + +## Thanks + +mustache.js wouldn't kick ass if it weren't for these fine souls: + + * Chris Wanstrath / defunkt + * Alexander Lang / langalex + * Sebastian Cohnen / tisba + * J Chris Anderson / jchris + * Tom Robinson / tlrobinson + * Aaron Quint / quirkey + * Douglas Crockford + * Nikita Vasilyev / NV + * Elise Wood / glytch + * Damien Mathieu / dmathieu + * Jakub Kuźma / qoobaa + * Will Leinweber / will + * dpree + * Jason Smith / jhs + * Aaron Gibralter / agibralter + * Ross Boucher / boucher + * Matt Sanford / mzsanford + * Ben Cherry / bcherry + * Michael Jackson / mjijackson diff --git a/pacotes/mustache.js-master/Rakefile b/pacotes/mustache.js-master/Rakefile new file mode 100644 index 0000000..c019087 --- /dev/null +++ b/pacotes/mustache.js-master/Rakefile @@ -0,0 +1,69 @@ +require 'rake' +require 'rake/clean' + +task :default => :test + +def minified_file + ENV['FILE'] || 'mustache.min.js' +end + +task :install_mocha do + sh "npm install -g mocha" if `which mocha`.empty? +end + +task :install_uglify do + sh "npm install -g uglify-js" if `which uglifyjs`.empty? +end + +task :install_jshint do + sh "npm install -g jshint" if `which jshint`.empty? +end + +desc "Run all tests" +task :test => :install_mocha do + sh "mocha test" +end + +desc "Make a compressed build in #{minified_file}" +task :minify => :install_uglify do + sh "uglifyjs mustache.js > #{minified_file}" +end + +desc "Run JSHint" +task :hint => :install_jshint do + sh "jshint mustache.js" +end + +# Creates a task that uses the various template wrappers to make a wrapped +# output file. There is some extra complexity because Dojo and YUI use +# different final locations. +def templated_build(name, final_location=nil) + short = name.downcase + source = File.join("wrappers", short) + dependencies = ["mustache.js"] + Dir.glob("#{source}/*.tpl.*") + target_js = final_location.nil? ? "#{short}.mustache.js" : "mustache.js" + + desc "Package for #{name}" + task short.to_sym => dependencies do + puts "Packaging for #{name}" + + mkdir_p final_location unless final_location.nil? + + sources = [ "#{source}/mustache.js.pre", 'mustache.js', "#{source}/mustache.js.post" ] + relative_name = "#{final_location || '.'}/#{target_js}" + + open(relative_name, 'w') do |f| + sources.each {|source| f << File.read(source) } + end + + puts "Done, see #{relative_name}" + end + + CLEAN.include(final_location.nil? ? target_js : final_location) +end + +templated_build "jQuery" +templated_build "MooTools" +templated_build "Dojo", "dojox/string" +templated_build "YUI3", "yui3/mustache" +templated_build "qooxdoo" diff --git a/pacotes/mustache.js-master/bower.json b/pacotes/mustache.js-master/bower.json new file mode 100644 index 0000000..e8c9b11 --- /dev/null +++ b/pacotes/mustache.js-master/bower.json @@ -0,0 +1,21 @@ +{ + "name": "mustache.js", + "main": "mustache.js", + "version": "0.8.2", + "homepage": "https://github.com/janl/mustache.js", + "authors": [ + "mustache.js Authors " + ], + "description": "Logic-less {{mustache}} templates with JavaScript", + "keywords": ["mustache", "template", "templates", "ejs"], + "moduleType": [ + "amd", + "globals", + "node" + ], + "license": "MIT", + "ignore": [ + "**/.*", + "test" + ] +} diff --git a/pacotes/mustache.js-master/mustache.js b/pacotes/mustache.js-master/mustache.js new file mode 100644 index 0000000..be3d01a --- /dev/null +++ b/pacotes/mustache.js-master/mustache.js @@ -0,0 +1,578 @@ +/*! + * mustache.js - Logic-less {{mustache}} templates with JavaScript + * http://github.com/janl/mustache.js + */ + +/*global define: false*/ + +(function (global, factory) { + if (typeof exports === "object" && exports) { + factory(exports); // CommonJS + } else if (typeof define === "function" && define.amd) { + define(['exports'], factory); // AMD + } else { + factory(global.Mustache = {}); // diff --git a/pacotes/mustache.js-master/test/_files/backslashes.txt b/pacotes/mustache.js-master/test/_files/backslashes.txt new file mode 100644 index 0000000..038dd37 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/backslashes.txt @@ -0,0 +1,7 @@ +* \abc +* \abc +* \abc + diff --git a/pacotes/mustache.js-master/test/_files/bug_11_eating_whitespace.js b/pacotes/mustache.js-master/test/_files/bug_11_eating_whitespace.js new file mode 100644 index 0000000..e41ccd1 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/bug_11_eating_whitespace.js @@ -0,0 +1,3 @@ +({ + tag: "yo" +}) diff --git a/pacotes/mustache.js-master/test/_files/bug_11_eating_whitespace.mustache b/pacotes/mustache.js-master/test/_files/bug_11_eating_whitespace.mustache new file mode 100644 index 0000000..8d5cd92 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/bug_11_eating_whitespace.mustache @@ -0,0 +1 @@ +{{tag}} foo diff --git a/pacotes/mustache.js-master/test/_files/bug_11_eating_whitespace.txt b/pacotes/mustache.js-master/test/_files/bug_11_eating_whitespace.txt new file mode 100644 index 0000000..f5bbc85 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/bug_11_eating_whitespace.txt @@ -0,0 +1 @@ +yo foo diff --git a/pacotes/mustache.js-master/test/_files/changing_delimiters.js b/pacotes/mustache.js-master/test/_files/changing_delimiters.js new file mode 100644 index 0000000..b808f4c --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/changing_delimiters.js @@ -0,0 +1,4 @@ +({ + "foo": "foooooooooooooo", + "bar": "bar!" +}) diff --git a/pacotes/mustache.js-master/test/_files/changing_delimiters.mustache b/pacotes/mustache.js-master/test/_files/changing_delimiters.mustache new file mode 100644 index 0000000..0cd044c --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/changing_delimiters.mustache @@ -0,0 +1 @@ +{{=<% %>=}}<% foo %> {{foo}} <%{bar}%> {{{bar}}} diff --git a/pacotes/mustache.js-master/test/_files/changing_delimiters.txt b/pacotes/mustache.js-master/test/_files/changing_delimiters.txt new file mode 100644 index 0000000..1b1510d --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/changing_delimiters.txt @@ -0,0 +1 @@ +foooooooooooooo {{foo}} bar! {{{bar}}} diff --git a/pacotes/mustache.js-master/test/_files/check_falsy.js b/pacotes/mustache.js-master/test/_files/check_falsy.js new file mode 100644 index 0000000..5a599ca --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/check_falsy.js @@ -0,0 +1,7 @@ +({ + number: function(text, render) { + return function(text, render) { + return +render(text); + } + } +}) diff --git a/pacotes/mustache.js-master/test/_files/check_falsy.mustache b/pacotes/mustache.js-master/test/_files/check_falsy.mustache new file mode 100644 index 0000000..30e2547 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/check_falsy.mustache @@ -0,0 +1 @@ +

{{#number}}0{{/number}}

diff --git a/pacotes/mustache.js-master/test/_files/check_falsy.txt b/pacotes/mustache.js-master/test/_files/check_falsy.txt new file mode 100644 index 0000000..3bb2f51 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/check_falsy.txt @@ -0,0 +1 @@ +

0

diff --git a/pacotes/mustache.js-master/test/_files/comments.js b/pacotes/mustache.js-master/test/_files/comments.js new file mode 100644 index 0000000..f20b8b1 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/comments.js @@ -0,0 +1,5 @@ +({ + title: function () { + return "A Comedy of Errors"; + } +}) diff --git a/pacotes/mustache.js-master/test/_files/comments.mustache b/pacotes/mustache.js-master/test/_files/comments.mustache new file mode 100644 index 0000000..5036801 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/comments.mustache @@ -0,0 +1 @@ +

{{title}}{{! just something interesting... or not... }}

diff --git a/pacotes/mustache.js-master/test/_files/comments.txt b/pacotes/mustache.js-master/test/_files/comments.txt new file mode 100644 index 0000000..0133517 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/comments.txt @@ -0,0 +1 @@ +

A Comedy of Errors

diff --git a/pacotes/mustache.js-master/test/_files/complex.js b/pacotes/mustache.js-master/test/_files/complex.js new file mode 100644 index 0000000..68a4809 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/complex.js @@ -0,0 +1,19 @@ +({ + header: function () { + return "Colors"; + }, + item: [ + {name: "red", current: true, url: "#Red"}, + {name: "green", current: false, url: "#Green"}, + {name: "blue", current: false, url: "#Blue"} + ], + link: function () { + return this["current"] !== true; + }, + list: function () { + return this.item.length !== 0; + }, + empty: function () { + return this.item.length === 0; + } +}) diff --git a/pacotes/mustache.js-master/test/_files/complex.mustache b/pacotes/mustache.js-master/test/_files/complex.mustache new file mode 100644 index 0000000..869a4f0 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/complex.mustache @@ -0,0 +1,16 @@ +

{{header}}

+{{#list}} + +{{/list}} +{{#empty}} +

The list is empty.

+{{/empty}} diff --git a/pacotes/mustache.js-master/test/_files/complex.txt b/pacotes/mustache.js-master/test/_files/complex.txt new file mode 100644 index 0000000..596d3f6 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/complex.txt @@ -0,0 +1,6 @@ +

Colors

+ diff --git a/pacotes/mustache.js-master/test/_files/context_lookup.js b/pacotes/mustache.js-master/test/_files/context_lookup.js new file mode 100644 index 0000000..8ce6299 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/context_lookup.js @@ -0,0 +1,8 @@ +({ + "outer": { + "id": 1, + "second": { + "nothing": 2 + } + } +}) diff --git a/pacotes/mustache.js-master/test/_files/context_lookup.mustache b/pacotes/mustache.js-master/test/_files/context_lookup.mustache new file mode 100644 index 0000000..3c7b767 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/context_lookup.mustache @@ -0,0 +1 @@ +{{#outer}}{{#second}}{{id}}{{/second}}{{/outer}} diff --git a/pacotes/mustache.js-master/test/_files/context_lookup.txt b/pacotes/mustache.js-master/test/_files/context_lookup.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/context_lookup.txt @@ -0,0 +1 @@ +1 diff --git a/pacotes/mustache.js-master/test/_files/delimiters.js b/pacotes/mustache.js-master/test/_files/delimiters.js new file mode 100644 index 0000000..365d01e --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/delimiters.js @@ -0,0 +1,6 @@ +({ + first: "It worked the first time.", + second: "And it worked the second time.", + third: "Then, surprisingly, it worked the third time.", + fourth: "Fourth time also fine!." +}) diff --git a/pacotes/mustache.js-master/test/_files/delimiters.mustache b/pacotes/mustache.js-master/test/_files/delimiters.mustache new file mode 100644 index 0000000..7fac846 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/delimiters.mustache @@ -0,0 +1,7 @@ +{{=<% %>=}}* +<% first %> +* <% second %> +<%=| |=%> +* | third | +|={{ }}=| +* {{ fourth }} diff --git a/pacotes/mustache.js-master/test/_files/delimiters.txt b/pacotes/mustache.js-master/test/_files/delimiters.txt new file mode 100644 index 0000000..698a6bb --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/delimiters.txt @@ -0,0 +1,5 @@ +* +It worked the first time. +* And it worked the second time. +* Then, surprisingly, it worked the third time. +* Fourth time also fine!. diff --git a/pacotes/mustache.js-master/test/_files/disappearing_whitespace.js b/pacotes/mustache.js-master/test/_files/disappearing_whitespace.js new file mode 100644 index 0000000..973dd1c --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/disappearing_whitespace.js @@ -0,0 +1,4 @@ +({ + bedrooms: true, + total: 1 +}) diff --git a/pacotes/mustache.js-master/test/_files/disappearing_whitespace.mustache b/pacotes/mustache.js-master/test/_files/disappearing_whitespace.mustache new file mode 100644 index 0000000..16c16e0 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/disappearing_whitespace.mustache @@ -0,0 +1 @@ +{{#bedrooms}}{{total}}{{/bedrooms}} BED diff --git a/pacotes/mustache.js-master/test/_files/disappearing_whitespace.txt b/pacotes/mustache.js-master/test/_files/disappearing_whitespace.txt new file mode 100644 index 0000000..66e98ef --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/disappearing_whitespace.txt @@ -0,0 +1 @@ +1 BED diff --git a/pacotes/mustache.js-master/test/_files/dot_notation.js b/pacotes/mustache.js-master/test/_files/dot_notation.js new file mode 100644 index 0000000..de06a03 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/dot_notation.js @@ -0,0 +1,23 @@ +({ + name: "A Book", + authors: ["John Power", "Jamie Walsh"], + price: { + value: 200, + vat: function () { + return this.value * 0.2; + }, + currency: { + symbol: '$', + name: 'USD' + } + }, + availability: { + status: true, + text: "In Stock" + }, + // And now, some truthy false values + truthy: { + zero: 0, + notTrue: false + } +}) diff --git a/pacotes/mustache.js-master/test/_files/dot_notation.mustache b/pacotes/mustache.js-master/test/_files/dot_notation.mustache new file mode 100644 index 0000000..f89d70b --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/dot_notation.mustache @@ -0,0 +1,9 @@ + +

{{name}}

+

Authors:

+

Price: {{{price.currency.symbol}}}{{price.value}} {{#price.currency}}{{name}} {{availability.text}}{{/price.currency}}

+

VAT: {{{price.currency.symbol}}}{{#price}}{{vat}}{{/price}}

+ +

Test truthy false values:

+

Zero: {{truthy.zero}}

+

False: {{truthy.notTrue}}

diff --git a/pacotes/mustache.js-master/test/_files/dot_notation.txt b/pacotes/mustache.js-master/test/_files/dot_notation.txt new file mode 100644 index 0000000..08afa05 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/dot_notation.txt @@ -0,0 +1,9 @@ + +

A Book

+

Authors:

+

Price: $200 USD In Stock

+

VAT: $40

+ +

Test truthy false values:

+

Zero: 0

+

False: false

diff --git a/pacotes/mustache.js-master/test/_files/double_render.js b/pacotes/mustache.js-master/test/_files/double_render.js new file mode 100644 index 0000000..28acb2c --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/double_render.js @@ -0,0 +1,5 @@ +({ + foo: true, + bar: "{{win}}", + win: "FAIL" +}) diff --git a/pacotes/mustache.js-master/test/_files/double_render.mustache b/pacotes/mustache.js-master/test/_files/double_render.mustache new file mode 100644 index 0000000..4500fd7 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/double_render.mustache @@ -0,0 +1 @@ +{{#foo}}{{bar}}{{/foo}} diff --git a/pacotes/mustache.js-master/test/_files/double_render.txt b/pacotes/mustache.js-master/test/_files/double_render.txt new file mode 100644 index 0000000..b6e652d --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/double_render.txt @@ -0,0 +1 @@ +{{win}} diff --git a/pacotes/mustache.js-master/test/_files/empty_list.js b/pacotes/mustache.js-master/test/_files/empty_list.js new file mode 100644 index 0000000..c0e1159 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/empty_list.js @@ -0,0 +1,3 @@ +({ + jobs: [] +}) diff --git a/pacotes/mustache.js-master/test/_files/empty_list.mustache b/pacotes/mustache.js-master/test/_files/empty_list.mustache new file mode 100644 index 0000000..4fdf13d --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/empty_list.mustache @@ -0,0 +1,4 @@ +These are the jobs: +{{#jobs}} +{{.}} +{{/jobs}} diff --git a/pacotes/mustache.js-master/test/_files/empty_list.txt b/pacotes/mustache.js-master/test/_files/empty_list.txt new file mode 100644 index 0000000..d9b4a67 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/empty_list.txt @@ -0,0 +1 @@ +These are the jobs: diff --git a/pacotes/mustache.js-master/test/_files/empty_sections.js b/pacotes/mustache.js-master/test/_files/empty_sections.js new file mode 100644 index 0000000..b4100a5 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/empty_sections.js @@ -0,0 +1 @@ +({}) diff --git a/pacotes/mustache.js-master/test/_files/empty_sections.mustache b/pacotes/mustache.js-master/test/_files/empty_sections.mustache new file mode 100644 index 0000000..b6065db --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/empty_sections.mustache @@ -0,0 +1 @@ +{{#foo}}{{/foo}}foo{{#bar}}{{/bar}} diff --git a/pacotes/mustache.js-master/test/_files/empty_sections.txt b/pacotes/mustache.js-master/test/_files/empty_sections.txt new file mode 100644 index 0000000..257cc56 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/empty_sections.txt @@ -0,0 +1 @@ +foo diff --git a/pacotes/mustache.js-master/test/_files/empty_string.js b/pacotes/mustache.js-master/test/_files/empty_string.js new file mode 100644 index 0000000..be6e058 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/empty_string.js @@ -0,0 +1,6 @@ +({ + description: "That is all!", + child: { + description: "" + } +}) diff --git a/pacotes/mustache.js-master/test/_files/empty_string.mustache b/pacotes/mustache.js-master/test/_files/empty_string.mustache new file mode 100644 index 0000000..f568441 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/empty_string.mustache @@ -0,0 +1 @@ +{{description}}{{#child}}{{description}}{{/child}} diff --git a/pacotes/mustache.js-master/test/_files/empty_string.txt b/pacotes/mustache.js-master/test/_files/empty_string.txt new file mode 100644 index 0000000..22e2a6e --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/empty_string.txt @@ -0,0 +1 @@ +That is all! diff --git a/pacotes/mustache.js-master/test/_files/empty_template.js b/pacotes/mustache.js-master/test/_files/empty_template.js new file mode 100644 index 0000000..b4100a5 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/empty_template.js @@ -0,0 +1 @@ +({}) diff --git a/pacotes/mustache.js-master/test/_files/empty_template.mustache b/pacotes/mustache.js-master/test/_files/empty_template.mustache new file mode 100644 index 0000000..bb2367a --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/empty_template.mustache @@ -0,0 +1 @@ +

Test

\ No newline at end of file diff --git a/pacotes/mustache.js-master/test/_files/empty_template.txt b/pacotes/mustache.js-master/test/_files/empty_template.txt new file mode 100644 index 0000000..bb2367a --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/empty_template.txt @@ -0,0 +1 @@ +

Test

\ No newline at end of file diff --git a/pacotes/mustache.js-master/test/_files/error_not_found.js b/pacotes/mustache.js-master/test/_files/error_not_found.js new file mode 100644 index 0000000..10e4709 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/error_not_found.js @@ -0,0 +1,3 @@ +({ + bar: 2 +}) diff --git a/pacotes/mustache.js-master/test/_files/error_not_found.mustache b/pacotes/mustache.js-master/test/_files/error_not_found.mustache new file mode 100644 index 0000000..24369f7 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/error_not_found.mustache @@ -0,0 +1 @@ +{{foo}} \ No newline at end of file diff --git a/pacotes/mustache.js-master/test/_files/error_not_found.txt b/pacotes/mustache.js-master/test/_files/error_not_found.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/error_not_found.txt diff --git a/pacotes/mustache.js-master/test/_files/escaped.js b/pacotes/mustache.js-master/test/_files/escaped.js new file mode 100644 index 0000000..cd77c1f --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/escaped.js @@ -0,0 +1,6 @@ +({ + title: function () { + return "Bear > Shark"; + }, + entities: "" \"'<>/" +}) diff --git a/pacotes/mustache.js-master/test/_files/escaped.mustache b/pacotes/mustache.js-master/test/_files/escaped.mustache new file mode 100644 index 0000000..93e800b --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/escaped.mustache @@ -0,0 +1,2 @@ +

{{title}}

+And even {{entities}}, but not {{{entities}}}. diff --git a/pacotes/mustache.js-master/test/_files/escaped.txt b/pacotes/mustache.js-master/test/_files/escaped.txt new file mode 100644 index 0000000..c1527d5 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/escaped.txt @@ -0,0 +1,2 @@ +

Bear > Shark

+And even &quot; "'<>/, but not " "'<>/. diff --git a/pacotes/mustache.js-master/test/_files/falsy.js b/pacotes/mustache.js-master/test/_files/falsy.js new file mode 100644 index 0000000..ae9b9bf --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/falsy.js @@ -0,0 +1,8 @@ +({ + "emptyString": "", + "emptyArray": [], + "zero": 0, + "null": null, + "undefined": undefined, + "NaN": 0/0 +}) \ No newline at end of file diff --git a/pacotes/mustache.js-master/test/_files/falsy.mustache b/pacotes/mustache.js-master/test/_files/falsy.mustache new file mode 100644 index 0000000..f3698da --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/falsy.mustache @@ -0,0 +1,12 @@ +{{#emptyString}}empty string{{/emptyString}} +{{^emptyString}}inverted empty string{{/emptyString}} +{{#emptyArray}}empty array{{/emptyArray}} +{{^emptyArray}}inverted empty array{{/emptyArray}} +{{#zero}}zero{{/zero}} +{{^zero}}inverted zero{{/zero}} +{{#null}}null{{/null}} +{{^null}}inverted null{{/null}} +{{#undefined}}undefined{{/undefined}} +{{^undefined}}inverted undefined{{/undefined}} +{{#NaN}}NaN{{/NaN}} +{{^NaN}}inverted NaN{{/NaN}} diff --git a/pacotes/mustache.js-master/test/_files/falsy.txt b/pacotes/mustache.js-master/test/_files/falsy.txt new file mode 100644 index 0000000..9b7cde3 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/falsy.txt @@ -0,0 +1,12 @@ + +inverted empty string + +inverted empty array + +inverted zero + +inverted null + +inverted undefined + +inverted NaN diff --git a/pacotes/mustache.js-master/test/_files/grandparent_context.js b/pacotes/mustache.js-master/test/_files/grandparent_context.js new file mode 100644 index 0000000..97dbfd3 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/grandparent_context.js @@ -0,0 +1,19 @@ +({ + grand_parent_id: 'grand_parent1', + parent_contexts: [ + { + parent_id: 'parent1', + child_contexts: [ + { child_id: 'parent1-child1' }, + { child_id: 'parent1-child2' } + ] + }, + { + parent_id: 'parent2', + child_contexts: [ + { child_id: 'parent2-child1' }, + { child_id: 'parent2-child2' } + ] + } + ] +}) diff --git a/pacotes/mustache.js-master/test/_files/grandparent_context.mustache b/pacotes/mustache.js-master/test/_files/grandparent_context.mustache new file mode 100644 index 0000000..e6c07a2 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/grandparent_context.mustache @@ -0,0 +1,10 @@ +{{grand_parent_id}} +{{#parent_contexts}} +{{grand_parent_id}} +{{parent_id}} +{{#child_contexts}} +{{grand_parent_id}} +{{parent_id}} +{{child_id}} +{{/child_contexts}} +{{/parent_contexts}} diff --git a/pacotes/mustache.js-master/test/_files/grandparent_context.txt b/pacotes/mustache.js-master/test/_files/grandparent_context.txt new file mode 100644 index 0000000..64996ad --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/grandparent_context.txt @@ -0,0 +1,17 @@ +grand_parent1 +grand_parent1 +parent1 +grand_parent1 +parent1 +parent1-child1 +grand_parent1 +parent1 +parent1-child2 +grand_parent1 +parent2 +grand_parent1 +parent2 +parent2-child1 +grand_parent1 +parent2 +parent2-child2 diff --git a/pacotes/mustache.js-master/test/_files/higher_order_sections.js b/pacotes/mustache.js-master/test/_files/higher_order_sections.js new file mode 100644 index 0000000..bacb0a4 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/higher_order_sections.js @@ -0,0 +1,9 @@ +({ + name: "Tater", + helper: "To tinker?", + bolder: function () { + return function (text, render) { + return text + ' => ' + render(text) + ' ' + this.helper; + } + } +}) diff --git a/pacotes/mustache.js-master/test/_files/higher_order_sections.mustache b/pacotes/mustache.js-master/test/_files/higher_order_sections.mustache new file mode 100644 index 0000000..04f5318 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/higher_order_sections.mustache @@ -0,0 +1 @@ +{{#bolder}}Hi {{name}}.{{/bolder}} diff --git a/pacotes/mustache.js-master/test/_files/higher_order_sections.txt b/pacotes/mustache.js-master/test/_files/higher_order_sections.txt new file mode 100644 index 0000000..be50ad7 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/higher_order_sections.txt @@ -0,0 +1 @@ +Hi {{name}}. => Hi Tater. To tinker? diff --git a/pacotes/mustache.js-master/test/_files/included_tag.js b/pacotes/mustache.js-master/test/_files/included_tag.js new file mode 100644 index 0000000..eb032a4 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/included_tag.js @@ -0,0 +1,3 @@ +({ + html: "I like {{mustache}}" +}) diff --git a/pacotes/mustache.js-master/test/_files/included_tag.mustache b/pacotes/mustache.js-master/test/_files/included_tag.mustache new file mode 100644 index 0000000..70631c2 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/included_tag.mustache @@ -0,0 +1 @@ +You said "{{{html}}}" today diff --git a/pacotes/mustache.js-master/test/_files/included_tag.txt b/pacotes/mustache.js-master/test/_files/included_tag.txt new file mode 100644 index 0000000..1af4556 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/included_tag.txt @@ -0,0 +1 @@ +You said "I like {{mustache}}" today diff --git a/pacotes/mustache.js-master/test/_files/inverted_section.js b/pacotes/mustache.js-master/test/_files/inverted_section.js new file mode 100644 index 0000000..f8f08fd --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/inverted_section.js @@ -0,0 +1,3 @@ +({ + "repos": [] +}) diff --git a/pacotes/mustache.js-master/test/_files/inverted_section.mustache b/pacotes/mustache.js-master/test/_files/inverted_section.mustache new file mode 100644 index 0000000..b0a183b --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/inverted_section.mustache @@ -0,0 +1,3 @@ +{{#repos}}{{name}}{{/repos}} +{{^repos}}No repos :({{/repos}} +{{^nothin}}Hello!{{/nothin}} diff --git a/pacotes/mustache.js-master/test/_files/inverted_section.txt b/pacotes/mustache.js-master/test/_files/inverted_section.txt new file mode 100644 index 0000000..b421582 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/inverted_section.txt @@ -0,0 +1,3 @@ + +No repos :( +Hello! diff --git a/pacotes/mustache.js-master/test/_files/keys_with_questionmarks.js b/pacotes/mustache.js-master/test/_files/keys_with_questionmarks.js new file mode 100644 index 0000000..becd631 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/keys_with_questionmarks.js @@ -0,0 +1,5 @@ +({ + "person?": { + name: "Jon" + } +}) diff --git a/pacotes/mustache.js-master/test/_files/keys_with_questionmarks.mustache b/pacotes/mustache.js-master/test/_files/keys_with_questionmarks.mustache new file mode 100644 index 0000000..417f17f --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/keys_with_questionmarks.mustache @@ -0,0 +1,3 @@ +{{#person?}} + Hi {{name}}! +{{/person?}} diff --git a/pacotes/mustache.js-master/test/_files/keys_with_questionmarks.txt b/pacotes/mustache.js-master/test/_files/keys_with_questionmarks.txt new file mode 100644 index 0000000..0f69b94 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/keys_with_questionmarks.txt @@ -0,0 +1 @@ + Hi Jon! diff --git a/pacotes/mustache.js-master/test/_files/malicious_template.js b/pacotes/mustache.js-master/test/_files/malicious_template.js new file mode 100644 index 0000000..b4100a5 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/malicious_template.js @@ -0,0 +1 @@ +({}) diff --git a/pacotes/mustache.js-master/test/_files/malicious_template.mustache b/pacotes/mustache.js-master/test/_files/malicious_template.mustache new file mode 100644 index 0000000..b956867 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/malicious_template.mustache @@ -0,0 +1,5 @@ +{{"+(function () {throw "evil"})()+"}} +{{{"+(function () {throw "evil"})()+"}}} +{{> "+(function () {throw "evil"})()+"}} +{{# "+(function () {throw "evil"})()+"}} +{{/ "+(function () {throw "evil"})()+"}} diff --git a/pacotes/mustache.js-master/test/_files/malicious_template.txt b/pacotes/mustache.js-master/test/_files/malicious_template.txt new file mode 100644 index 0000000..139597f --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/malicious_template.txt @@ -0,0 +1,2 @@ + + diff --git a/pacotes/mustache.js-master/test/_files/multiline_comment.js b/pacotes/mustache.js-master/test/_files/multiline_comment.js new file mode 100644 index 0000000..b4100a5 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/multiline_comment.js @@ -0,0 +1 @@ +({}) diff --git a/pacotes/mustache.js-master/test/_files/multiline_comment.mustache b/pacotes/mustache.js-master/test/_files/multiline_comment.mustache new file mode 100644 index 0000000..dff0893 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/multiline_comment.mustache @@ -0,0 +1,6 @@ +{{! + +This is a multi-line comment. + +}} +Hello world! diff --git a/pacotes/mustache.js-master/test/_files/multiline_comment.txt b/pacotes/mustache.js-master/test/_files/multiline_comment.txt new file mode 100644 index 0000000..cd08755 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/multiline_comment.txt @@ -0,0 +1 @@ +Hello world! diff --git a/pacotes/mustache.js-master/test/_files/nested_dot.js b/pacotes/mustache.js-master/test/_files/nested_dot.js new file mode 100644 index 0000000..2c22f8e --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/nested_dot.js @@ -0,0 +1 @@ +({ name: 'Bruno' }) diff --git a/pacotes/mustache.js-master/test/_files/nested_dot.mustache b/pacotes/mustache.js-master/test/_files/nested_dot.mustache new file mode 100644 index 0000000..12b0728 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/nested_dot.mustache @@ -0,0 +1 @@ +{{#name}}Hello {{.}}{{/name}} \ No newline at end of file diff --git a/pacotes/mustache.js-master/test/_files/nested_dot.txt b/pacotes/mustache.js-master/test/_files/nested_dot.txt new file mode 100644 index 0000000..58df047 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/nested_dot.txt @@ -0,0 +1 @@ +Hello Bruno \ No newline at end of file diff --git a/pacotes/mustache.js-master/test/_files/nested_higher_order_sections.js b/pacotes/mustache.js-master/test/_files/nested_higher_order_sections.js new file mode 100644 index 0000000..3ccf4d3 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/nested_higher_order_sections.js @@ -0,0 +1,8 @@ +({ + bold: function () { + return function (text, render) { + return '' + render(text) + ''; + }; + }, + person: { name: 'Jonas' } +}); diff --git a/pacotes/mustache.js-master/test/_files/nested_higher_order_sections.mustache b/pacotes/mustache.js-master/test/_files/nested_higher_order_sections.mustache new file mode 100644 index 0000000..e312fe7 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/nested_higher_order_sections.mustache @@ -0,0 +1 @@ +{{#bold}}{{#person}}My name is {{name}}!{{/person}}{{/bold}} diff --git a/pacotes/mustache.js-master/test/_files/nested_higher_order_sections.txt b/pacotes/mustache.js-master/test/_files/nested_higher_order_sections.txt new file mode 100644 index 0000000..0ee6a40 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/nested_higher_order_sections.txt @@ -0,0 +1 @@ +My name is Jonas! diff --git a/pacotes/mustache.js-master/test/_files/nested_iterating.js b/pacotes/mustache.js-master/test/_files/nested_iterating.js new file mode 100644 index 0000000..2708b2d --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/nested_iterating.js @@ -0,0 +1,8 @@ +({ + inner: [{ + foo: 'foo', + inner: [{ + bar: 'bar' + }] + }] +}) diff --git a/pacotes/mustache.js-master/test/_files/nested_iterating.mustache b/pacotes/mustache.js-master/test/_files/nested_iterating.mustache new file mode 100644 index 0000000..1a3bb1a --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/nested_iterating.mustache @@ -0,0 +1 @@ +{{#inner}}{{foo}}{{#inner}}{{bar}}{{/inner}}{{/inner}} diff --git a/pacotes/mustache.js-master/test/_files/nested_iterating.txt b/pacotes/mustache.js-master/test/_files/nested_iterating.txt new file mode 100644 index 0000000..323fae0 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/nested_iterating.txt @@ -0,0 +1 @@ +foobar diff --git a/pacotes/mustache.js-master/test/_files/nesting.js b/pacotes/mustache.js-master/test/_files/nesting.js new file mode 100644 index 0000000..264cc2f --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/nesting.js @@ -0,0 +1,7 @@ +({ + foo: [ + {a: {b: 1}}, + {a: {b: 2}}, + {a: {b: 3}} + ] +}) diff --git a/pacotes/mustache.js-master/test/_files/nesting.mustache b/pacotes/mustache.js-master/test/_files/nesting.mustache new file mode 100644 index 0000000..551366d --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/nesting.mustache @@ -0,0 +1,5 @@ +{{#foo}} + {{#a}} + {{b}} + {{/a}} +{{/foo}} diff --git a/pacotes/mustache.js-master/test/_files/nesting.txt b/pacotes/mustache.js-master/test/_files/nesting.txt new file mode 100644 index 0000000..7db34b1 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/nesting.txt @@ -0,0 +1,3 @@ + 1 + 2 + 3 diff --git a/pacotes/mustache.js-master/test/_files/nesting_same_name.js b/pacotes/mustache.js-master/test/_files/nesting_same_name.js new file mode 100644 index 0000000..10a0c14 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/nesting_same_name.js @@ -0,0 +1,8 @@ +({ + items: [ + { + name: 'name', + items: [1, 2, 3, 4] + } + ] +}) diff --git a/pacotes/mustache.js-master/test/_files/nesting_same_name.mustache b/pacotes/mustache.js-master/test/_files/nesting_same_name.mustache new file mode 100644 index 0000000..777dbd6 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/nesting_same_name.mustache @@ -0,0 +1 @@ +{{#items}}{{name}}{{#items}}{{.}}{{/items}}{{/items}} diff --git a/pacotes/mustache.js-master/test/_files/nesting_same_name.txt b/pacotes/mustache.js-master/test/_files/nesting_same_name.txt new file mode 100644 index 0000000..34fcfd3 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/nesting_same_name.txt @@ -0,0 +1 @@ +name1234 diff --git a/pacotes/mustache.js-master/test/_files/null_string.js b/pacotes/mustache.js-master/test/_files/null_string.js new file mode 100644 index 0000000..984ee51 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/null_string.js @@ -0,0 +1,10 @@ +({ + name: "Elise", + glytch: true, + binary: false, + value: null, + undef: undefined, + numeric: function() { + return NaN; + } +}) diff --git a/pacotes/mustache.js-master/test/_files/null_string.mustache b/pacotes/mustache.js-master/test/_files/null_string.mustache new file mode 100644 index 0000000..a6f3300 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/null_string.mustache @@ -0,0 +1,6 @@ +Hello {{name}} +glytch {{glytch}} +binary {{binary}} +value {{value}} +undef {{undef}} +numeric {{numeric}} diff --git a/pacotes/mustache.js-master/test/_files/null_string.txt b/pacotes/mustache.js-master/test/_files/null_string.txt new file mode 100644 index 0000000..bcabe0a --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/null_string.txt @@ -0,0 +1,6 @@ +Hello Elise +glytch true +binary false +value +undef +numeric NaN diff --git a/pacotes/mustache.js-master/test/_files/null_view.js b/pacotes/mustache.js-master/test/_files/null_view.js new file mode 100644 index 0000000..dbdae72 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/null_view.js @@ -0,0 +1,4 @@ +({ + name: 'Joe', + friends: null +}) diff --git a/pacotes/mustache.js-master/test/_files/null_view.mustache b/pacotes/mustache.js-master/test/_files/null_view.mustache new file mode 100644 index 0000000..115b376 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/null_view.mustache @@ -0,0 +1 @@ +{{name}}'s friends: {{#friends}}{{name}}, {{/friends}} \ No newline at end of file diff --git a/pacotes/mustache.js-master/test/_files/null_view.txt b/pacotes/mustache.js-master/test/_files/null_view.txt new file mode 100644 index 0000000..15ed2ab --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/null_view.txt @@ -0,0 +1 @@ +Joe's friends: \ No newline at end of file diff --git a/pacotes/mustache.js-master/test/_files/partial_array.js b/pacotes/mustache.js-master/test/_files/partial_array.js new file mode 100644 index 0000000..2a6ddf1 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/partial_array.js @@ -0,0 +1,3 @@ +({ + array: ['1', '2', '3', '4'] +}) diff --git a/pacotes/mustache.js-master/test/_files/partial_array.mustache b/pacotes/mustache.js-master/test/_files/partial_array.mustache new file mode 100644 index 0000000..7a336fe --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/partial_array.mustache @@ -0,0 +1 @@ +{{>partial}} \ No newline at end of file diff --git a/pacotes/mustache.js-master/test/_files/partial_array.partial b/pacotes/mustache.js-master/test/_files/partial_array.partial new file mode 100644 index 0000000..0ba652c --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/partial_array.partial @@ -0,0 +1,4 @@ +Here's a non-sense array of values +{{#array}} + {{.}} +{{/array}} diff --git a/pacotes/mustache.js-master/test/_files/partial_array.txt b/pacotes/mustache.js-master/test/_files/partial_array.txt new file mode 100644 index 0000000..892837c --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/partial_array.txt @@ -0,0 +1,5 @@ +Here's a non-sense array of values + 1 + 2 + 3 + 4 diff --git a/pacotes/mustache.js-master/test/_files/partial_array_of_partials.js b/pacotes/mustache.js-master/test/_files/partial_array_of_partials.js new file mode 100644 index 0000000..03f13c9 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/partial_array_of_partials.js @@ -0,0 +1,8 @@ +({ + numbers: [ + {i: '1'}, + {i: '2'}, + {i: '3'}, + {i: '4'} + ] +}) diff --git a/pacotes/mustache.js-master/test/_files/partial_array_of_partials.mustache b/pacotes/mustache.js-master/test/_files/partial_array_of_partials.mustache new file mode 100644 index 0000000..1af6d68 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/partial_array_of_partials.mustache @@ -0,0 +1,4 @@ +Here is some stuff! +{{#numbers}} +{{>partial}} +{{/numbers}} diff --git a/pacotes/mustache.js-master/test/_files/partial_array_of_partials.partial b/pacotes/mustache.js-master/test/_files/partial_array_of_partials.partial new file mode 100644 index 0000000..bdde77d --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/partial_array_of_partials.partial @@ -0,0 +1 @@ +{{i}} diff --git a/pacotes/mustache.js-master/test/_files/partial_array_of_partials.txt b/pacotes/mustache.js-master/test/_files/partial_array_of_partials.txt new file mode 100644 index 0000000..f622375 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/partial_array_of_partials.txt @@ -0,0 +1,5 @@ +Here is some stuff! +1 +2 +3 +4 diff --git a/pacotes/mustache.js-master/test/_files/partial_array_of_partials_implicit.js b/pacotes/mustache.js-master/test/_files/partial_array_of_partials_implicit.js new file mode 100644 index 0000000..9ec0c00 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/partial_array_of_partials_implicit.js @@ -0,0 +1,3 @@ +({ + numbers: ['1', '2', '3', '4'] +}) diff --git a/pacotes/mustache.js-master/test/_files/partial_array_of_partials_implicit.mustache b/pacotes/mustache.js-master/test/_files/partial_array_of_partials_implicit.mustache new file mode 100644 index 0000000..1af6d68 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/partial_array_of_partials_implicit.mustache @@ -0,0 +1,4 @@ +Here is some stuff! +{{#numbers}} +{{>partial}} +{{/numbers}} diff --git a/pacotes/mustache.js-master/test/_files/partial_array_of_partials_implicit.partial b/pacotes/mustache.js-master/test/_files/partial_array_of_partials_implicit.partial new file mode 100644 index 0000000..12f7159 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/partial_array_of_partials_implicit.partial @@ -0,0 +1 @@ +{{.}} diff --git a/pacotes/mustache.js-master/test/_files/partial_array_of_partials_implicit.txt b/pacotes/mustache.js-master/test/_files/partial_array_of_partials_implicit.txt new file mode 100644 index 0000000..f622375 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/partial_array_of_partials_implicit.txt @@ -0,0 +1,5 @@ +Here is some stuff! +1 +2 +3 +4 diff --git a/pacotes/mustache.js-master/test/_files/partial_empty.js b/pacotes/mustache.js-master/test/_files/partial_empty.js new file mode 100644 index 0000000..82b8c22 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/partial_empty.js @@ -0,0 +1,3 @@ +({ + foo: 1 +}) diff --git a/pacotes/mustache.js-master/test/_files/partial_empty.mustache b/pacotes/mustache.js-master/test/_files/partial_empty.mustache new file mode 100644 index 0000000..a710047 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/partial_empty.mustache @@ -0,0 +1,2 @@ +hey {{foo}} +{{>partial}} diff --git a/pacotes/mustache.js-master/test/_files/partial_empty.partial b/pacotes/mustache.js-master/test/_files/partial_empty.partial new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/partial_empty.partial diff --git a/pacotes/mustache.js-master/test/_files/partial_empty.txt b/pacotes/mustache.js-master/test/_files/partial_empty.txt new file mode 100644 index 0000000..1a67907 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/partial_empty.txt @@ -0,0 +1 @@ +hey 1 diff --git a/pacotes/mustache.js-master/test/_files/partial_template.js b/pacotes/mustache.js-master/test/_files/partial_template.js new file mode 100644 index 0000000..a913f87 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/partial_template.js @@ -0,0 +1,6 @@ +({ + title: function () { + return "Welcome"; + }, + again: "Goodbye" +}) diff --git a/pacotes/mustache.js-master/test/_files/partial_template.mustache b/pacotes/mustache.js-master/test/_files/partial_template.mustache new file mode 100644 index 0000000..6a7492e --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/partial_template.mustache @@ -0,0 +1,2 @@ +

{{title}}

+{{>partial}} diff --git a/pacotes/mustache.js-master/test/_files/partial_template.partial b/pacotes/mustache.js-master/test/_files/partial_template.partial new file mode 100644 index 0000000..a404529 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/partial_template.partial @@ -0,0 +1 @@ +Again, {{again}}! diff --git a/pacotes/mustache.js-master/test/_files/partial_template.txt b/pacotes/mustache.js-master/test/_files/partial_template.txt new file mode 100644 index 0000000..692698f --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/partial_template.txt @@ -0,0 +1,2 @@ +

Welcome

+Again, Goodbye! diff --git a/pacotes/mustache.js-master/test/_files/partial_view.js b/pacotes/mustache.js-master/test/_files/partial_view.js new file mode 100644 index 0000000..3ad70d3 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/partial_view.js @@ -0,0 +1,14 @@ +({ + greeting: function () { + return "Welcome"; + }, + farewell: function () { + return "Fair enough, right?"; + }, + name: "Chris", + value: 10000, + taxed_value: function () { + return this.value - (this.value * 0.4); + }, + in_ca: true +}) diff --git a/pacotes/mustache.js-master/test/_files/partial_view.mustache b/pacotes/mustache.js-master/test/_files/partial_view.mustache new file mode 100644 index 0000000..f8f6a5b --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/partial_view.mustache @@ -0,0 +1,3 @@ +

{{greeting}}

+{{>partial}} +

{{farewell}}

diff --git a/pacotes/mustache.js-master/test/_files/partial_view.partial b/pacotes/mustache.js-master/test/_files/partial_view.partial new file mode 100644 index 0000000..03df206 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/partial_view.partial @@ -0,0 +1,5 @@ +Hello {{name}} +You have just won ${{value}}! +{{#in_ca}} +Well, ${{ taxed_value }}, after taxes. +{{/in_ca}} \ No newline at end of file diff --git a/pacotes/mustache.js-master/test/_files/partial_view.txt b/pacotes/mustache.js-master/test/_files/partial_view.txt new file mode 100644 index 0000000..c09147c --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/partial_view.txt @@ -0,0 +1,5 @@ +

Welcome

+Hello Chris +You have just won $10000! +Well, $6000, after taxes. +

Fair enough, right?

diff --git a/pacotes/mustache.js-master/test/_files/partial_whitespace.js b/pacotes/mustache.js-master/test/_files/partial_whitespace.js new file mode 100644 index 0000000..3ad70d3 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/partial_whitespace.js @@ -0,0 +1,14 @@ +({ + greeting: function () { + return "Welcome"; + }, + farewell: function () { + return "Fair enough, right?"; + }, + name: "Chris", + value: 10000, + taxed_value: function () { + return this.value - (this.value * 0.4); + }, + in_ca: true +}) diff --git a/pacotes/mustache.js-master/test/_files/partial_whitespace.mustache b/pacotes/mustache.js-master/test/_files/partial_whitespace.mustache new file mode 100644 index 0000000..48bd1ff --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/partial_whitespace.mustache @@ -0,0 +1,3 @@ +

{{ greeting }}

+{{> partial }} +

{{ farewell }}

diff --git a/pacotes/mustache.js-master/test/_files/partial_whitespace.partial b/pacotes/mustache.js-master/test/_files/partial_whitespace.partial new file mode 100644 index 0000000..30de8f6 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/partial_whitespace.partial @@ -0,0 +1,5 @@ +Hello {{ name}} +You have just won ${{value }}! +{{# in_ca }} +Well, ${{ taxed_value }}, after taxes. +{{/ in_ca }} \ No newline at end of file diff --git a/pacotes/mustache.js-master/test/_files/partial_whitespace.txt b/pacotes/mustache.js-master/test/_files/partial_whitespace.txt new file mode 100644 index 0000000..c09147c --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/partial_whitespace.txt @@ -0,0 +1,5 @@ +

Welcome

+Hello Chris +You have just won $10000! +Well, $6000, after taxes. +

Fair enough, right?

diff --git a/pacotes/mustache.js-master/test/_files/recursion_with_same_names.js b/pacotes/mustache.js-master/test/_files/recursion_with_same_names.js new file mode 100644 index 0000000..ce26502 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/recursion_with_same_names.js @@ -0,0 +1,8 @@ +({ + name: 'name', + description: 'desc', + terms: [ + {name: 't1', index: 0}, + {name: 't2', index: 1} + ] +}) diff --git a/pacotes/mustache.js-master/test/_files/recursion_with_same_names.mustache b/pacotes/mustache.js-master/test/_files/recursion_with_same_names.mustache new file mode 100644 index 0000000..c331d04 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/recursion_with_same_names.mustache @@ -0,0 +1,7 @@ +{{ name }} +{{ description }} + +{{#terms}} + {{name}} + {{index}} +{{/terms}} diff --git a/pacotes/mustache.js-master/test/_files/recursion_with_same_names.txt b/pacotes/mustache.js-master/test/_files/recursion_with_same_names.txt new file mode 100644 index 0000000..cb15d75 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/recursion_with_same_names.txt @@ -0,0 +1,7 @@ +name +desc + + t1 + 0 + t2 + 1 diff --git a/pacotes/mustache.js-master/test/_files/reuse_of_enumerables.js b/pacotes/mustache.js-master/test/_files/reuse_of_enumerables.js new file mode 100644 index 0000000..4368b57 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/reuse_of_enumerables.js @@ -0,0 +1,6 @@ +({ + terms: [ + {name: 't1', index: 0}, + {name: 't2', index: 1} + ] +}) diff --git a/pacotes/mustache.js-master/test/_files/reuse_of_enumerables.mustache b/pacotes/mustache.js-master/test/_files/reuse_of_enumerables.mustache new file mode 100644 index 0000000..cc0cb7a --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/reuse_of_enumerables.mustache @@ -0,0 +1,8 @@ +{{#terms}} + {{name}} + {{index}} +{{/terms}} +{{#terms}} + {{name}} + {{index}} +{{/terms}} diff --git a/pacotes/mustache.js-master/test/_files/reuse_of_enumerables.txt b/pacotes/mustache.js-master/test/_files/reuse_of_enumerables.txt new file mode 100644 index 0000000..6d05d96 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/reuse_of_enumerables.txt @@ -0,0 +1,8 @@ + t1 + 0 + t2 + 1 + t1 + 0 + t2 + 1 diff --git a/pacotes/mustache.js-master/test/_files/section_as_context.js b/pacotes/mustache.js-master/test/_files/section_as_context.js new file mode 100644 index 0000000..425b29c --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/section_as_context.js @@ -0,0 +1,10 @@ +({ + a_object: { + title: 'this is an object', + description: 'one of its attributes is a list', + a_list: [ + {label: 'listitem1'}, + {label: 'listitem2'} + ] + } +}) diff --git a/pacotes/mustache.js-master/test/_files/section_as_context.mustache b/pacotes/mustache.js-master/test/_files/section_as_context.mustache new file mode 100644 index 0000000..59990f6 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/section_as_context.mustache @@ -0,0 +1,9 @@ +{{#a_object}} +

{{title}}

+

{{description}}

+ +{{/a_object}} diff --git a/pacotes/mustache.js-master/test/_files/section_as_context.txt b/pacotes/mustache.js-master/test/_files/section_as_context.txt new file mode 100644 index 0000000..d834e80 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/section_as_context.txt @@ -0,0 +1,6 @@ +

this is an object

+

one of its attributes is a list

+ diff --git a/pacotes/mustache.js-master/test/_files/section_functions_in_partials.js b/pacotes/mustache.js-master/test/_files/section_functions_in_partials.js new file mode 100644 index 0000000..4672778 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/section_functions_in_partials.js @@ -0,0 +1,7 @@ +({ + bold: function(){ + return function(text, render) { + return "" + render(text) + ""; + } + } +}) diff --git a/pacotes/mustache.js-master/test/_files/section_functions_in_partials.mustache b/pacotes/mustache.js-master/test/_files/section_functions_in_partials.mustache new file mode 100644 index 0000000..8164932 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/section_functions_in_partials.mustache @@ -0,0 +1,3 @@ +{{> partial}} + +

some more text

diff --git a/pacotes/mustache.js-master/test/_files/section_functions_in_partials.partial b/pacotes/mustache.js-master/test/_files/section_functions_in_partials.partial new file mode 100644 index 0000000..3e90b00 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/section_functions_in_partials.partial @@ -0,0 +1 @@ +{{#bold}}Hello There{{/bold}} diff --git a/pacotes/mustache.js-master/test/_files/section_functions_in_partials.txt b/pacotes/mustache.js-master/test/_files/section_functions_in_partials.txt new file mode 100644 index 0000000..2f5955c --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/section_functions_in_partials.txt @@ -0,0 +1,3 @@ +Hello There + +

some more text

diff --git a/pacotes/mustache.js-master/test/_files/simple.js b/pacotes/mustache.js-master/test/_files/simple.js new file mode 100644 index 0000000..1d8d6f4 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/simple.js @@ -0,0 +1,8 @@ +({ + name: "Chris", + value: 10000, + taxed_value: function () { + return this.value - (this.value * 0.4); + }, + in_ca: true +}) diff --git a/pacotes/mustache.js-master/test/_files/simple.mustache b/pacotes/mustache.js-master/test/_files/simple.mustache new file mode 100644 index 0000000..2fea632 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/simple.mustache @@ -0,0 +1,5 @@ +Hello {{name}} +You have just won ${{value}}! +{{#in_ca}} +Well, ${{ taxed_value }}, after taxes. +{{/in_ca}} diff --git a/pacotes/mustache.js-master/test/_files/simple.txt b/pacotes/mustache.js-master/test/_files/simple.txt new file mode 100644 index 0000000..5d75d65 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/simple.txt @@ -0,0 +1,3 @@ +Hello Chris +You have just won $10000! +Well, $6000, after taxes. diff --git a/pacotes/mustache.js-master/test/_files/string_as_context.js b/pacotes/mustache.js-master/test/_files/string_as_context.js new file mode 100644 index 0000000..e8bb4da --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/string_as_context.js @@ -0,0 +1,4 @@ +({ + a_string: 'aa', + a_list: ['a','b','c'] +}) diff --git a/pacotes/mustache.js-master/test/_files/string_as_context.mustache b/pacotes/mustache.js-master/test/_files/string_as_context.mustache new file mode 100644 index 0000000..00f7181 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/string_as_context.mustache @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/pacotes/mustache.js-master/test/_files/string_as_context.txt b/pacotes/mustache.js-master/test/_files/string_as_context.txt new file mode 100644 index 0000000..8bd87ff --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/string_as_context.txt @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/pacotes/mustache.js-master/test/_files/two_in_a_row.js b/pacotes/mustache.js-master/test/_files/two_in_a_row.js new file mode 100644 index 0000000..9c17c11 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/two_in_a_row.js @@ -0,0 +1,4 @@ +({ + name: "Joe", + greeting: "Welcome" +}) diff --git a/pacotes/mustache.js-master/test/_files/two_in_a_row.mustache b/pacotes/mustache.js-master/test/_files/two_in_a_row.mustache new file mode 100644 index 0000000..b23f29e --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/two_in_a_row.mustache @@ -0,0 +1 @@ +{{greeting}}, {{name}}! diff --git a/pacotes/mustache.js-master/test/_files/two_in_a_row.txt b/pacotes/mustache.js-master/test/_files/two_in_a_row.txt new file mode 100644 index 0000000..c6d6a9b --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/two_in_a_row.txt @@ -0,0 +1 @@ +Welcome, Joe! diff --git a/pacotes/mustache.js-master/test/_files/two_sections.js b/pacotes/mustache.js-master/test/_files/two_sections.js new file mode 100644 index 0000000..b4100a5 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/two_sections.js @@ -0,0 +1 @@ +({}) diff --git a/pacotes/mustache.js-master/test/_files/two_sections.mustache b/pacotes/mustache.js-master/test/_files/two_sections.mustache new file mode 100644 index 0000000..a4b9f2a --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/two_sections.mustache @@ -0,0 +1,4 @@ +{{#foo}} +{{/foo}} +{{#bar}} +{{/bar}} diff --git a/pacotes/mustache.js-master/test/_files/two_sections.txt b/pacotes/mustache.js-master/test/_files/two_sections.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/two_sections.txt diff --git a/pacotes/mustache.js-master/test/_files/unescaped.js b/pacotes/mustache.js-master/test/_files/unescaped.js new file mode 100644 index 0000000..b6d064f --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/unescaped.js @@ -0,0 +1,5 @@ +({ + title: function () { + return "Bear > Shark"; + } +}) diff --git a/pacotes/mustache.js-master/test/_files/unescaped.mustache b/pacotes/mustache.js-master/test/_files/unescaped.mustache new file mode 100644 index 0000000..6b07d7b --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/unescaped.mustache @@ -0,0 +1 @@ +

{{{title}}}

diff --git a/pacotes/mustache.js-master/test/_files/unescaped.txt b/pacotes/mustache.js-master/test/_files/unescaped.txt new file mode 100644 index 0000000..089ad79 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/unescaped.txt @@ -0,0 +1 @@ +

Bear > Shark

diff --git a/pacotes/mustache.js-master/test/_files/whitespace.js b/pacotes/mustache.js-master/test/_files/whitespace.js new file mode 100644 index 0000000..f41cb56 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/whitespace.js @@ -0,0 +1,4 @@ +({ + tag1: "Hello", + tag2: "World" +}) diff --git a/pacotes/mustache.js-master/test/_files/whitespace.mustache b/pacotes/mustache.js-master/test/_files/whitespace.mustache new file mode 100644 index 0000000..aa76e08 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/whitespace.mustache @@ -0,0 +1,4 @@ +{{tag1}} + + +{{tag2}}. diff --git a/pacotes/mustache.js-master/test/_files/whitespace.txt b/pacotes/mustache.js-master/test/_files/whitespace.txt new file mode 100644 index 0000000..851fa74 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/whitespace.txt @@ -0,0 +1,4 @@ +Hello + + +World. diff --git a/pacotes/mustache.js-master/test/_files/zero_view.js b/pacotes/mustache.js-master/test/_files/zero_view.js new file mode 100644 index 0000000..9864608 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/zero_view.js @@ -0,0 +1 @@ +({ nums: [0, 1, 2] }) diff --git a/pacotes/mustache.js-master/test/_files/zero_view.mustache b/pacotes/mustache.js-master/test/_files/zero_view.mustache new file mode 100644 index 0000000..1cdc190 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/zero_view.mustache @@ -0,0 +1 @@ +{{#nums}}{{.}},{{/nums}} \ No newline at end of file diff --git a/pacotes/mustache.js-master/test/_files/zero_view.txt b/pacotes/mustache.js-master/test/_files/zero_view.txt new file mode 100644 index 0000000..2aee585 --- /dev/null +++ b/pacotes/mustache.js-master/test/_files/zero_view.txt @@ -0,0 +1 @@ +0,1,2, \ No newline at end of file diff --git a/pacotes/mustache.js-master/test/context-test.js b/pacotes/mustache.js-master/test/context-test.js new file mode 100644 index 0000000..9b9cbbe --- /dev/null +++ b/pacotes/mustache.js-master/test/context-test.js @@ -0,0 +1,61 @@ +require('./helper'); +var Context = Mustache.Context; + +describe('A new Mustache.Context', function () { + var context; + beforeEach(function () { + context = new Context({ name: 'parent', message: 'hi', a: { b: 'b' } }); + }); + + it('is able to lookup properties of its own view', function () { + assert.equal(context.lookup('name'), 'parent'); + }); + + it('is able to lookup nested properties of its own view', function () { + assert.equal(context.lookup('a.b'), 'b'); + }); + + describe('when pushed', function () { + beforeEach(function () { + context = context.push({ name: 'child', c: { d: 'd' } }); + }); + + it('returns the child context', function () { + assert.equal(context.view.name, 'child'); + assert.equal(context.parent.view.name, 'parent'); + }); + + it('is able to lookup properties of its own view', function () { + assert.equal(context.lookup('name'), 'child'); + }); + + it("is able to lookup properties of the parent context's view", function () { + assert.equal(context.lookup('message'), 'hi'); + }); + + it('is able to lookup nested properties of its own view', function () { + assert.equal(context.lookup('c.d'), 'd'); + }); + + it('is able to lookup nested properties of its parent view', function () { + assert.equal(context.lookup('a.b'), 'b'); + }); + }); +}); + +describe('A Mustache.Context', function () { + var context; + + describe('with an empty string in the lookup chain', function () { + var view, context; + beforeEach(function () { + view = { a: '' }; + view.a.b = 'value'; + context = new Context(view); + }); + + it('is able to lookup a nested property', function () { + assert.equal(context.lookup('a.b'), view.a.b); + }); + }); +}); diff --git a/pacotes/mustache.js-master/test/helper.js b/pacotes/mustache.js-master/test/helper.js new file mode 100644 index 0000000..a91fe49 --- /dev/null +++ b/pacotes/mustache.js-master/test/helper.js @@ -0,0 +1,2 @@ +assert = require('assert'); +Mustache = require('../mustache'); diff --git a/pacotes/mustache.js-master/test/mustache-spec-test.js b/pacotes/mustache.js-master/test/mustache-spec-test.js new file mode 100644 index 0000000..0c6e537 --- /dev/null +++ b/pacotes/mustache.js-master/test/mustache-spec-test.js @@ -0,0 +1,89 @@ +require('./helper'); + +var fs = require('fs'); +var path = require('path'); +var specsDir = path.join(__dirname, 'spec/specs'); + +var skipTests = { + comments: [ + 'Standalone Without Newline' + ], + delimiters: [ + 'Standalone Without Newline' + ], + inverted: [ + 'Standalone Without Newline' + ], + partials: [ + 'Standalone Without Previous Line', + 'Standalone Without Newline', + 'Standalone Indentation' + ], + sections: [ + 'Standalone Without Newline' + ], + '~lambdas': [ + 'Interpolation', + 'Interpolation - Expansion', + 'Interpolation - Alternate Delimiters', + 'Interpolation - Multiple Calls', + 'Escaping', + 'Section - Expansion', + 'Section - Alternate Delimiters' + ] +}; + +// You can run the skiped tests by setting the NOSKIP environment variable to +// true (e.g. NOSKIP=true mocha test/mustache-spec-test.js) +var noSkip = process.env.NOSKIP; + +// You can put the name of a specific test file to run in the TEST environment +// variable (e.g. TEST=interpolation mocha test/mustache-spec-test.js) +var fileToRun = process.env.TEST; + +// Mustache should work on node 0.6 that doesn't have fs.existsSync +function existsDir(path) { + try { + return fs.statSync(path).isDirectory(); + } catch (x) { + return false; + } +} + +var specFiles; +if (fileToRun) { + specFiles = [fileToRun]; +} else if (existsDir(specsDir)) { + specFiles = fs.readdirSync(specsDir).filter(function (file) { + return (/\.json$/).test(file); + }).map(function (file) { + return path.basename(file).replace(/\.json$/, ''); + }).sort(); +} else { + specFiles = []; +} + +function getSpecs(specArea) { + return JSON.parse(fs.readFileSync(path.join(specsDir, specArea + '.' + 'json'), 'utf8')); +} + +describe('Mustache spec compliance', function() { + beforeEach(function () { + Mustache.clearCache(); + }); + + specFiles.forEach(function(specArea) { + describe('- ' + specArea + ':', function() { + var specs = getSpecs(specArea); + specs.tests.forEach(function(test) { + var it_ = (!noSkip && skipTests[specArea] && skipTests[specArea].indexOf(test.name) >= 0) ? it.skip : it; + it_(test.name + ' - ' + test.desc, function() { + if (test.data.lambda && test.data.lambda.__tag__ === 'code') + test.data.lambda = eval('(function() { return ' + test.data.lambda.js + '; })'); + var output = Mustache.render(test.template, test.data, test.partials); + assert.equal(output, test.expected); + }); + }); + }); + }); +}); diff --git a/pacotes/mustache.js-master/test/parse-test.js b/pacotes/mustache.js-master/test/parse-test.js new file mode 100644 index 0000000..97c26db --- /dev/null +++ b/pacotes/mustache.js-master/test/parse-test.js @@ -0,0 +1,106 @@ +require('./helper'); + +// A map of templates to their expected token output. Tokens are in the format: +// [type, value, startIndex, endIndex, subTokens]. +var expectations = { + '' : [], + '{{hi}}' : [ [ 'name', 'hi', 0, 6 ] ], + '{{hi.world}}' : [ [ 'name', 'hi.world', 0, 12 ] ], + '{{hi . world}}' : [ [ 'name', 'hi . world', 0, 14 ] ], + '{{ hi}}' : [ [ 'name', 'hi', 0, 7 ] ], + '{{hi }}' : [ [ 'name', 'hi', 0, 7 ] ], + '{{ hi }}' : [ [ 'name', 'hi', 0, 8 ] ], + '{{{hi}}}' : [ [ '&', 'hi', 0, 8 ] ], + '{{!hi}}' : [ [ '!', 'hi', 0, 7 ] ], + '{{! hi}}' : [ [ '!', 'hi', 0, 8 ] ], + '{{! hi }}' : [ [ '!', 'hi', 0, 9 ] ], + '{{ !hi}}' : [ [ '!', 'hi', 0, 8 ] ], + '{{ ! hi}}' : [ [ '!', 'hi', 0, 9 ] ], + '{{ ! hi }}' : [ [ '!', 'hi', 0, 10 ] ], + 'a\n b' : [ [ 'text', 'a\n b', 0, 4 ] ], + 'a{{hi}}' : [ [ 'text', 'a', 0, 1 ], [ 'name', 'hi', 1, 7 ] ], + 'a {{hi}}' : [ [ 'text', 'a ', 0, 2 ], [ 'name', 'hi', 2, 8 ] ], + ' a{{hi}}' : [ [ 'text', ' a', 0, 2 ], [ 'name', 'hi', 2, 8 ] ], + ' a {{hi}}' : [ [ 'text', ' a ', 0, 3 ], [ 'name', 'hi', 3, 9 ] ], + 'a{{hi}}b' : [ [ 'text', 'a', 0, 1 ], [ 'name', 'hi', 1, 7 ], [ 'text', 'b', 7, 8 ] ], + 'a{{hi}} b' : [ [ 'text', 'a', 0, 1 ], [ 'name', 'hi', 1, 7 ], [ 'text', ' b', 7, 9 ] ], + 'a{{hi}}b ' : [ [ 'text', 'a', 0, 1 ], [ 'name', 'hi', 1, 7 ], [ 'text', 'b ', 7, 9 ] ], + 'a\n{{hi}} b \n' : [ [ 'text', 'a\n', 0, 2 ], [ 'name', 'hi', 2, 8 ], [ 'text', ' b \n', 8, 12 ] ], + 'a\n {{hi}} \nb' : [ [ 'text', 'a\n ', 0, 3 ], [ 'name', 'hi', 3, 9 ], [ 'text', ' \nb', 9, 12 ] ], + 'a\n {{!hi}} \nb' : [ [ 'text', 'a\n', 0, 2 ], [ '!', 'hi', 3, 10 ], [ 'text', 'b', 12, 13 ] ], + 'a\n{{#a}}{{/a}}\nb' : [ [ 'text', 'a\n', 0, 2 ], [ '#', 'a', 2, 8, [], 8 ], [ 'text', 'b', 15, 16 ] ], + 'a\n {{#a}}{{/a}}\nb' : [ [ 'text', 'a\n', 0, 2 ], [ '#', 'a', 3, 9, [], 9 ], [ 'text', 'b', 16, 17 ] ], + 'a\n {{#a}}{{/a}} \nb' : [ [ 'text', 'a\n', 0, 2 ], [ '#', 'a', 3, 9, [], 9 ], [ 'text', 'b', 17, 18 ] ], + 'a\n{{#a}}\n{{/a}}\nb' : [ [ 'text', 'a\n', 0, 2 ], [ '#', 'a', 2, 8, [], 9 ], [ 'text', 'b', 16, 17 ] ], + 'a\n {{#a}}\n{{/a}}\nb' : [ [ 'text', 'a\n', 0, 2 ], [ '#', 'a', 3, 9, [], 10 ], [ 'text', 'b', 17, 18 ] ], + 'a\n {{#a}}\n{{/a}} \nb' : [ [ 'text', 'a\n', 0, 2 ], [ '#', 'a', 3, 9, [], 10 ], [ 'text', 'b', 18, 19 ] ], + 'a\n{{#a}}\n{{/a}}\n{{#b}}\n{{/b}}\nb' : [ [ 'text', 'a\n', 0, 2 ], [ '#', 'a', 2, 8, [], 9 ], [ '#', 'b', 16, 22, [], 23 ], [ 'text', 'b', 30, 31 ] ], + 'a\n {{#a}}\n{{/a}}\n{{#b}}\n{{/b}}\nb' : [ [ 'text', 'a\n', 0, 2 ], [ '#', 'a', 3, 9, [], 10 ], [ '#', 'b', 17, 23, [], 24 ], [ 'text', 'b', 31, 32 ] ], + 'a\n {{#a}}\n{{/a}}\n{{#b}}\n{{/b}} \nb' : [ [ 'text', 'a\n', 0, 2 ], [ '#', 'a', 3, 9, [], 10 ], [ '#', 'b', 17, 23, [], 24 ], [ 'text', 'b', 32, 33 ] ], + 'a\n{{#a}}\n{{#b}}\n{{/b}}\n{{/a}}\nb' : [ [ 'text', 'a\n', 0, 2 ], [ '#', 'a', 2, 8, [ [ '#', 'b', 9, 15, [], 16 ] ], 23 ], [ 'text', 'b', 30, 31 ] ], + 'a\n {{#a}}\n{{#b}}\n{{/b}}\n{{/a}}\nb' : [ [ 'text', 'a\n', 0, 2 ], [ '#', 'a', 3, 9, [ [ '#', 'b', 10, 16, [], 17 ] ], 24 ], [ 'text', 'b', 31, 32 ] ], + 'a\n {{#a}}\n{{#b}}\n{{/b}}\n{{/a}} \nb' : [ [ 'text', 'a\n', 0, 2 ], [ '#', 'a', 3, 9, [ [ '#', 'b', 10, 16, [], 17 ] ], 24 ], [ 'text', 'b', 32, 33 ] ], + '{{>abc}}' : [ [ '>', 'abc', 0, 8 ] ], + '{{> abc }}' : [ [ '>', 'abc', 0, 10 ] ], + '{{ > abc }}' : [ [ '>', 'abc', 0, 11 ] ], + '{{=<% %>=}}' : [ [ '=', '<% %>', 0, 11 ] ], + '{{= <% %> =}}' : [ [ '=', '<% %>', 0, 13 ] ], + '{{=<% %>=}}<%={{ }}=%>' : [ [ '=', '<% %>', 0, 11 ], [ '=', '{{ }}', 11, 22 ] ], + '{{=<% %>=}}<%hi%>' : [ [ '=', '<% %>', 0, 11 ], [ 'name', 'hi', 11, 17 ] ], + '{{#a}}{{/a}}hi{{#b}}{{/b}}\n' : [ [ '#', 'a', 0, 6, [], 6 ], [ 'text', 'hi', 12, 14 ], [ '#', 'b', 14, 20, [], 20 ], [ 'text', '\n', 26, 27 ] ], + '{{a}}\n{{b}}\n\n{{#c}}\n{{/c}}\n' : [ [ 'name', 'a', 0, 5 ], [ 'text', '\n', 5, 6 ], [ 'name', 'b', 6, 11 ], [ 'text', '\n\n', 11, 13 ], [ '#', 'c', 13, 19, [], 20 ] ], + '{{#foo}}\n {{#a}}\n {{b}}\n {{/a}}\n{{/foo}}\n' + : [ [ '#', 'foo', 0, 8, [ [ '#', 'a', 11, 17, [ [ 'text', ' ', 18, 22 ], [ 'name', 'b', 22, 27 ], [ 'text', '\n', 27, 28 ] ], 30 ] ], 37 ] ] +}; + +describe('Mustache.parse', function () { + + for (var template in expectations) { + (function (template, tokens) { + it('knows how to parse ' + JSON.stringify(template), function () { + assert.deepEqual(Mustache.parse(template), tokens); + }); + })(template, expectations[template]); + } + + describe('when there is an unclosed tag', function () { + it('throws an error', function () { + assert.throws(function () { + Mustache.parse('My name is {{name'); + }, /unclosed tag at 17/i); + }); + }); + + describe('when there is an unclosed section', function () { + it('throws an error', function () { + assert.throws(function () { + Mustache.parse('A list: {{#people}}{{name}}'); + }, /unclosed section "people" at 27/i); + }); + }); + + describe('when there is an unopened section', function () { + it('throws an error', function () { + assert.throws(function () { + Mustache.parse('The end of the list! {{/people}}'); + }, /unopened section "people" at 21/i); + }); + }); + + describe('when invalid tags are given as an argument', function () { + it('throws an error', function () { + assert.throws(function () { + Mustache.parse('A template <% name %>', [ '<%' ]); + }, /invalid tags/i); + }); + }); + + describe('when the template contains invalid tags', function () { + it('throws an error', function () { + assert.throws(function () { + Mustache.parse('A template {{=<%=}}'); + }, /invalid tags/i); + }); + }); + +}); diff --git a/pacotes/mustache.js-master/test/render-test.js b/pacotes/mustache.js-master/test/render-test.js new file mode 100644 index 0000000..a011678 --- /dev/null +++ b/pacotes/mustache.js-master/test/render-test.js @@ -0,0 +1,68 @@ +require('./helper'); + +var fs = require('fs'); +var path = require('path'); +var _files = path.join(__dirname, '_files'); + +function getContents(testName, ext) { + return fs.readFileSync(path.join(_files, testName + '.' + ext), 'utf8'); +} + +function getView(testName) { + var view = getContents(testName, 'js'); + if (!view) throw new Error('Cannot find view for test "' + testName + '"'); + return eval(view); +} + +function getPartial(testName) { + try { + return getContents(testName, 'partial'); + } catch (error) { + // No big deal. Not all tests need to test partial support. + } +} + +function getTest(testName) { + var test = {}; + test.view = getView(testName); + test.template = getContents(testName, 'mustache'); + test.partial = getPartial(testName); + test.expect = getContents(testName, 'txt'); + return test; +} + +// You can put the name of a specific test to run in the TEST environment +// variable (e.g. TEST=backslashes vows test/render-test.js) +var testToRun = process.env.TEST; + +var testNames; +if (testToRun) { + testNames = [testToRun]; +} else { + testNames = fs.readdirSync(_files).filter(function (file) { + return (/\.js$/).test(file); + }).map(function (file) { + return path.basename(file).replace(/\.js$/, ''); + }); +} + +describe('Mustache.render', function () { + beforeEach(function () { + Mustache.clearCache(); + }); + + testNames.forEach(function (testName) { + var test = getTest(testName); + + it('knows how to render ' + testName, function () { + var output; + if (test.partial) { + output = Mustache.render(test.template, test.view, { partial: test.partial }); + } else { + output = Mustache.render(test.template, test.view); + } + + assert.equal(output, test.expect); + }); + }); +}); diff --git a/pacotes/mustache.js-master/test/scanner-test.js b/pacotes/mustache.js-master/test/scanner-test.js new file mode 100644 index 0000000..9c97664 --- /dev/null +++ b/pacotes/mustache.js-master/test/scanner-test.js @@ -0,0 +1,78 @@ +require('./helper'); +var Scanner = Mustache.Scanner; + +describe('A new Mustache.Scanner', function () { + describe('for an empty string', function () { + it('is at the end', function () { + var scanner = new Scanner(''); + assert(scanner.eos()); + }); + }); + + describe('for a non-empty string', function () { + var scanner; + beforeEach(function () { + scanner = new Scanner('a b c'); + }); + + describe('scan', function () { + describe('when the RegExp matches the entire string', function () { + it('returns the entire string', function () { + var match = scanner.scan(/a b c/); + assert.equal(match, scanner.string); + assert(scanner.eos()); + }); + }); + + describe('when the RegExp matches at index 0', function () { + it('returns the portion of the string that matched', function () { + var match = scanner.scan(/a/); + assert.equal(match, 'a'); + assert.equal(scanner.pos, 1); + }); + }); + + describe('when the RegExp matches at some index other than 0', function () { + it('returns the empty string', function () { + var match = scanner.scan(/b/); + assert.equal(match, ''); + assert.equal(scanner.pos, 0); + }); + }); + + describe('when the RegExp does not match', function () { + it('returns the empty string', function () { + var match = scanner.scan(/z/); + assert.equal(match, ''); + assert.equal(scanner.pos, 0); + }); + }); + }); // scan + + describe('scanUntil', function () { + describe('when the RegExp matches at index 0', function () { + it('returns the empty string', function () { + var match = scanner.scanUntil(/a/); + assert.equal(match, ''); + assert.equal(scanner.pos, 0); + }); + }); + + describe('when the RegExp matches at some index other than 0', function () { + it('returns the string up to that index', function () { + var match = scanner.scanUntil(/b/); + assert.equal(match, 'a '); + assert.equal(scanner.pos, 2); + }); + }); + + describe('when the RegExp does not match', function () { + it('returns the entire string', function () { + var match = scanner.scanUntil(/z/); + assert.equal(match, scanner.string); + assert(scanner.eos()); + }); + }); + }); // scanUntil + }); // for a non-empty string +}); diff --git a/pacotes/mustache.js-master/wrappers/dojo/mustache.js.post b/pacotes/mustache.js-master/wrappers/dojo/mustache.js.post new file mode 100644 index 0000000..eeeb4b7 --- /dev/null +++ b/pacotes/mustache.js-master/wrappers/dojo/mustache.js.post @@ -0,0 +1,4 @@ + + dojox.mustache = dojo.hitch(Mustache, "render"); + +})(); \ No newline at end of file diff --git a/pacotes/mustache.js-master/wrappers/dojo/mustache.js.pre b/pacotes/mustache.js-master/wrappers/dojo/mustache.js.pre new file mode 100644 index 0000000..f87f3cd --- /dev/null +++ b/pacotes/mustache.js-master/wrappers/dojo/mustache.js.pre @@ -0,0 +1,9 @@ +/* +Shameless port of a shameless port +@defunkt => @janl => @aq => @voodootikigod + +See http://github.com/defunkt/mustache for more info. +*/ + +dojo.provide("dojox.mustache._base"); +(function(){ diff --git a/pacotes/mustache.js-master/wrappers/jquery/mustache.js.post b/pacotes/mustache.js-master/wrappers/jquery/mustache.js.post new file mode 100644 index 0000000..3209e91 --- /dev/null +++ b/pacotes/mustache.js-master/wrappers/jquery/mustache.js.post @@ -0,0 +1,13 @@ + $.mustache = function (template, view, partials) { + return Mustache.render(template, view, partials); + }; + + $.fn.mustache = function (view, partials) { + return $(this).map(function (i, elm) { + var template = $.trim($(elm).html()); + var output = $.mustache(template, view, partials); + return $(output).get(); + }); + }; + +})(jQuery); diff --git a/pacotes/mustache.js-master/wrappers/jquery/mustache.js.pre b/pacotes/mustache.js-master/wrappers/jquery/mustache.js.pre new file mode 100644 index 0000000..b4d8af5 --- /dev/null +++ b/pacotes/mustache.js-master/wrappers/jquery/mustache.js.pre @@ -0,0 +1,9 @@ +/* +Shameless port of a shameless port +@defunkt => @janl => @aq + +See http://github.com/defunkt/mustache for more info. +*/ + +;(function($) { + diff --git a/pacotes/mustache.js-master/wrappers/mootools/mustache.js.post b/pacotes/mustache.js-master/wrappers/mootools/mustache.js.post new file mode 100644 index 0000000..aa9b8fa --- /dev/null +++ b/pacotes/mustache.js-master/wrappers/mootools/mustache.js.post @@ -0,0 +1,5 @@ + + Object.implement('mustache', function(view, partials){ + return Mustache.render(view, this, partials); + }); +})(); diff --git a/pacotes/mustache.js-master/wrappers/mootools/mustache.js.pre b/pacotes/mustache.js-master/wrappers/mootools/mustache.js.pre new file mode 100644 index 0000000..9839f99 --- /dev/null +++ b/pacotes/mustache.js-master/wrappers/mootools/mustache.js.pre @@ -0,0 +1,2 @@ +(function(){ + diff --git a/pacotes/mustache.js-master/wrappers/qooxdoo/mustache.js.post b/pacotes/mustache.js-master/wrappers/qooxdoo/mustache.js.post new file mode 100644 index 0000000..6488b9c --- /dev/null +++ b/pacotes/mustache.js-master/wrappers/qooxdoo/mustache.js.post @@ -0,0 +1,9 @@ +/** + * Above is the original mustache code. + */ + +// EXPOSE qooxdoo variant +qx.bom.Template.version = this.Mustache.version; +qx.bom.Template.render = this.Mustache.render; + +}).call({}); \ No newline at end of file diff --git a/pacotes/mustache.js-master/wrappers/qooxdoo/mustache.js.pre b/pacotes/mustache.js-master/wrappers/qooxdoo/mustache.js.pre new file mode 100644 index 0000000..1512a00 --- /dev/null +++ b/pacotes/mustache.js-master/wrappers/qooxdoo/mustache.js.pre @@ -0,0 +1,172 @@ +/* ************************************************************************ + + qooxdoo - the new era of web development + + http://qooxdoo.org + + Copyright: + 2004-2012 1&1 Internet AG, Germany, http://www.1und1.de + + License: + LGPL: http://www.gnu.org/licenses/lgpl.html + EPL: http://www.eclipse.org/org/documents/epl-v10.php + See the LICENSE file in the project's top-level directory for details. + + Authors: + * Martin Wittemann (martinwittemann) + + ====================================================================== + + This class contains code based on the following work: + + * Mustache.js version 0.8.0 + + Code: + https://github.com/janl/mustache.js + + Copyright: + (c) 2009 Chris Wanstrath (Ruby) + (c) 2010 Jan Lehnardt (JavaScript) + + License: + MIT: http://www.opensource.org/licenses/mit-license.php + + ---------------------------------------------------------------------- + + Copyright (c) 2009 Chris Wanstrath (Ruby) + Copyright (c) 2010 Jan Lehnardt (JavaScript) + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +************************************************************************ */ + +/** + * The is a template class which can be used for HTML templating. In fact, + * this is a wrapper for mustache.js which is a "framework-agnostic way to + * render logic-free views". + * + * Here is a basic example how to use it: + * Template: + *
+ * var template = "Hi, my name is {{name}}!";
+ * var view = {name: "qooxdoo"};
+ * qx.bom.Template.render(template, view);
+ * // return "Hi, my name is qooxdoo!"
+ * 
+ * + * For further details, please visit the mustache.js documentation here: + * https://github.com/janl/mustache.js/blob/master/README.md + * + * @ignore(module) + */ +qx.Bootstrap.define("qx.bom.Template", { + statics : { + /** Contains the mustache.js version. */ + version: null, + + /** + * Original and only template method of mustache.js. For further + * documentation, please visit https://github.com/janl/mustache.js + * + * @signature function(template, view, partials) + * @param template {String} The String containing the template. + * @param view {Object} The object holding the data to render. + * @param partials {Object} Object holding parts of a template. + * @return {String} The parsed template. + */ + render: null, + + /** + * Combines {@link #render} and {@link #get}. Input is equal to {@link #render} + * and output is equal to {@link #get}. The advantage over {@link #get} + * is that you don't need a HTML template but can use a template + * string and still get a DOM element. Keep in mind that templates + * can only have one root element. + * + * @param template {String} The String containing the template. + * @param view {Object} The object holding the data to render. + * @param partials {Object} Object holding parts of a template. + * @return {Element} A DOM element holding the parsed template data. + */ + renderToNode : function(template, view, partials) { + var renderedTmpl = this.render(template, view, partials); + return this._createNodeFromTemplate(renderedTmpl); + }, + + /** + * Helper method which provides you with a direct access to templates + * stored as HTML in the DOM. The DOM node with the given ID will be used + * as a template, parsed and a new DOM node will be returned containing the + * parsed data. Keep in mind to have only one root DOM element in the the + * template. + * Additionally, you should not put the template into a regular, hidden + * DOM element because the template may not be valid HTML due to the containing + * mustache tags. We suggest to put it into a script tag with the type + * text/template. + * + * @param id {String} The id of the HTML template in the DOM. + * @param view {Object} The object holding the data to render. + * @param partials {Object} Object holding parts of a template. + * @return {Element} A DOM element holding the parsed template data. + */ + get : function(id, view, partials) { + // get the content stored in the DOM + var template = document.getElementById(id); + return this.renderToNode(template.innerHTML, view, partials); + }, + + /** + * Accepts a parsed template and returns a (potentially nested) node. + * + * @param template {String} The String containing the template. + * @return {Element} A DOM element holding the parsed template data. + */ + _createNodeFromTemplate : function(template) { + // template is text only (no html elems) so use text node + if (template.search(/<|>/) === -1) { + return document.createTextNode(template); + } + + // template has html elems so convert string into DOM nodes + var helper = qx.dom.Element.create("div"); + helper.innerHTML = template; + + return helper.children[0]; + } + } +}); + +(function() { +// prevent using CommonJS exports object, +// by shadowing global exports object +var exports; + +// prevent using AMD compatible loader, +// by shadowing global define function +var define; + +/** + * Below is the original mustache.js code. Snapshot date is mentioned in + * the head of this file. + * @ignore(exports) + * @ignore(define.*) + * @ignore(module.*) + * @lint ignoreNoLoopBlock() + */ diff --git a/pacotes/mustache.js-master/wrappers/yui3/mustache.js.post b/pacotes/mustache.js-master/wrappers/yui3/mustache.js.post new file mode 100644 index 0000000..3decbf8 --- /dev/null +++ b/pacotes/mustache.js-master/wrappers/yui3/mustache.js.post @@ -0,0 +1,4 @@ + + Y.mustache = Mustache.render; + +}, "0"); diff --git a/pacotes/mustache.js-master/wrappers/yui3/mustache.js.pre b/pacotes/mustache.js-master/wrappers/yui3/mustache.js.pre new file mode 100644 index 0000000..280de86 --- /dev/null +++ b/pacotes/mustache.js-master/wrappers/yui3/mustache.js.pre @@ -0,0 +1 @@ +YUI.add("mustache", function(Y) { -- libgit2 0.21.2