angular-html2js 0.0.2 → 0.0.3
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.
- checksums.yaml +4 -4
- data/README.md +25 -1
- data/app/Gemfile +1 -0
- data/app/Gemfile.lock +9 -1
- data/app/app/assets/javascripts/templates/{test.js.ngt → test.ngt} +0 -0
- data/app/app/assets/javascripts/templates/test_haml.ngt.haml +1 -0
- data/app/app/assets/javascripts/templates/test_html.ngt.html +1 -0
- data/app/log/test.log +287 -0
- data/lib/angular/html2js.rb +1 -0
- data/lib/angular/html2js/configuration.rb +10 -0
- data/lib/angular/html2js/engine.rb +3 -1
- data/lib/angular/html2js/haml.rb +10 -0
- data/lib/angular/html2js/railtie.rb +2 -2
- data/lib/angular/html2js/template.rb +3 -1
- data/lib/angular/html2js/version.rb +1 -1
- data/spec/angular/html2js/engine_spec.rb +35 -2
- data/spec/angular/html2js/haml_spec.rb +11 -0
- data/spec/angular/html2js/railtie_spec.rb +18 -5
- data/spec/assets/normal.html +1 -0
- data/spec/assets/{test.js.ngt → test.ngt} +0 -0
- data/spec/assets/test_haml.ngt.haml +1 -0
- data/spec/assets/test_html.ngt.html +1 -0
- metadata +33 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f53156f0d67efa018f2508ab2a39962f7500dca
|
4
|
+
data.tar.gz: b155cb47ce96599a3920ab3e8802797de5908413
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4319760aa632f88cc2a0d7470936f949b3006da29c407d1f7ec883b80d1393829f42a44aa6d0a915ff79fec65324b9ec26f6e8f69761231de2385bffa3e89912
|
7
|
+
data.tar.gz: 978135eb86e022a92a7769d199338e5c6b5c8aa65bf655f91382c6bfb0abc62619bc7a8d9c7c3e43612ca4df39f639c51f784e6739d31a9f58e73a9a160a4fb4
|
data/README.md
CHANGED
@@ -26,10 +26,33 @@ Or install it yourself as:
|
|
26
26
|
|
27
27
|
This gem adds support for AngularJS templates. Those familiar with the Karma
|
28
28
|
test runner will be able to use the familiar `beforeEach(module('myTemplateModule'))`
|
29
|
-
or `beforeEach(module('/your/template/file'))`. Additionally, you can now leverage
|
29
|
+
or `beforeEach(module('/your/template/file.html'))`. Additionally, you can now leverage
|
30
30
|
sprockets to help you. In Rails, this means that you can also inline your templates in
|
31
31
|
production!
|
32
32
|
|
33
|
+
#### File naming
|
34
|
+
|
35
|
+
All source files need to have the extension `.ngt`.
|
36
|
+
|
37
|
+
```
|
38
|
+
myTemplate.ngt # <= plain html
|
39
|
+
myTemplate.ngt.haml # <= haml!
|
40
|
+
```
|
41
|
+
|
42
|
+
```coffeescript
|
43
|
+
# in your code, you can just reference the path without extensions
|
44
|
+
#=require myTemplate
|
45
|
+
|
46
|
+
//= require my_template
|
47
|
+
|
48
|
+
angular.module('myApp').directive('myDirective', function($injectable){
|
49
|
+
{ restrict: 'A'
|
50
|
+
templateUrl: 'my_template'
|
51
|
+
// Etc...
|
52
|
+
}
|
53
|
+
});
|
54
|
+
```
|
55
|
+
|
33
56
|
### Include in global module (recommended)
|
34
57
|
|
35
58
|
1. Configure a top level shared module
|
@@ -64,6 +87,7 @@ production!
|
|
64
87
|
(named after the template), and use the template path as your templateURL
|
65
88
|
|
66
89
|
```javascript
|
90
|
+
// This first line is the only additional step needed!
|
67
91
|
//= require full/path/to/my_template
|
68
92
|
|
69
93
|
angular.module('myApp', ['/full/path/to/myTemplate.html']).directive('myDirective', function($injectable){
|
data/app/Gemfile
CHANGED
data/app/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ../
|
3
3
|
specs:
|
4
|
-
angular-html2js (0.0.
|
4
|
+
angular-html2js (0.0.2)
|
5
5
|
sprockets (~> 2.0)
|
6
6
|
tilt (~> 1.0)
|
7
7
|
|
@@ -37,6 +37,13 @@ GEM
|
|
37
37
|
builder (3.1.4)
|
38
38
|
diff-lcs (1.1.3)
|
39
39
|
erubis (2.7.0)
|
40
|
+
haml (4.0.3)
|
41
|
+
tilt
|
42
|
+
haml-rails (0.4)
|
43
|
+
actionpack (>= 3.1, < 4.1)
|
44
|
+
activesupport (>= 3.1, < 4.1)
|
45
|
+
haml (>= 3.1, < 4.1)
|
46
|
+
railties (>= 3.1, < 4.1)
|
40
47
|
hike (1.2.3)
|
41
48
|
i18n (0.6.5)
|
42
49
|
mail (2.5.4)
|
@@ -94,5 +101,6 @@ PLATFORMS
|
|
94
101
|
|
95
102
|
DEPENDENCIES
|
96
103
|
angular-html2js!
|
104
|
+
haml-rails
|
97
105
|
rails (= 4.0.0)
|
98
106
|
rspec
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
%h1 hello haml
|
@@ -0,0 +1 @@
|
|
1
|
+
<h1>hello html</h1>
|
data/app/log/test.log
CHANGED
@@ -174,3 +174,290 @@ Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-08-19 12:34:02 -06
|
|
174
174
|
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-08-19 14:06:24 -0600
|
175
175
|
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-08-19 14:18:49 -0600
|
176
176
|
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-03 11:28:49 -0600
|
177
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 08:29:13 -0500
|
178
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 10:58:46 -0500
|
179
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 10:59:14 -0500
|
180
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 11:04:37 -0500
|
181
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 11:04:37 -0500
|
182
|
+
Started GET "/assets/templates/test_haml.js" for 127.0.0.1 at 2013-09-11 11:05:09 -0500
|
183
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 11:05:09 -0500
|
184
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 11:06:18 -0500
|
185
|
+
Started GET "/assets/templates/test_haml.js" for 127.0.0.1 at 2013-09-11 11:06:18 -0500
|
186
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 11:06:20 -0500
|
187
|
+
Started GET "/assets/templates/test_haml.js" for 127.0.0.1 at 2013-09-11 11:06:20 -0500
|
188
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 11:07:37 -0500
|
189
|
+
Started GET "/assets/templates/test_haml.js" for 127.0.0.1 at 2013-09-11 11:07:37 -0500
|
190
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 11:07:48 -0500
|
191
|
+
Started GET "/assets/templates/test_haml.js" for 127.0.0.1 at 2013-09-11 11:07:48 -0500
|
192
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 11:08:20 -0500
|
193
|
+
Started GET "/assets/templates/test_haml.js" for 127.0.0.1 at 2013-09-11 11:08:20 -0500
|
194
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 11:09:01 -0500
|
195
|
+
Started GET "/assets/templates/test_haml.js" for 127.0.0.1 at 2013-09-11 11:09:01 -0500
|
196
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 11:09:43 -0500
|
197
|
+
Started GET "/assets/templates/test_haml.js" for 127.0.0.1 at 2013-09-11 11:09:44 -0500
|
198
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 11:11:32 -0500
|
199
|
+
Started GET "/assets/templates/test_haml.js" for 127.0.0.1 at 2013-09-11 11:11:32 -0500
|
200
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 11:12:00 -0500
|
201
|
+
Started GET "/assets/templates/test_haml.js" for 127.0.0.1 at 2013-09-11 11:12:00 -0500
|
202
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 11:13:53 -0500
|
203
|
+
Started GET "/assets/templates/test_haml.js" for 127.0.0.1 at 2013-09-11 11:13:53 -0500
|
204
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 11:18:08 -0500
|
205
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 11:18:30 -0500
|
206
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 11:19:36 -0500
|
207
|
+
Started GET "/assets/templates/test_haml.js" for 127.0.0.1 at 2013-09-11 11:19:36 -0500
|
208
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 11:19:36 -0500
|
209
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 11:21:22 -0500
|
210
|
+
Started GET "/assets/templates/test_haml.js.ngt.haml" for 127.0.0.1 at 2013-09-11 11:21:23 -0500
|
211
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 11:21:23 -0500
|
212
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 11:24:37 -0500
|
213
|
+
Started GET "/assets/templates/test_haml.js.ngt.haml" for 127.0.0.1 at 2013-09-11 11:24:37 -0500
|
214
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 11:24:37 -0500
|
215
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 11:25:35 -0500
|
216
|
+
Started GET "/assets/templates/test_haml.js.ngt.haml" for 127.0.0.1 at 2013-09-11 11:25:35 -0500
|
217
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 11:25:36 -0500
|
218
|
+
Started GET "/assets/templates/test_html.html.html" for 127.0.0.1 at 2013-09-11 11:27:44 -0500
|
219
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 11:27:52 -0500
|
220
|
+
Started GET "/assets/templates/test_html.html.ngt" for 127.0.0.1 at 2013-09-11 11:28:23 -0500
|
221
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 11:39:24 -0500
|
222
|
+
Started GET "/assets/templates/test_haml.js.ngt.haml" for 127.0.0.1 at 2013-09-11 11:39:24 -0500
|
223
|
+
Started GET "/assets/templates/test_html" for 127.0.0.1 at 2013-09-11 11:39:24 -0500
|
224
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 11:40:08 -0500
|
225
|
+
Started GET "/assets/templates/test_haml.html.haml" for 127.0.0.1 at 2013-09-11 11:40:08 -0500
|
226
|
+
Started GET "/assets/templates/test_html" for 127.0.0.1 at 2013-09-11 11:40:08 -0500
|
227
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 11:40:50 -0500
|
228
|
+
Started GET "/assets/templates/test_haml.html.haml" for 127.0.0.1 at 2013-09-11 11:40:50 -0500
|
229
|
+
Started GET "/assets/templates/test_html" for 127.0.0.1 at 2013-09-11 11:40:50 -0500
|
230
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 11:41:09 -0500
|
231
|
+
Started GET "/assets/templates/test_haml.html.haml" for 127.0.0.1 at 2013-09-11 11:41:09 -0500
|
232
|
+
Started GET "/assets/templates/test_html" for 127.0.0.1 at 2013-09-11 11:41:09 -0500
|
233
|
+
Started GET "/assets/templates/test_haml.html.haml" for 127.0.0.1 at 2013-09-11 11:41:48 -0500
|
234
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 11:41:48 -0500
|
235
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 11:41:48 -0500
|
236
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 11:42:11 -0500
|
237
|
+
Started GET "/assets/templates/test_haml.html.haml" for 127.0.0.1 at 2013-09-11 11:42:11 -0500
|
238
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 11:42:11 -0500
|
239
|
+
Started GET "/assets/templates/test_haml.html.haml" for 127.0.0.1 at 2013-09-11 11:47:45 -0500
|
240
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 11:47:45 -0500
|
241
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 11:47:45 -0500
|
242
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 11:48:37 -0500
|
243
|
+
Started GET "/assets/templates/test_haml.html.haml" for 127.0.0.1 at 2013-09-11 11:48:37 -0500
|
244
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 11:48:38 -0500
|
245
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 11:51:34 -0500
|
246
|
+
Started GET "/assets/templates/test_haml.html.haml" for 127.0.0.1 at 2013-09-11 11:51:34 -0500
|
247
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 11:51:34 -0500
|
248
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 11:51:50 -0500
|
249
|
+
Started GET "/assets/templates/test_haml.html.haml" for 127.0.0.1 at 2013-09-11 11:51:50 -0500
|
250
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 11:51:50 -0500
|
251
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 11:52:00 -0500
|
252
|
+
Started GET "/assets/templates/test_haml.html.haml" for 127.0.0.1 at 2013-09-11 11:52:00 -0500
|
253
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 11:52:00 -0500
|
254
|
+
Started GET "/assets/templates/test_haml.html.haml" for 127.0.0.1 at 2013-09-11 11:53:09 -0500
|
255
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 11:53:09 -0500
|
256
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 11:53:09 -0500
|
257
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 11:54:09 -0500
|
258
|
+
Started GET "/assets/templates/test_haml.html.haml" for 127.0.0.1 at 2013-09-11 11:54:09 -0500
|
259
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 11:54:09 -0500
|
260
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 11:54:32 -0500
|
261
|
+
Started GET "/assets/templates/test_haml.html.haml" for 127.0.0.1 at 2013-09-11 11:54:32 -0500
|
262
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 11:54:32 -0500
|
263
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 11:55:23 -0500
|
264
|
+
Started GET "/assets/templates/test_haml.html.haml" for 127.0.0.1 at 2013-09-11 11:55:23 -0500
|
265
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 11:55:23 -0500
|
266
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 11:55:47 -0500
|
267
|
+
Started GET "/assets/templates/test_haml.html.haml" for 127.0.0.1 at 2013-09-11 11:55:47 -0500
|
268
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 11:55:47 -0500
|
269
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 11:56:10 -0500
|
270
|
+
Started GET "/assets/templates/test_haml.html.haml" for 127.0.0.1 at 2013-09-11 11:56:10 -0500
|
271
|
+
Started GET "/assets/templates/test_html.js" for 127.0.0.1 at 2013-09-11 11:56:11 -0500
|
272
|
+
Started GET "/assets/templates/test_haml.html.haml" for 127.0.0.1 at 2013-09-11 12:37:19 -0500
|
273
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 12:37:19 -0500
|
274
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 12:37:19 -0500
|
275
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 12:37:42 -0500
|
276
|
+
Started GET "/assets/templates/test_haml.html" for 127.0.0.1 at 2013-09-11 12:37:42 -0500
|
277
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 12:37:42 -0500
|
278
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 12:38:45 -0500
|
279
|
+
Started GET "/assets/templates/test_haml.html" for 127.0.0.1 at 2013-09-11 12:38:45 -0500
|
280
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 12:38:45 -0500
|
281
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 12:39:25 -0500
|
282
|
+
Started GET "/assets/templates/test_haml.html" for 127.0.0.1 at 2013-09-11 12:39:25 -0500
|
283
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 12:39:25 -0500
|
284
|
+
Started GET "/assets/templates/test_haml.html" for 127.0.0.1 at 2013-09-11 12:39:51 -0500
|
285
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 12:39:51 -0500
|
286
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 12:39:51 -0500
|
287
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 12:41:38 -0500
|
288
|
+
Started GET "/assets/templates/test_haml.html" for 127.0.0.1 at 2013-09-11 12:41:39 -0500
|
289
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 12:41:39 -0500
|
290
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 12:42:25 -0500
|
291
|
+
Started GET "/assets/templates/test_haml.html" for 127.0.0.1 at 2013-09-11 12:42:25 -0500
|
292
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 12:42:25 -0500
|
293
|
+
Started GET "/assets/templates/test_haml.html" for 127.0.0.1 at 2013-09-11 12:42:45 -0500
|
294
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 12:42:45 -0500
|
295
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 12:42:45 -0500
|
296
|
+
Started GET "/assets/templates/test_haml.html" for 127.0.0.1 at 2013-09-11 12:44:00 -0500
|
297
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 12:44:00 -0500
|
298
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 12:44:00 -0500
|
299
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 12:45:21 -0500
|
300
|
+
Started GET "/assets/templates/test_haml.html" for 127.0.0.1 at 2013-09-11 12:45:21 -0500
|
301
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 12:45:21 -0500
|
302
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 12:45:37 -0500
|
303
|
+
Started GET "/assets/templates/test_haml.js" for 127.0.0.1 at 2013-09-11 12:45:37 -0500
|
304
|
+
Started GET "/assets/templates/test_html.js" for 127.0.0.1 at 2013-09-11 12:45:37 -0500
|
305
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 12:46:18 -0500
|
306
|
+
Started GET "/assets/templates/test_haml.js" for 127.0.0.1 at 2013-09-11 12:46:18 -0500
|
307
|
+
Started GET "/assets/templates/test_html.js" for 127.0.0.1 at 2013-09-11 12:46:19 -0500
|
308
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 12:46:31 -0500
|
309
|
+
Started GET "/assets/templates/test_haml.js" for 127.0.0.1 at 2013-09-11 12:46:31 -0500
|
310
|
+
Started GET "/assets/templates/test_html.js" for 127.0.0.1 at 2013-09-11 12:46:31 -0500
|
311
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 12:50:49 -0500
|
312
|
+
Started GET "/assets/templates/test_haml.js" for 127.0.0.1 at 2013-09-11 12:50:49 -0500
|
313
|
+
Started GET "/assets/templates/test_html.js" for 127.0.0.1 at 2013-09-11 12:50:49 -0500
|
314
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 12:50:57 -0500
|
315
|
+
Started GET "/assets/templates/test_haml" for 127.0.0.1 at 2013-09-11 12:50:57 -0500
|
316
|
+
Started GET "/assets/templates/test_html.js" for 127.0.0.1 at 2013-09-11 12:50:57 -0500
|
317
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 12:55:50 -0500
|
318
|
+
Started GET "/assets/templates/test_haml.js" for 127.0.0.1 at 2013-09-11 12:55:51 -0500
|
319
|
+
Started GET "/assets/templates/test_html.js" for 127.0.0.1 at 2013-09-11 12:55:51 -0500
|
320
|
+
Started GET "/assets/templates/test.js.html" for 127.0.0.1 at 2013-09-11 12:56:44 -0500
|
321
|
+
Started GET "/assets/templates/test_haml.html" for 127.0.0.1 at 2013-09-11 12:56:44 -0500
|
322
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 12:56:44 -0500
|
323
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 12:58:38 -0500
|
324
|
+
Started GET "/assets/templates/test_haml.html" for 127.0.0.1 at 2013-09-11 12:58:38 -0500
|
325
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 12:58:38 -0500
|
326
|
+
Started GET "/assets/templates/test_haml.html" for 127.0.0.1 at 2013-09-11 12:59:20 -0500
|
327
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 12:59:21 -0500
|
328
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 12:59:21 -0500
|
329
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 13:08:58 -0500
|
330
|
+
Started GET "/assets/templates/test_haml.html" for 127.0.0.1 at 2013-09-11 13:08:59 -0500
|
331
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 13:08:59 -0500
|
332
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 13:08:59 -0500
|
333
|
+
Started GET "/assets/templates/test_haml.html" for 127.0.0.1 at 2013-09-11 13:09:11 -0500
|
334
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 13:09:11 -0500
|
335
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 13:09:11 -0500
|
336
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 13:11:16 -0500
|
337
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 13:11:19 -0500
|
338
|
+
Started GET "/assets/templates/test_haml.html" for 127.0.0.1 at 2013-09-11 13:11:20 -0500
|
339
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 13:11:20 -0500
|
340
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 13:11:20 -0500
|
341
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 13:11:29 -0500
|
342
|
+
Started GET "/assets/templates/test_haml.html" for 127.0.0.1 at 2013-09-11 13:11:29 -0500
|
343
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 13:11:29 -0500
|
344
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 13:11:29 -0500
|
345
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 13:11:54 -0500
|
346
|
+
Started GET "/assets/templates/test_haml.html" for 127.0.0.1 at 2013-09-11 13:11:54 -0500
|
347
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 13:11:54 -0500
|
348
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 13:11:54 -0500
|
349
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 13:20:57 -0500
|
350
|
+
Started GET "/assets/templates/test_haml.html" for 127.0.0.1 at 2013-09-11 13:20:57 -0500
|
351
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 13:20:57 -0500
|
352
|
+
Started GET "/assets/templates/test_haml.html" for 127.0.0.1 at 2013-09-11 13:21:03 -0500
|
353
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 13:21:03 -0500
|
354
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 13:21:03 -0500
|
355
|
+
Started GET "/assets/templates/test_haml.html" for 127.0.0.1 at 2013-09-11 13:28:48 -0500
|
356
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 13:28:48 -0500
|
357
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 13:28:48 -0500
|
358
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 13:55:56 -0500
|
359
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 15:38:56 -0500
|
360
|
+
Started GET "/assets/templates/test_haml.html" for 127.0.0.1 at 2013-09-11 15:38:56 -0500
|
361
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 15:38:56 -0500
|
362
|
+
Started GET "/assets/templates/test_haml.html" for 127.0.0.1 at 2013-09-11 15:39:46 -0500
|
363
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 15:39:46 -0500
|
364
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 15:39:46 -0500
|
365
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 15:47:51 -0500
|
366
|
+
Started GET "/assets/templates/test_haml.html" for 127.0.0.1 at 2013-09-11 15:47:51 -0500
|
367
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 15:47:51 -0500
|
368
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-11 17:34:16 -0500
|
369
|
+
Started GET "/assets/templates/test_haml.html" for 127.0.0.1 at 2013-09-11 17:34:16 -0500
|
370
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-11 17:34:16 -0500
|
371
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-12 14:03:38 -0500
|
372
|
+
Started GET "/assets/templates/test_haml.html" for 127.0.0.1 at 2013-09-12 14:03:38 -0500
|
373
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-12 14:03:38 -0500
|
374
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-12 14:04:03 -0500
|
375
|
+
Started GET "/assets/templates/test_haml.html" for 127.0.0.1 at 2013-09-12 14:04:03 -0500
|
376
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-12 14:04:03 -0500
|
377
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-12 14:05:06 -0500
|
378
|
+
Started GET "/assets/templates/test_haml.html" for 127.0.0.1 at 2013-09-12 14:05:07 -0500
|
379
|
+
Started GET "/assets/templates/test_html.html" for 127.0.0.1 at 2013-09-12 14:05:07 -0500
|
380
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-12 14:05:47 -0500
|
381
|
+
Started GET "/assets/templates/test_haml.js" for 127.0.0.1 at 2013-09-12 14:05:47 -0500
|
382
|
+
Started GET "/assets/templates/test_html.js" for 127.0.0.1 at 2013-09-12 14:05:47 -0500
|
383
|
+
Started GET "/assets/templates/test_haml.js" for 127.0.0.1 at 2013-09-12 14:06:30 -0500
|
384
|
+
Started GET "/assets/templates/test_haml.js" for 127.0.0.1 at 2013-09-12 14:08:39 -0500
|
385
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-12 14:08:39 -0500
|
386
|
+
Started GET "/assets/templates/test_html.js" for 127.0.0.1 at 2013-09-12 14:08:39 -0500
|
387
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-12 14:11:05 -0500
|
388
|
+
Started GET "/assets/templates/test_haml.js" for 127.0.0.1 at 2013-09-12 14:11:05 -0500
|
389
|
+
Started GET "/assets/templates/test_html.js" for 127.0.0.1 at 2013-09-12 14:11:06 -0500
|
390
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-12 14:18:00 -0500
|
391
|
+
Started GET "/assets/templates/test_haml.js" for 127.0.0.1 at 2013-09-12 14:18:00 -0500
|
392
|
+
Started GET "/assets/templates/test_html.js" for 127.0.0.1 at 2013-09-12 14:18:00 -0500
|
393
|
+
Started GET "/assets/templates/test.js" for 127.0.0.1 at 2013-09-12 14:19:31 -0500
|
394
|
+
Started GET "/assets/templates/test_haml.js" for 127.0.0.1 at 2013-09-12 14:19:31 -0500
|
395
|
+
Started GET "/assets/templates/test_html.js" for 127.0.0.1 at 2013-09-12 14:19:31 -0500
|
396
|
+
Started GET "/assets/templates/test.ngt" for 127.0.0.1 at 2013-09-12 14:20:20 -0500
|
397
|
+
Started GET "/assets/templates/test_haml.ngt" for 127.0.0.1 at 2013-09-12 14:20:20 -0500
|
398
|
+
Started GET "/assets/templates/test_html.ngt" for 127.0.0.1 at 2013-09-12 14:20:21 -0500
|
399
|
+
Started GET "/assets/templates/test.ngt" for 127.0.0.1 at 2013-09-12 14:22:22 -0500
|
400
|
+
Started GET "/assets/templates/test_haml.ngt" for 127.0.0.1 at 2013-09-12 14:22:22 -0500
|
401
|
+
Started GET "/assets/templates/test_html.ngt" for 127.0.0.1 at 2013-09-12 14:22:22 -0500
|
402
|
+
Started GET "/assets/templates/test.ngt" for 127.0.0.1 at 2013-09-12 14:23:06 -0500
|
403
|
+
Started GET "/assets/templates/test_haml.ngt" for 127.0.0.1 at 2013-09-12 14:23:06 -0500
|
404
|
+
Started GET "/assets/templates/test_html.ngt" for 127.0.0.1 at 2013-09-12 14:23:06 -0500
|
405
|
+
Started GET "/assets/templates/test.ngt" for 127.0.0.1 at 2013-09-12 14:41:55 -0500
|
406
|
+
Started GET "/assets/templates/test_haml.ngt" for 127.0.0.1 at 2013-09-12 14:41:56 -0500
|
407
|
+
Started GET "/assets/templates/test_html.ngt" for 127.0.0.1 at 2013-09-12 14:41:56 -0500
|
408
|
+
Started GET "/assets/templates/test.ngt" for 127.0.0.1 at 2013-09-12 14:42:14 -0500
|
409
|
+
Started GET "/assets/templates/test_haml.ngt" for 127.0.0.1 at 2013-09-12 14:42:14 -0500
|
410
|
+
Started GET "/assets/templates/test_html.ngt" for 127.0.0.1 at 2013-09-12 14:42:14 -0500
|
411
|
+
Started GET "/assets/templates/test.ngt" for 127.0.0.1 at 2013-09-12 17:51:15 -0500
|
412
|
+
Started GET "/assets/templates/test_haml.ngt" for 127.0.0.1 at 2013-09-12 17:51:16 -0500
|
413
|
+
Started GET "/assets/templates/test_html.ngt" for 127.0.0.1 at 2013-09-12 17:51:16 -0500
|
414
|
+
Started GET "/assets/templates/test_haml.ngt" for 127.0.0.1 at 2013-09-12 17:52:15 -0500
|
415
|
+
Started GET "/assets/templates/test.ngt" for 127.0.0.1 at 2013-09-12 17:52:15 -0500
|
416
|
+
Started GET "/assets/templates/test_html.ngt" for 127.0.0.1 at 2013-09-12 17:52:15 -0500
|
417
|
+
Started GET "/assets/templates/test_haml.ngt" for 127.0.0.1 at 2013-09-12 17:55:12 -0500
|
418
|
+
Started GET "/assets/templates/test.ngt" for 127.0.0.1 at 2013-09-12 17:55:12 -0500
|
419
|
+
Started GET "/assets/templates/test_html.ngt" for 127.0.0.1 at 2013-09-12 17:55:12 -0500
|
420
|
+
Started GET "/assets/templates/test.ngt" for 127.0.0.1 at 2013-09-12 17:56:08 -0500
|
421
|
+
Started GET "/assets/templates/test_haml.ngt" for 127.0.0.1 at 2013-09-12 17:56:08 -0500
|
422
|
+
Started GET "/assets/templates/test_html.ngt" for 127.0.0.1 at 2013-09-12 17:56:08 -0500
|
423
|
+
Started GET "/assets/templates/test.ngt" for 127.0.0.1 at 2013-09-12 17:56:52 -0500
|
424
|
+
Started GET "/assets/templates/test_haml.ngt" for 127.0.0.1 at 2013-09-12 17:56:52 -0500
|
425
|
+
Started GET "/assets/templates/test_html.js" for 127.0.0.1 at 2013-09-12 17:56:52 -0500
|
426
|
+
Started GET "/assets/templates/test.ngt" for 127.0.0.1 at 2013-09-12 17:56:58 -0500
|
427
|
+
Started GET "/assets/templates/test_haml.ngt" for 127.0.0.1 at 2013-09-12 17:56:58 -0500
|
428
|
+
Started GET "/assets/templates/test.ngt" for 127.0.0.1 at 2013-09-12 17:57:29 -0500
|
429
|
+
Started GET "/assets/templates/test_haml.ngt" for 127.0.0.1 at 2013-09-12 17:57:30 -0500
|
430
|
+
Started GET "/assets/templates/test_html.js" for 127.0.0.1 at 2013-09-12 17:57:30 -0500
|
431
|
+
Started GET "/assets/templates/test.ngt" for 127.0.0.1 at 2013-09-12 17:57:34 -0500
|
432
|
+
Started GET "/assets/templates/test_haml.ngt" for 127.0.0.1 at 2013-09-12 17:57:34 -0500
|
433
|
+
Started GET "/assets/templates/test_html.js" for 127.0.0.1 at 2013-09-12 17:57:34 -0500
|
434
|
+
Started GET "/assets/templates/test_haml.ngt" for 127.0.0.1 at 2013-09-12 17:58:43 -0500
|
435
|
+
Started GET "/assets/templates/test.ngt" for 127.0.0.1 at 2013-09-12 17:58:43 -0500
|
436
|
+
Started GET "/assets/templates/test_html.js" for 127.0.0.1 at 2013-09-12 17:58:43 -0500
|
437
|
+
Started GET "/assets/templates/test.ngt" for 127.0.0.1 at 2013-09-12 17:59:12 -0500
|
438
|
+
Started GET "/assets/templates/test_haml.ngt" for 127.0.0.1 at 2013-09-12 17:59:12 -0500
|
439
|
+
Started GET "/assets/templates/test_html.js" for 127.0.0.1 at 2013-09-12 17:59:12 -0500
|
440
|
+
Started GET "/assets/templates/test.ngt" for 127.0.0.1 at 2013-09-12 18:08:24 -0500
|
441
|
+
Started GET "/assets/templates/test_haml.ngt" for 127.0.0.1 at 2013-09-12 18:08:24 -0500
|
442
|
+
Started GET "/assets/templates/test_html.js" for 127.0.0.1 at 2013-09-12 18:08:24 -0500
|
443
|
+
Started GET "/assets/templates/test_haml.ngt" for 127.0.0.1 at 2013-09-12 18:34:49 -0500
|
444
|
+
Started GET "/assets/templates/test.ngt" for 127.0.0.1 at 2013-09-12 18:34:49 -0500
|
445
|
+
Started GET "/assets/templates/test_html.js" for 127.0.0.1 at 2013-09-12 18:34:49 -0500
|
446
|
+
Started GET "/assets/templates/test.ngt" for 127.0.0.1 at 2013-09-13 07:54:27 -0500
|
447
|
+
Started GET "/assets/templates/test_haml.ngt" for 127.0.0.1 at 2013-09-13 07:54:27 -0500
|
448
|
+
Started GET "/assets/templates/test_html.js" for 127.0.0.1 at 2013-09-13 07:54:28 -0500
|
449
|
+
Started GET "/assets/templates/test.ngt" for 127.0.0.1 at 2013-09-13 08:09:02 -0500
|
450
|
+
Started GET "/assets/templates/test_haml.ngt" for 127.0.0.1 at 2013-09-13 08:09:03 -0500
|
451
|
+
Started GET "/assets/templates/test_html.js" for 127.0.0.1 at 2013-09-13 08:09:03 -0500
|
452
|
+
Started GET "/assets/templates/test.ngt" for 127.0.0.1 at 2013-09-13 08:09:29 -0500
|
453
|
+
Started GET "/assets/templates/test_haml.ngt" for 127.0.0.1 at 2013-09-13 08:09:29 -0500
|
454
|
+
Started GET "/assets/templates/test_html.js" for 127.0.0.1 at 2013-09-13 08:09:29 -0500
|
455
|
+
Started GET "/assets/templates/test_haml.js" for 127.0.0.1 at 2013-09-13 12:41:19 -0500
|
456
|
+
Started GET "/assets/templates/test.ngt" for 127.0.0.1 at 2013-09-13 12:41:20 -0500
|
457
|
+
Started GET "/assets/templates/test_html.js" for 127.0.0.1 at 2013-09-13 12:41:20 -0500
|
458
|
+
Started GET "/assets/templates/test.ngt" for 127.0.0.1 at 2013-09-13 12:41:32 -0500
|
459
|
+
Started GET "/assets/templates/test_haml.js" for 127.0.0.1 at 2013-09-13 12:41:32 -0500
|
460
|
+
Started GET "/assets/templates/test_html.js" for 127.0.0.1 at 2013-09-13 12:41:32 -0500
|
461
|
+
Started GET "/assets/templates/test.ngt" for 127.0.0.1 at 2013-09-13 12:51:09 -0500
|
462
|
+
Started GET "/assets/templates/test_haml.js" for 127.0.0.1 at 2013-09-13 12:51:10 -0500
|
463
|
+
Started GET "/assets/templates/test_html.js" for 127.0.0.1 at 2013-09-13 12:51:10 -0500
|
data/lib/angular/html2js.rb
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
require 'sprockets'
|
2
|
+
require 'angular/html2js/haml'
|
3
|
+
|
1
4
|
module Angular
|
2
5
|
module Html2js
|
3
6
|
def self.configure
|
@@ -34,6 +37,13 @@ module Angular
|
|
34
37
|
puts "Sorry, there is no such configuration option named #{config_name}"
|
35
38
|
super
|
36
39
|
end
|
40
|
+
|
41
|
+
def init_sprockets
|
42
|
+
# hack around bug in rails assets debug mode
|
43
|
+
# TODO: remove this once this bug is resolved: https://github.com/sstephenson/sprockets/issues/478
|
44
|
+
Sprockets.register_engine '.haml', Angular::Html2js::Haml
|
45
|
+
Sprockets.register_engine '.ngt', Angular::Html2js::Engine
|
46
|
+
end
|
37
47
|
end
|
38
48
|
end
|
39
49
|
end
|
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'angular/html2js/template'
|
2
|
-
|
3
2
|
module Angular
|
4
3
|
module Html2js
|
5
4
|
class Engine < Template
|
@@ -9,6 +8,9 @@ module Angular
|
|
9
8
|
def default_cache_id_proc
|
10
9
|
Proc.new { |file_path, scope| scope.logical_path }
|
11
10
|
end
|
11
|
+
|
12
12
|
end
|
13
|
+
|
14
|
+
config.init_sprockets
|
13
15
|
end
|
14
16
|
end
|
@@ -10,8 +10,8 @@ module Angular
|
|
10
10
|
config.angular_html2js = Angular::Html2js.config
|
11
11
|
end
|
12
12
|
|
13
|
-
initializer "angular_html2js.
|
14
|
-
|
13
|
+
initializer "angular_html2js.init_sprockets" do |app|
|
14
|
+
config.angular_html2js.init_sprockets
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
@@ -6,7 +6,9 @@ module Angular
|
|
6
6
|
class Template < Tilt::Template
|
7
7
|
attr_accessor :file
|
8
8
|
|
9
|
-
self.default_mime_type
|
9
|
+
def self.default_mime_type
|
10
|
+
'application/javascript'
|
11
|
+
end
|
10
12
|
|
11
13
|
TEMPLATE = <<-TEMPLATE
|
12
14
|
angular.module(\'%s\', []).run(function($templateCache) {
|
@@ -7,12 +7,11 @@ module Angular
|
|
7
7
|
describe Engine do
|
8
8
|
let(:env) do
|
9
9
|
Sprockets::Environment.new do |env|
|
10
|
-
env.register_engine '.ngt', Engine
|
11
10
|
env.append_path 'spec/assets/'
|
12
11
|
end
|
13
12
|
end
|
14
13
|
|
15
|
-
let(:asset) { env.find_asset('test.
|
14
|
+
let(:asset) { env.find_asset('test.ngt') }
|
16
15
|
|
17
16
|
it 'makes angular templates available' do
|
18
17
|
asset.to_s.should include("angular.module")
|
@@ -26,6 +25,40 @@ module Angular
|
|
26
25
|
it 'uses the logical path if no module_name is provided' do
|
27
26
|
asset.to_s.should include(".put('test'")
|
28
27
|
end
|
28
|
+
|
29
|
+
describe 'html file' do
|
30
|
+
let(:asset) { env.find_asset('test_html.js') }
|
31
|
+
|
32
|
+
it 'renders to an angular template ' do
|
33
|
+
pending 'html extension support' do
|
34
|
+
asset.to_s.should include("angular.module")
|
35
|
+
asset.to_s.should include("<h1>hello html</h1>")
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
it 'returns the correct content type for html templates' do
|
40
|
+
pending 'html extension support' do
|
41
|
+
asset.content_type.should eq 'application/javascript'
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
it "doesn't interfere with normal html files" do
|
46
|
+
env.find_asset('normal.html').to_s.should eq "<h1>hello normal html</h1>\n"
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
describe 'haml file' do
|
51
|
+
let(:asset) { env.find_asset('test_haml.js') }
|
52
|
+
|
53
|
+
it 'renders to an angular template ' do
|
54
|
+
asset.to_s.should include("angular.module")
|
55
|
+
asset.to_s.should include("<h1>hello haml</h1>")
|
56
|
+
end
|
57
|
+
|
58
|
+
it 'returns the correct content type for html templates' do
|
59
|
+
asset.content_type.should eq 'application/javascript'
|
60
|
+
end
|
61
|
+
end
|
29
62
|
end
|
30
63
|
end
|
31
64
|
end
|
@@ -10,17 +10,30 @@ require 'capybara/rails'
|
|
10
10
|
module Angular
|
11
11
|
module Html2js
|
12
12
|
describe Railtie, type: :feature do
|
13
|
-
before(:all) do
|
14
|
-
end
|
15
|
-
|
16
13
|
before(:each) { FileUtils.rm_rf Rails.root.join('tmp', 'cache', 'assets', 'test') }
|
17
14
|
|
18
|
-
it "
|
19
|
-
visit '/assets/templates/test.
|
15
|
+
it "sets up rails to serve ng templates" do
|
16
|
+
visit '/assets/templates/test.ngt'
|
20
17
|
page.should have_content "$templateCache"
|
21
18
|
page.should have_content "Hello World"
|
22
19
|
end
|
23
20
|
|
21
|
+
it "enables Haml for js assets" do
|
22
|
+
visit '/assets/templates/test_haml.js'
|
23
|
+
page.should have_content "$templateCache"
|
24
|
+
page.body.should include "<h1>hello haml</h1>"
|
25
|
+
end
|
26
|
+
|
27
|
+
describe 'file with .html extension' do
|
28
|
+
it 'is processed by default' do
|
29
|
+
pending 'html extension support' do
|
30
|
+
visit '/assets/templates/test_html.js'
|
31
|
+
page.should have_content "$templateCache"
|
32
|
+
page.body.should include "<h1>hello html</h1>"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
24
37
|
describe "Configuration" do
|
25
38
|
after { Html2js.reset_config! }
|
26
39
|
|
@@ -0,0 +1 @@
|
|
1
|
+
<h1>hello normal html</h1>
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
%h1 hello haml
|
@@ -0,0 +1 @@
|
|
1
|
+
<h1>hello html</h1>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: angular-html2js
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicholas Clark
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-09-
|
11
|
+
date: 2013-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tilt
|
@@ -164,6 +164,20 @@ dependencies:
|
|
164
164
|
- - ~>
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: 1.3.7
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: haml
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ~>
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: 4.0.0
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - ~>
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: 4.0.0
|
167
181
|
description: Angular HTML2JS allows you to use ng templates as first class citizens
|
168
182
|
in the Rails/Sprockets world. Based on the karma-ng-html2js-preprocessor for Karma.
|
169
183
|
email:
|
@@ -174,6 +188,7 @@ extra_rdoc_files: []
|
|
174
188
|
files:
|
175
189
|
- lib/angular/html2js/configuration.rb
|
176
190
|
- lib/angular/html2js/engine.rb
|
191
|
+
- lib/angular/html2js/haml.rb
|
177
192
|
- lib/angular/html2js/railtie.rb
|
178
193
|
- lib/angular/html2js/template.rb
|
179
194
|
- lib/angular/html2js/version.rb
|
@@ -181,13 +196,19 @@ files:
|
|
181
196
|
- LICENSE
|
182
197
|
- README.md
|
183
198
|
- spec/angular/html2js/engine_spec.rb
|
199
|
+
- spec/angular/html2js/haml_spec.rb
|
184
200
|
- spec/angular/html2js/railtie_spec.rb
|
185
201
|
- spec/angular/html2js/template_spec.rb
|
186
|
-
- spec/assets/
|
202
|
+
- spec/assets/normal.html
|
203
|
+
- spec/assets/test.ngt
|
204
|
+
- spec/assets/test_haml.ngt.haml
|
205
|
+
- spec/assets/test_html.ngt.html
|
187
206
|
- spec/spec_helper.rb
|
188
207
|
- spec/support/template_cache.coffee
|
189
208
|
- spec/support/template_matchers.rb
|
190
|
-
- app/app/assets/javascripts/templates/test.
|
209
|
+
- app/app/assets/javascripts/templates/test.ngt
|
210
|
+
- app/app/assets/javascripts/templates/test_haml.ngt.haml
|
211
|
+
- app/app/assets/javascripts/templates/test_html.ngt.html
|
191
212
|
- app/bin/bundle
|
192
213
|
- app/bin/rails
|
193
214
|
- app/bin/rake
|
@@ -242,13 +263,19 @@ specification_version: 4
|
|
242
263
|
summary: AngularJS HTML templates in Sprockets and Rails
|
243
264
|
test_files:
|
244
265
|
- spec/angular/html2js/engine_spec.rb
|
266
|
+
- spec/angular/html2js/haml_spec.rb
|
245
267
|
- spec/angular/html2js/railtie_spec.rb
|
246
268
|
- spec/angular/html2js/template_spec.rb
|
247
|
-
- spec/assets/
|
269
|
+
- spec/assets/normal.html
|
270
|
+
- spec/assets/test.ngt
|
271
|
+
- spec/assets/test_haml.ngt.haml
|
272
|
+
- spec/assets/test_html.ngt.html
|
248
273
|
- spec/spec_helper.rb
|
249
274
|
- spec/support/template_cache.coffee
|
250
275
|
- spec/support/template_matchers.rb
|
251
|
-
- app/app/assets/javascripts/templates/test.
|
276
|
+
- app/app/assets/javascripts/templates/test.ngt
|
277
|
+
- app/app/assets/javascripts/templates/test_haml.ngt.haml
|
278
|
+
- app/app/assets/javascripts/templates/test_html.ngt.html
|
252
279
|
- app/bin/bundle
|
253
280
|
- app/bin/rails
|
254
281
|
- app/bin/rake
|