handlebars_assets 0.8.1 → 0.23.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +2 -0
- data/.ruby-gemset +1 -0
- data/Appraisals +15 -0
- data/CHANGELOG.md +159 -1
- data/README.md +182 -72
- data/Rakefile +5 -1
- data/gemfiles/rails_4_1.gemfile +8 -0
- data/gemfiles/rails_4_2.gemfile +8 -0
- data/gemfiles/rails_5.gemfile +8 -0
- data/gemfiles/sprockets_2.gemfile +7 -0
- data/gemfiles/sprockets_3.gemfile +7 -0
- data/gemfiles/tilt_1.gemfile +7 -0
- data/gemfiles/tilt_2.gemfile +7 -0
- data/handlebars_assets.gemspec +14 -7
- data/lib/handlebars_assets/config.rb +92 -4
- data/lib/handlebars_assets/engine.rb +8 -5
- data/lib/handlebars_assets/handlebars.rb +27 -3
- data/lib/handlebars_assets/handlebars_template.rb +267 -0
- data/lib/handlebars_assets/version.rb +1 -1
- data/lib/handlebars_assets.rb +48 -11
- data/test/edge/handlebars.js +3 -1913
- data/test/handlebars_assets/compiling_test.rb +30 -0
- data/test/handlebars_assets/hamlbars_test.rb +3 -3
- data/test/handlebars_assets/handlebars_processor_test.rb +17 -0
- data/test/handlebars_assets/shared/adapter_tests.rb +199 -0
- data/test/handlebars_assets/slimbars_test.rb +28 -0
- data/test/handlebars_assets/tilt_handlebars_test.rb +6 -132
- data/test/patch/patch.js +10 -0
- data/test/test_helper.rb +18 -14
- data/vendor/assets/javascripts/handlebars.js +5189 -1918
- data/vendor/assets/javascripts/handlebars.runtime.js +1779 -235
- metadata +101 -55
- data/.rvmrc +0 -1
- data/Gemfile.lock +0 -32
- data/lib/handlebars_assets/tilt_handlebars.rb +0 -105
- data/test/handlebars_assets/tilt_edge_test.rb +0 -26
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 3b8ceb4548238c9b3a365c3da46706a80b06760d1e95aac001f01770de211e69
|
4
|
+
data.tar.gz: 3b69cc88fa7ec491206130bf7a06eb7d391fcd8c22b4ffa3d54fef825bfadfd0
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b4b77318777f01b8e700fb748ce28658ce581d67ef546a47992623d3fc74eb3cf2fec4e79fa68c8cd2fefa57f85ef68db992006d6d8c2e5e6c68a4bb1cd9758e
|
7
|
+
data.tar.gz: 5cadc9ebc6ef867f270f8f85e30649ac9a2c675e217317a4775f770f3a6584bd428482c2766469255b3516be5d4156b51e96b42f085d58e99dc3d9e6bb66238b
|
data/.gitignore
CHANGED
data/.ruby-gemset
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
handlebars_assets
|
data/Appraisals
ADDED
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,162 @@
|
|
1
|
-
##
|
1
|
+
## 0.23.8 (2021-03-18)
|
2
|
+
|
3
|
+
* Update Handlebars to v4.7.7
|
4
|
+
|
5
|
+
## 0.23.8 (2019-02-24)
|
6
|
+
|
7
|
+
* Update Handlebars to v4.7.3
|
8
|
+
|
9
|
+
## 0.23.7 (2019-11-20)
|
10
|
+
|
11
|
+
* Update Handlebars to v4.5.3
|
12
|
+
|
13
|
+
## 0.23.6 (2019-11-14)
|
14
|
+
|
15
|
+
* Update Handlebars to v4.5.2
|
16
|
+
|
17
|
+
## 0.23.5 (2019-09-25)
|
18
|
+
|
19
|
+
* Update Handlebars to v4.3.1
|
20
|
+
|
21
|
+
## 0.23.4 (2019-06-03)
|
22
|
+
|
23
|
+
* Update Handlebars to v4.1.2
|
24
|
+
|
25
|
+
## 0.23.3 (2019-02-20)
|
26
|
+
|
27
|
+
* Update Handlebars to v4.1.0
|
28
|
+
|
29
|
+
## 0.23.2 (2017-05-07)
|
30
|
+
|
31
|
+
* Remove requirement for MultiJSON
|
32
|
+
|
33
|
+
## 0.23.1 (2016-08-04)
|
34
|
+
|
35
|
+
* Fixes for Issue on Boot with Rails 3 and 4
|
36
|
+
|
37
|
+
## 0.23.0 (2016-01-26)
|
38
|
+
|
39
|
+
* Fixes for Railties and certain versions of Rails
|
40
|
+
* Only load if asset compilation is enabled
|
41
|
+
* Add support for Sprockets 3.x + 4.x - @tjgrathwell
|
42
|
+
|
43
|
+
## 0.22.0 (2015-11-23)
|
44
|
+
|
45
|
+
* Update Handlebars to v4.0.5
|
46
|
+
|
47
|
+
## 0.21.0 (2015-02-24)
|
48
|
+
|
49
|
+
* Update Handlebars to v4.0.2
|
50
|
+
|
51
|
+
## 0.20.2 (2015-02-24)
|
52
|
+
|
53
|
+
* Relax Sprockets Dependencies - @rounders
|
54
|
+
* Add option to CHOMP underscores on partials - @GreyKn
|
55
|
+
|
56
|
+
## 0.20.1 (2015-02-24)
|
57
|
+
|
58
|
+
* Actually revert to native HB.js
|
59
|
+
|
60
|
+
## 0.20 (2015-02-23)
|
61
|
+
|
62
|
+
* Fix issues with window object, revert to native HB.js
|
63
|
+
* Fix extension handling bug on some versions of rails
|
64
|
+
|
65
|
+
## 0.19 (2015-02-18)
|
66
|
+
|
67
|
+
* Upgrade to Handlebars v3.0
|
68
|
+
* Re-fix the issue regarding sprockets
|
69
|
+
|
70
|
+
## 0.18.1 (2015-02-18)
|
71
|
+
|
72
|
+
* Fix issue regarding sprockets versioning of assets
|
73
|
+
|
74
|
+
## 0.18 (2014-09-08)
|
75
|
+
|
76
|
+
* Update to handlebars v2.0.0 - @AlexRiedler
|
77
|
+
|
78
|
+
## 0.17.2 (2014-09-08)
|
79
|
+
|
80
|
+
* Support for Ruby v1.8 - @blainekasten
|
81
|
+
|
82
|
+
## 0.17.1 (2014-06-28)
|
83
|
+
|
84
|
+
* Fix engine initialization error on rails during assets precompile - @AlexRiedler
|
85
|
+
|
86
|
+
## 0.17 (2014-06-22)
|
87
|
+
|
88
|
+
* Massive revamp - @AlexRiedler
|
89
|
+
* Changed how sprockets is registered - @AlexRiedler
|
90
|
+
* AMD loading - @AlexRiedler, based on @pboling changes (THANKS!)
|
91
|
+
* Fix extension being too liberal issues - @langalex
|
92
|
+
|
93
|
+
## 0.16 (2014-05-27)
|
94
|
+
|
95
|
+
* README clarification - @jithugopal
|
96
|
+
* Upgrade `handlebars` to 1.3 - @neodude
|
97
|
+
|
98
|
+
## 0.15 (2013-12-06)
|
99
|
+
|
100
|
+
* Allow use of ember and other handlebars simultaneously - @rbhitchcock
|
101
|
+
* Fix multi-framework to allow hbs, hamlbars, and slimbars - @Darep
|
102
|
+
* Add `hamlbars` usage example - @mattmenefee
|
103
|
+
* README section for `multiple_frameworks` - @sorentwo
|
104
|
+
* README clarification - @panchoqv
|
105
|
+
* README cleanup - @dmarkow
|
106
|
+
* README cleanup additional - @AlexRiedler
|
107
|
+
* Upgrade `handlebars` to 1.1.2 - @sorentwo
|
108
|
+
* Fix MultiJson dependency - @AlexRiedler
|
109
|
+
|
110
|
+
## 0.14.1 (2013-06-21)
|
111
|
+
|
112
|
+
* Roll back "Register with Sprockets instead of `app.assets`" until we can get a definitive answer on what the problem really is.
|
113
|
+
|
114
|
+
## 0.14.0 (2013-06-19)
|
115
|
+
|
116
|
+
* Register with Sprockets instead of `app.assets` - @metaskills
|
117
|
+
|
118
|
+
## 0.13.0 (2013-06-02)
|
119
|
+
|
120
|
+
* Update to handlebars 1.0.0 - @lee
|
121
|
+
|
122
|
+
## 0.12.3 (2013-05-28)
|
123
|
+
|
124
|
+
* Pass scope and locals up the chain - @AlexRiedler
|
125
|
+
* Nicer rvmrc - @AlexRiedler
|
126
|
+
* Allow configure block - @AlexRiedler
|
127
|
+
|
128
|
+
## 0.12.2 (2013-05-27)
|
129
|
+
|
130
|
+
* Synchronize Sprockets engine registers with Rails - @mark-rushakoff
|
131
|
+
|
132
|
+
## 0.12.1 (2013-05-21)
|
133
|
+
|
134
|
+
* Update to handlebars 1.0.0-rc.4 - @turadg
|
135
|
+
|
136
|
+
## 0.12.0 (2013-02-17)
|
137
|
+
|
138
|
+
* Support for patching `handlebars.js`
|
139
|
+
* Make `test` the default Rake task
|
140
|
+
* Update dev env to use `haml` v4.0.0
|
141
|
+
|
142
|
+
## 0.11.0 (2013-02-15)
|
143
|
+
|
144
|
+
* Update to handlebars.js 1.0.0-rc.3 - @akshayrawat
|
145
|
+
* Add github markdown to README - @phlipper
|
146
|
+
|
147
|
+
## 0.10.0 (2013-01-29)
|
148
|
+
|
149
|
+
* Support `.slimbars` extension for Slim templates - @davidlee
|
150
|
+
|
151
|
+
## 0.9.0 (2013-01-25)
|
152
|
+
|
153
|
+
* Update to [this commit](https://github.com/wycats/handlebars.js/commit/a3376e24b1a25f72cf86d1d999bd2ea93fa4dc39) of `handlebars.js`
|
154
|
+
* The hack that converted partial names to underscored paths (`shared/_time` -> `_shared_time`) is no longer necessary and has been removed. You should change all the partial references in your app when going to v0.9.x.
|
155
|
+
|
156
|
+
## 0.8.2
|
157
|
+
|
158
|
+
* Update to [this commit](https://github.com/wycats/handlebars.js/commit/5e5f0dce9c352f490f1f1e58fd7d0f76dd006cac) of `handlebars.js`
|
159
|
+
* Fix to allow Ember.js template support when not using Rails
|
2
160
|
|
3
161
|
## 0.8.1
|
4
162
|
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Use handlebars.js templates with the asset pipeline and sprockets
|
1
|
+
# Use handlebars.js templates with the asset pipeline and/or sprockets
|
2
2
|
|
3
3
|
Are your `handlebars.js` templates littering your Rails views with `script` tags? Wondering why the nifty Rails 3.1 asset pipeline streamlines all your JavaScript except for your Handlebars templates? Wouldn't it be nice to have your Handlebars templates compiled, compressed, and cached like your other JavaScript?
|
4
4
|
|
@@ -6,49 +6,92 @@ Yea, I think so too. That is why I wrote **handlebars_assets**. Give your Handle
|
|
6
6
|
|
7
7
|
Using `sprockets` with Sinatra or another framework? **handlebars_assets** works outside of Rails too (as of v0.2.0)
|
8
8
|
|
9
|
-
|
9
|
+
# BREAKING CHANGES AS OF OF v0.17
|
10
10
|
|
11
|
-
|
11
|
+
@AlexRiedler has made some larger changes to this repository for going forward; If you have existing monkey patches they may not work, and the configuration schema has changed slightly to handle multiple extensions for the same compilation pipeline.
|
12
12
|
|
13
|
-
|
13
|
+
If you have any problems, please post an issue! I will attempt to fix ASAP
|
14
14
|
|
15
|
-
|
15
|
+
# BREAKING CHANGE AS OF v0.9.0
|
16
|
+
|
17
|
+
My pull request to allow `/` in partials was pulled into Handlebars. The hack that converted partial names to underscored paths (`shared/_time` -> `_shared_time`) is no longer necessary and has been removed. You should change all the partial references in your app when upgrading from a version prior to v0.9.0.
|
18
|
+
|
19
|
+
# Version of handlebars.js
|
20
|
+
|
21
|
+
`handlebars_assets` is packaged with the current stable release of `handlebars.js`. See the section on using another version if that does not work for you.
|
22
|
+
|
23
|
+
# Installation
|
24
|
+
|
25
|
+
## Rails 4.0+
|
26
|
+
|
27
|
+
Load `handlebars_assets` in your `Gemfile`
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
gem 'handlebars_assets'
|
31
|
+
```
|
32
|
+
|
33
|
+
Then follow [Javascript Setup](#javascript-setup)
|
34
|
+
|
35
|
+
Side Note: _As of Rails 4.0, the `assets` group is not supported in the Gemfile ([source](http://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html#upgrading-from-rails-3-2-to-rails-4-0-gemfile))._
|
36
|
+
|
37
|
+
## Rails 3.1+
|
16
38
|
|
17
39
|
Load `handlebars_assets` in your `Gemfile` as part of the `assets` group
|
18
40
|
|
19
|
-
|
20
|
-
|
21
|
-
|
41
|
+
```ruby
|
42
|
+
group :assets do
|
43
|
+
gem 'handlebars_assets'
|
44
|
+
end
|
45
|
+
```
|
46
|
+
|
47
|
+
Then follow [Javascript Setup](#javascript-setup)
|
22
48
|
|
23
|
-
##
|
49
|
+
## Sprockets (Non-Rails)
|
24
50
|
|
25
51
|
`handlebars_assets` can work with earlier versions of Rails or other frameworks like Sinatra.
|
26
52
|
|
27
53
|
Load `handlebars_assets` in your `Gemfile`
|
28
54
|
|
29
|
-
|
55
|
+
```ruby
|
56
|
+
gem 'handlebars_assets'
|
57
|
+
```
|
30
58
|
|
31
59
|
Add the `HandlebarsAssets.path` to your `Sprockets::Environment` instance. This
|
32
60
|
lets Sprockets know where the Handlebars JavaScript files are and is required
|
33
61
|
for the next steps to work.
|
34
62
|
|
35
|
-
|
63
|
+
```ruby
|
64
|
+
env = Sprockets::Environment.new
|
36
65
|
|
37
|
-
|
38
|
-
|
66
|
+
require 'handlebars_assets'
|
67
|
+
env.append_path HandlebarsAssets.path
|
68
|
+
```
|
39
69
|
|
40
|
-
|
41
|
-
# Compiling your JavaScript templates in the Rails asset pipeline
|
70
|
+
## Javascript Setup
|
42
71
|
|
43
72
|
Require `handlebars.runtime.js` in your JavaScript manifest (i.e. `application.js`)
|
44
73
|
|
45
|
-
|
74
|
+
```javascript
|
75
|
+
//= require handlebars.runtime
|
76
|
+
```
|
46
77
|
|
47
78
|
If you need to compile your JavaScript templates in the browser as well, you should instead require `handlebars.js` (which is significantly larger)
|
48
79
|
|
49
|
-
|
80
|
+
```javascript
|
81
|
+
//= require handlebars
|
82
|
+
```
|
83
|
+
|
84
|
+
### Templates directory
|
50
85
|
|
51
|
-
|
86
|
+
Generally you want to locate your template with your other assets, for example `app/assets/javascripts/templates`. In your JavaScript manifest file, use `require_tree` to pull in the templates
|
87
|
+
|
88
|
+
> app/assets/javascripts/application.js
|
89
|
+
```javascript
|
90
|
+
//= require_tree ./templates
|
91
|
+
```
|
92
|
+
This must be done before `//= require_tree .` otherwise all your templates will not have the intended prefix; and after your inclusion of handlebars/handlebars runtime.
|
93
|
+
|
94
|
+
## Rails Asset Precompiling
|
52
95
|
|
53
96
|
`handlebars_assets` also works when you are precompiling your assets.
|
54
97
|
|
@@ -56,37 +99,39 @@ If you need to compile your JavaScript templates in the browser as well, you sho
|
|
56
99
|
|
57
100
|
If you are using `rake assets:precompile`, you have to re-run the `rake` command to rebuild any changed templates. See the [Rails guide](http://guides.rubyonrails.org/asset_pipeline.html#precompiling-assets) for more details.
|
58
101
|
|
59
|
-
### Heroku
|
102
|
+
### Heroku & other cloud hosts
|
60
103
|
|
61
104
|
If you are deploying to Heroku, be sure to read the [Rails guide](http://guides.rubyonrails.org/asset_pipeline.html#precompiling-assets) and in your `config/application.rb` set:
|
62
105
|
|
63
|
-
|
106
|
+
```ruby
|
107
|
+
config.assets.initialize_on_precompile = false
|
108
|
+
```
|
64
109
|
|
65
110
|
This avoids running your initializers when compiling assets (see the [guide](http://guides.rubyonrails.org/asset_pipeline.html#precompiling-assets) for why you would want that).
|
66
111
|
|
67
112
|
However, that does mean that you cannot set your configuration in an initializer. This [issue](https://github.com/leshill/handlebars_assets/issues/34) has a workaround, or you can set:
|
68
113
|
|
69
|
-
|
114
|
+
```ruby
|
115
|
+
config.assets.initialize_on_precompile = true
|
116
|
+
```
|
70
117
|
|
71
118
|
This will run all your initializers before precompiling assets.
|
72
119
|
|
73
|
-
|
74
|
-
|
75
|
-
You should locate your templates with your other assets, for example `app/assets/javascripts/templates`. In your JavaScript manifest file, use `require_tree` to pull in the templates
|
76
|
-
|
77
|
-
//= require_tree ./templates
|
120
|
+
# Usage
|
78
121
|
|
79
|
-
## The template
|
122
|
+
## The template files
|
80
123
|
|
81
124
|
Write your Handlebars templates as standalone files in your templates directory. Organize the templates similarly to Rails views.
|
82
125
|
|
83
126
|
For example, if you have new, edit, and show templates for a Contact model
|
84
127
|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
128
|
+
```
|
129
|
+
templates/
|
130
|
+
contacts/
|
131
|
+
new.hbs
|
132
|
+
edit.hbs
|
133
|
+
show.hbs
|
134
|
+
```
|
90
135
|
|
91
136
|
Your file extensions tell the asset pipeline how to process the file. Use `.hbs` to compile the template with Handlebars.
|
92
137
|
|
@@ -97,7 +142,21 @@ If your file is `templates/contacts/new.hbs`, the asset pipeline will generate J
|
|
97
142
|
|
98
143
|
You can then invoke the resulting template in your application's JavaScript
|
99
144
|
|
100
|
-
|
145
|
+
NOTE: There will be no javascript object `HandlebarsTemplates` unless at least ONE template is included.
|
146
|
+
|
147
|
+
```javascript
|
148
|
+
HandlebarsTemplates['contacts/new'](context);
|
149
|
+
```
|
150
|
+
|
151
|
+
## Partials
|
152
|
+
|
153
|
+
If you begin the name of the template with an underscore, it will be recognized as a partial. You can invoke partials inside a template using the Handlebars partial syntax:
|
154
|
+
|
155
|
+
```
|
156
|
+
Invoke a {{> path/to/_partial }}
|
157
|
+
```
|
158
|
+
|
159
|
+
# Configuration
|
101
160
|
|
102
161
|
## The template namespace
|
103
162
|
|
@@ -105,52 +164,87 @@ By default, the global JavaScript object that holds the compiled templates is `H
|
|
105
164
|
be easily renamed. Another common template namespace is `JST`. Just change the `template_namespace` configuration option
|
106
165
|
when you initialize your application.
|
107
166
|
|
108
|
-
|
167
|
+
```ruby
|
168
|
+
HandlebarsAssets::Config.template_namespace = 'JST'
|
169
|
+
```
|
109
170
|
|
110
|
-
## Ember
|
171
|
+
## Ember Support
|
111
172
|
|
112
173
|
To compile your templates for use with [Ember.js](http://emberjs.com)
|
113
|
-
simply turn on the config option
|
174
|
+
simply turn on the config option:
|
175
|
+
|
176
|
+
```ruby
|
177
|
+
HandlebarsAssets::Config.ember = true
|
178
|
+
```
|
179
|
+
|
180
|
+
If you need to compile templates for Ember and another framework then enable
|
181
|
+
multiple frameworks:
|
114
182
|
|
115
|
-
|
183
|
+
```ruby
|
184
|
+
HandlebarsAssets::Config.multiple_frameworks = true
|
185
|
+
```
|
116
186
|
|
117
|
-
|
187
|
+
After `mutliple_frameworks` has been enabled templates with the `.ember.hbs`
|
188
|
+
extension will be made available to Ember.
|
189
|
+
|
190
|
+
## `.hamlbars` and `.slimbars` Support
|
118
191
|
|
119
192
|
If you name your templates with the extension `.hamlbars`, you can use Haml syntax for your markup! Use `HandlebarsAssets::Config.haml_options` to pass custom options to the Haml rendering engine.
|
120
193
|
|
121
194
|
For example, if you have a file `widget.hamlbars` that looks like this:
|
122
195
|
|
123
|
-
|
124
|
-
|
196
|
+
```haml
|
197
|
+
%h1 {{title}}
|
198
|
+
%p {{body}}
|
199
|
+
```
|
125
200
|
|
126
201
|
The Haml will be pre-processed so that the Handlebars template is basically this:
|
127
202
|
|
128
|
-
|
129
|
-
|
203
|
+
```html
|
204
|
+
<h1> {{title}} </h1>
|
205
|
+
<p> {{body}} </p>
|
206
|
+
```
|
130
207
|
|
131
|
-
|
208
|
+
The same applies to `.slimbars` and the Slim gem. Use `HandlebarsAssets::Config.slim_options` to pass custom options to the Slim rendering engine.
|
132
209
|
|
133
|
-
|
210
|
+
<strong>Note:</strong> To use the `hb` handlebars helper with Haml, you'll also need to include the Hamlbars gem in your Gemfile:
|
134
211
|
|
135
|
-
|
212
|
+
```ruby
|
213
|
+
gem 'hamlbars', '~> 2.0'
|
214
|
+
```
|
136
215
|
|
137
|
-
|
216
|
+
This will then allow you to do things like Haml blocks:
|
138
217
|
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
218
|
+
```haml
|
219
|
+
%ul.authors
|
220
|
+
= hb 'each authors' do
|
221
|
+
%li<
|
222
|
+
= succeed ',' do
|
223
|
+
= hb 'lastName'
|
224
|
+
= hb 'firstName'
|
225
|
+
```
|
145
226
|
|
146
|
-
|
227
|
+
Reference [hamlbars](https://github.com/jamesotron/hamlbars) for more information.
|
147
228
|
|
148
229
|
## Using another version of `handlebars.js`
|
149
230
|
|
150
231
|
Occasionally you might need to use a version of `handlebars.js` other than the included version. You can set the `compiler_path` and `compiler` options to use a custom version of `handlebars.js`.
|
151
232
|
|
152
|
-
|
153
|
-
|
233
|
+
```ruby
|
234
|
+
HandlebarsAssets::Config.compiler = 'my_handlebars.js' # Change the name of the compiler file
|
235
|
+
HandlebarsAssets::Config.compiler_path = Rails.root.join('app/assets/javascripts') # Change the location of the compiler file
|
236
|
+
```
|
237
|
+
|
238
|
+
## Patching `handlebars.js`
|
239
|
+
|
240
|
+
If you need specific customizations to the `handlebars.js` compiler, you can use patch the compiler with your own JavaScript patches.
|
241
|
+
|
242
|
+
The patch file(s) are concatenated with the `handlebars.js` file before compiling. Take a look at the test for details.
|
243
|
+
|
244
|
+
```ruby
|
245
|
+
HandlebarsAssets::Config.patch_files = 'my_patch.js'
|
246
|
+
HandlebarsAssets::Config.patch_path = Rails.root.join('app/assets/javascripts') # Defaults to `Config.compiler_path`
|
247
|
+
```
|
154
248
|
|
155
249
|
# Thanks
|
156
250
|
|
@@ -160,29 +254,45 @@ Thank you Yehuda Katz (@wycats) for [handlebars.js](https://github.com/wycats/ha
|
|
160
254
|
|
161
255
|
Thank you Charles Lowell (@cowboyd) for [therubyracer](https://github.com/cowboyd/therubyracer) and [handlebars.rb](https://github.com/cowboyd/handlebars.rb).
|
162
256
|
|
163
|
-
#
|
257
|
+
# Maintainer
|
164
258
|
|
165
|
-
|
259
|
+
This gem is maintained by Alex Riedler [Github](https://github.com/AlexRiedler).
|
166
260
|
|
167
|
-
|
261
|
+
# Author
|
168
262
|
|
263
|
+
Les Hill, follow me on [Github](https://github.com/leshill) and [Twitter](https://twitter.com/leshill).
|
169
264
|
|
170
265
|
# Contributors
|
171
266
|
|
172
|
-
* Matt Burke (@spraints)
|
173
|
-
* (@kendagriff)
|
174
|
-
* Thorben Schröder (@walski)
|
175
|
-
* Erwan Barrier (@erwanb)
|
176
|
-
* Brendan Loudermilk (@bloudermilk)
|
177
|
-
* Dan Evans (@danevans)
|
178
|
-
* Ben Woosley (@empact)
|
179
|
-
* (@cw-moshe)
|
180
|
-
* Spike Brehm (@spikebrehm)
|
181
|
-
* Ken Mayer (@kmayer)
|
182
|
-
* Brad Murray (@wyaeld)
|
183
|
-
* Blake Williams (@BlakeWilliams)
|
184
|
-
* Tristan Koch (@trkoch)
|
185
|
-
* Brian Cardarella (@bcardarella)
|
267
|
+
* Matt Burke (@spraints) : execjs support
|
268
|
+
* (@kendagriff) : 1.8.7 compatibility
|
269
|
+
* Thorben Schröder (@walski) : 3.1 asset group for precompile
|
270
|
+
* Erwan Barrier (@erwanb) : Support for plain sprockets
|
271
|
+
* Brendan Loudermilk (@bloudermilk) : HandlebarsAssets.path
|
272
|
+
* Dan Evans (@danevans) : Rails 2 support
|
273
|
+
* Ben Woosley (@empact) : Update to handlebars.js 1.0.0.beta.6
|
274
|
+
* (@cw-moshe) : Remove 'templates/' from names
|
275
|
+
* Spike Brehm (@spikebrehm) : Config.template\_namespace option
|
276
|
+
* Ken Mayer (@kmayer) : Quick fix for template\_namespace option
|
277
|
+
* Brad Murray (@wyaeld) : Generic options support
|
278
|
+
* Blake Williams (@BlakeWilliams) : .handlebars extension
|
279
|
+
* Tristan Koch (@trkoch) : Strip leading whitespace from compiled templates
|
280
|
+
* Brian Cardarella (@bcardarella) : Ember support
|
281
|
+
* David Lee (@davidlee) : Slim support
|
282
|
+
* Phil Cohen (@phlipper) : README cleanup
|
283
|
+
* Akshay Rawat (@akshayrawat) : Update to handlebars.js 1.0.0-rc.3
|
284
|
+
* Turadg Aleahmad (@turadg) : Update to handlebars 1.0.0-rc.4
|
285
|
+
* Mark Rushakoff (@mark-rushakoff) : Synchronize Sprockets engine registers with Rails
|
286
|
+
* Alex Riedler (@AlexRiedler) : Pass scope and locals up the chain
|
287
|
+
* lee (@lee) : Update to handlebars 1.0.0
|
288
|
+
* Ken Collins (@metaskills) : Register with Sprockets
|
289
|
+
* Blake Hitchcock (@rbhitchcock) : Support ember and other handlebars use simultaneously
|
290
|
+
* ajk (@Darep) : Fix .hbs extension for multi-framework support
|
291
|
+
* (@mattmenefee) : README section for `hamlbars`
|
292
|
+
* Parker Selbert (@sorentwo) : README section for `multiple_frameworks`
|
293
|
+
* Francisco QV (@panchoqv) : README clarification
|
294
|
+
* Dylan Markow (@dmarkow) : README cleanup
|
295
|
+
* Peter Boling (@pboling) : AMD Loading
|
186
296
|
|
187
297
|
# Contributing
|
188
298
|
|
data/Rakefile
CHANGED
@@ -1,7 +1,11 @@
|
|
1
|
+
require "rubygems"
|
2
|
+
require "bundler/setup"
|
1
3
|
require "bundler/gem_tasks"
|
2
|
-
require
|
4
|
+
require "rake/testtask"
|
3
5
|
|
4
6
|
Rake::TestTask.new do |t|
|
5
7
|
t.libs << 'test'
|
6
8
|
t.test_files = FileList['test/**/*_test.rb']
|
7
9
|
end
|
10
|
+
|
11
|
+
task :default => :test
|
data/handlebars_assets.gemspec
CHANGED
@@ -6,10 +6,11 @@ Gem::Specification.new do |s|
|
|
6
6
|
s.name = "handlebars_assets"
|
7
7
|
s.version = HandlebarsAssets::VERSION
|
8
8
|
s.authors = ["Les Hill"]
|
9
|
+
s.licenses = ["MIT"]
|
9
10
|
s.email = ["leshill@gmail.com"]
|
10
|
-
s.homepage = ""
|
11
|
+
s.homepage = "https://github.com/leshill/handlebars_assets"
|
11
12
|
s.summary = "Compile Handlebars templates in the Rails asset pipeline."
|
12
|
-
s.description = "
|
13
|
+
s.description = "A Railties Gem to compile hbs assets"
|
13
14
|
|
14
15
|
s.rubyforge_project = "handlebars_assets"
|
15
16
|
|
@@ -18,9 +19,15 @@ Gem::Specification.new do |s|
|
|
18
19
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
20
|
s.require_paths = ["lib"]
|
20
21
|
|
21
|
-
s.add_runtime_dependency "execjs", "
|
22
|
-
s.add_runtime_dependency "tilt"
|
23
|
-
s.add_runtime_dependency "sprockets", ">= 2.0.
|
24
|
-
|
25
|
-
s.add_development_dependency "
|
22
|
+
s.add_runtime_dependency "execjs", "~> 2.0"
|
23
|
+
s.add_runtime_dependency "tilt", ">= 1.2"
|
24
|
+
s.add_runtime_dependency "sprockets", ">= 2.0.0"
|
25
|
+
|
26
|
+
s.add_development_dependency "minitest", '~> 5.5'
|
27
|
+
s.add_development_dependency "haml", '~> 4.0'
|
28
|
+
s.add_development_dependency "rake", '~> 10.0'
|
29
|
+
s.add_development_dependency "slim", '~> 3.0'
|
30
|
+
s.add_development_dependency "appraisal"
|
31
|
+
|
32
|
+
s.post_install_message = "Remember to rake assets:clean or rake assets:purge on update! this is required because of handlebars updates"
|
26
33
|
end
|