shared_mustache 0.1.3 → 0.2.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/README.md +15 -4
- data/lib/shared_mustache/version.rb +1 -1
- metadata +11 -27
- data/vendor/assets/javascripts/templates.js +0 -0
data/README.md
CHANGED
@@ -1,10 +1,15 @@
|
|
1
1
|
# SharedMustache
|
2
2
|
|
3
3
|
Add the ability to share [mustache][mustache] templates in Rails and
|
4
|
-
JavaScript.
|
5
|
-
then compiled into your JavaScript using the asset-pipeline.
|
4
|
+
JavaScript.
|
6
5
|
|
7
|
-
|
6
|
+
Mustache templates will be rendered using Ruby mustache on the server.
|
7
|
+
|
8
|
+
On the client there is a jQuery helper to let you use the template. In
|
9
|
+
development the templates are outputted on the page in script blocks. For
|
10
|
+
production the templates are compiled using [hogan.js][hogan], the compiled
|
11
|
+
templates can then be included into your standard JavaScript file using the
|
12
|
+
asset-pipeline.
|
8
13
|
|
9
14
|
## Installation
|
10
15
|
|
@@ -12,13 +17,17 @@ Add 'shared_mustache' to your your application's Gemfile.
|
|
12
17
|
|
13
18
|
By default when you run `rake shared_mustache:compile` it will put the outputed
|
14
19
|
templates JavaScript at `Rails.root/app/assets/javascript/templates.js`. This
|
15
|
-
can be configured using an intializer.
|
20
|
+
can be configured using an intializer. The `templates.js` file should be kept
|
21
|
+
empty for development and only populated in production.
|
16
22
|
|
17
23
|
You should add the following lines to your `application.js`:
|
18
24
|
|
19
25
|
//= require shared_mustache
|
20
26
|
//= require templates
|
21
27
|
|
28
|
+
This adds the jQuery helper for you to use the templates and in production will
|
29
|
+
add the compiled templates.
|
30
|
+
|
22
31
|
At the bottom of your main layout you should add:
|
23
32
|
|
24
33
|
<%= render_mustache_templates if Rails.env.development? %>
|
@@ -46,3 +55,5 @@ mustache templates:
|
|
46
55
|
$.mustache('home/_row', context);
|
47
56
|
|
48
57
|
|
58
|
+
[mustache]: http://mustache.github.io/
|
59
|
+
[hogan]: http://twitter.github.io/hogan.js/
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shared_mustache
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2015-01-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mustache
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirement: &9019840 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,15 +21,10 @@ dependencies:
|
|
21
21
|
version: 0.99.4
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
25
|
-
none: false
|
26
|
-
requirements:
|
27
|
-
- - ~>
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: 0.99.4
|
24
|
+
version_requirements: *9019840
|
30
25
|
- !ruby/object:Gem::Dependency
|
31
26
|
name: execjs
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
27
|
+
requirement: &9019260 !ruby/object:Gem::Requirement
|
33
28
|
none: false
|
34
29
|
requirements:
|
35
30
|
- - ! '>='
|
@@ -37,15 +32,10 @@ dependencies:
|
|
37
32
|
version: 1.2.4
|
38
33
|
type: :runtime
|
39
34
|
prerelease: false
|
40
|
-
version_requirements:
|
41
|
-
none: false
|
42
|
-
requirements:
|
43
|
-
- - ! '>='
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
version: 1.2.4
|
35
|
+
version_requirements: *9019260
|
46
36
|
- !ruby/object:Gem::Dependency
|
47
37
|
name: gem_publisher
|
48
|
-
requirement: !ruby/object:Gem::Requirement
|
38
|
+
requirement: &9018780 !ruby/object:Gem::Requirement
|
49
39
|
none: false
|
50
40
|
requirements:
|
51
41
|
- - ~>
|
@@ -53,12 +43,7 @@ dependencies:
|
|
53
43
|
version: 1.1.1
|
54
44
|
type: :development
|
55
45
|
prerelease: false
|
56
|
-
version_requirements:
|
57
|
-
none: false
|
58
|
-
requirements:
|
59
|
-
- - ~>
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: 1.1.1
|
46
|
+
version_requirements: *9018780
|
62
47
|
description: Share mustache between Rails templates and the browser (using compiled
|
63
48
|
hogan.js templates).
|
64
49
|
email:
|
@@ -87,7 +72,6 @@ files:
|
|
87
72
|
- vendor/assets/javascripts/shared_mustache.js
|
88
73
|
- vendor/assets/javascripts/shared_mustache/mustache-loader.js
|
89
74
|
- vendor/assets/javascripts/shared_mustache/template-2.0.0.js
|
90
|
-
- vendor/assets/javascripts/templates.js
|
91
75
|
homepage: ''
|
92
76
|
licenses: []
|
93
77
|
post_install_message:
|
@@ -102,7 +86,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
102
86
|
version: '0'
|
103
87
|
segments:
|
104
88
|
- 0
|
105
|
-
hash:
|
89
|
+
hash: -3854426233594066840
|
106
90
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
107
91
|
none: false
|
108
92
|
requirements:
|
@@ -111,10 +95,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
111
95
|
version: '0'
|
112
96
|
segments:
|
113
97
|
- 0
|
114
|
-
hash:
|
98
|
+
hash: -3854426233594066840
|
115
99
|
requirements: []
|
116
100
|
rubyforge_project:
|
117
|
-
rubygems_version: 1.8.
|
101
|
+
rubygems_version: 1.8.11
|
118
102
|
signing_key:
|
119
103
|
specification_version: 3
|
120
104
|
summary: Share mustache between Rails templates and the browser (using compiled hogan.js
|
File without changes
|