mustache-js-rails 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of mustache-js-rails might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/lib/mustache-js-rails/version.rb +1 -1
- data/vendor/assets/javascripts/jquery.mustache.js +1 -1
- data/vendor/assets/javascripts/mustache.js +15 -15
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe70b48ee69c0c14080983551dd6aa7b952fd383
|
4
|
+
data.tar.gz: 768ecd0124ff9327f4e0b93f0feb75736ff17d87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30fdf8b400ad236a6a8eb600458adfdc64140da14c69f432f97f7ec75e0f199d3df4c11127c7e3cfd0d902d6e5979b43d0d3c36786036d7775675097c0b4b2e2
|
7
|
+
data.tar.gz: 07d3755af7a32608cf07b77af1d1b10647eb5eceecb6e5b135e1c2fc9b4528b5556bbed09522c93ff80d5b05749730b79f16103bb6e7c98502bdb99e216ff2e6
|
data/README.md
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
# mustache-js-rails
|
2
2
|
|
3
|
-
mustache-js-rails integrates [mustache.js](https://github.com/janl/mustache.js)
|
3
|
+
mustache-js-rails integrates [mustache.js](https://github.com/janl/mustache.js)
|
4
4
|
and [mustache jQuery integration](https://github.com/jonnyreeves/jquery-Mustache) with rails 3.1+ asset pipeline.
|
5
5
|
|
6
6
|
Integrated versions are:
|
7
7
|
|
8
8
|
* mustache.js - <b id="mustache-js-version">0.8.1</b>
|
9
|
-
* jQuery mustache - <b id="
|
10
|
-
|
9
|
+
* jQuery mustache - <b id="jquery-mustache-js-version">0.2.8</b>
|
10
|
+
|
11
11
|
### Installation
|
12
12
|
|
13
13
|
Add
|
14
14
|
|
15
15
|
``` ruby
|
16
|
-
gem 'mustache-js-rails'`
|
16
|
+
gem 'mustache-js-rails'`
|
17
17
|
```
|
18
18
|
|
19
19
|
to your `Gemfile`
|
@@ -19,13 +19,6 @@
|
|
19
19
|
}
|
20
20
|
}(this, function (mustache) {
|
21
21
|
|
22
|
-
var whiteRe = /\s*/;
|
23
|
-
var spaceRe = /\s+/;
|
24
|
-
var nonSpaceRe = /\S/;
|
25
|
-
var eqRe = /\s*=/;
|
26
|
-
var curlyRe = /\s*\}/;
|
27
|
-
var tagRe = /#|\^|\/|>|\{|&|=|!/;
|
28
|
-
|
29
22
|
// Workaround for https://issues.apache.org/jira/browse/COUCHDB-577
|
30
23
|
// See https://github.com/janl/mustache.js/issues/189
|
31
24
|
var RegExp_test = RegExp.prototype.test;
|
@@ -33,6 +26,7 @@
|
|
33
26
|
return RegExp_test.call(re, string);
|
34
27
|
}
|
35
28
|
|
29
|
+
var nonSpaceRe = /\S/;
|
36
30
|
function isWhitespace(string) {
|
37
31
|
return !testRegExp(nonSpaceRe, string);
|
38
32
|
}
|
@@ -76,6 +70,12 @@
|
|
76
70
|
];
|
77
71
|
}
|
78
72
|
|
73
|
+
var whiteRe = /\s*/;
|
74
|
+
var spaceRe = /\s+/;
|
75
|
+
var equalsRe = /\s*=/;
|
76
|
+
var curlyRe = /\s*\}/;
|
77
|
+
var tagRe = /#|\^|\/|>|\{|&|=|!/;
|
78
|
+
|
79
79
|
/**
|
80
80
|
* Breaks up the given `template` string into a tree of tokens. If the `tags`
|
81
81
|
* argument is given here it must be an array with two string values: the
|
@@ -85,18 +85,18 @@
|
|
85
85
|
* A token is an array with at least 4 elements. The first element is the
|
86
86
|
* mustache symbol that was used inside the tag, e.g. "#" or "&". If the tag
|
87
87
|
* did not contain a symbol (i.e. {{myValue}}) this element is "name". For
|
88
|
-
* all
|
88
|
+
* all text that appears outside a symbol this element is "text".
|
89
89
|
*
|
90
90
|
* The second element of a token is its "value". For mustache tags this is
|
91
91
|
* whatever else was inside the tag besides the opening symbol. For text tokens
|
92
92
|
* this is the text itself.
|
93
93
|
*
|
94
|
-
* The third and fourth elements of the token are the start and end indices
|
95
|
-
*
|
94
|
+
* The third and fourth elements of the token are the start and end indices,
|
95
|
+
* respectively, of the token in the original template.
|
96
96
|
*
|
97
|
-
* Tokens that are the root node of a subtree contain two more elements: an
|
98
|
-
* array of tokens in the subtree and the index in the original template at
|
99
|
-
* the closing tag for that section begins.
|
97
|
+
* Tokens that are the root node of a subtree contain two more elements: 1) an
|
98
|
+
* array of tokens in the subtree and 2) the index in the original template at
|
99
|
+
* which the closing tag for that section begins.
|
100
100
|
*/
|
101
101
|
function parseTemplate(template, tags) {
|
102
102
|
tags = tags || mustache.tags;
|
@@ -166,8 +166,8 @@
|
|
166
166
|
|
167
167
|
// Get the tag value.
|
168
168
|
if (type === '=') {
|
169
|
-
value = scanner.scanUntil(
|
170
|
-
scanner.scan(
|
169
|
+
value = scanner.scanUntil(equalsRe);
|
170
|
+
scanner.scan(equalsRe);
|
171
171
|
scanner.scanUntil(tagRes[1]);
|
172
172
|
} else if (type === '{') {
|
173
173
|
value = scanner.scanUntil(new RegExp('\\s*' + escapeRegExp('}' + tags[1])));
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mustache-js-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Krzysztof Knapik
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-03-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -33,15 +33,15 @@ executables: []
|
|
33
33
|
extensions: []
|
34
34
|
extra_rdoc_files: []
|
35
35
|
files:
|
36
|
-
- vendor/assets/javascripts/jquery.mustache.js
|
37
|
-
- vendor/assets/javascripts/mustache.js
|
38
|
-
- lib/mustache-js-rails/engine.rb
|
39
|
-
- lib/mustache-js-rails/version.rb
|
40
|
-
- lib/mustache-js-rails.rb
|
41
|
-
- MIT-LICENSE
|
42
|
-
- Rakefile
|
43
36
|
- Gemfile
|
37
|
+
- MIT-LICENSE
|
44
38
|
- README.md
|
39
|
+
- Rakefile
|
40
|
+
- lib/mustache-js-rails.rb
|
41
|
+
- lib/mustache-js-rails/engine.rb
|
42
|
+
- lib/mustache-js-rails/version.rb
|
43
|
+
- vendor/assets/javascripts/jquery.mustache.js
|
44
|
+
- vendor/assets/javascripts/mustache.js
|
45
45
|
homepage: https://github.com/knapo/mustache-js-rails
|
46
46
|
licenses: []
|
47
47
|
metadata: {}
|
@@ -61,7 +61,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
61
61
|
version: '0'
|
62
62
|
requirements: []
|
63
63
|
rubyforge_project: mustache-js-rails
|
64
|
-
rubygems_version: 2.
|
64
|
+
rubygems_version: 2.2.2
|
65
65
|
signing_key:
|
66
66
|
specification_version: 4
|
67
67
|
summary: mustache.js and jQuery.mustache.js for Rails 3.1+ asset pipeline
|