sprockets-dotjs 2.0.3 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +1 -0
- data/README.md +4 -6
- data/app/assets/javascripts/encode_html.js +2 -2
- data/lib/sprockets-dotjs/version.rb +1 -1
- metadata +3 -3
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# Sprockets::Dotjs
|
2
2
|
|
3
|
-
|
3
|
+
Compile doT.JS templates (`jst.djs` extension) into rails `JST` env variable
|
4
|
+
|
5
|
+
Supports doT.JS partial feature by using Sprocket's `depend_on` directive
|
4
6
|
|
5
7
|
## Installation
|
6
8
|
|
@@ -12,13 +14,9 @@ And then execute:
|
|
12
14
|
|
13
15
|
$ bundle
|
14
16
|
|
15
|
-
Or install it yourself as:
|
16
|
-
|
17
|
-
$ gem install sprockets-dotjs
|
18
|
-
|
19
17
|
## Usage
|
20
18
|
|
21
|
-
|
19
|
+
Put doT.js template files inside the `assets/javascript` directory and generate them by calling `JST["#{file_path}"]()`
|
22
20
|
|
23
21
|
## Contributing
|
24
22
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
function encodeHTMLSource() {
|
2
|
-
var encodeHTMLRules = { "&": "&", "<": "<", ">": ">", '"': '"', "'": ''', "/": '/' },
|
3
|
-
matchHTML = /&(?!#?\w+;)|<|>|"|'
|
2
|
+
var encodeHTMLRules = { "&": "&", "<": "<", ">": ">", '"': '"', "'": ''', "/": '/', "\n": '<br>' },
|
3
|
+
matchHTML = /&(?!#?\w+;)|<|>|"|'|\/\n/g;
|
4
4
|
return function() {
|
5
5
|
return this ? this.replace(matchHTML, function(m) {return encodeHTMLRules[m] || m;}) : this;
|
6
6
|
};
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sprockets-dotjs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-03-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sprockets
|
@@ -166,7 +166,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
166
166
|
version: '0'
|
167
167
|
requirements: []
|
168
168
|
rubyforge_project:
|
169
|
-
rubygems_version: 1.8.
|
169
|
+
rubygems_version: 1.8.25
|
170
170
|
signing_key:
|
171
171
|
specification_version: 3
|
172
172
|
summary: Compile dot.js template into javascript
|