ember-rails 0.14.0 → 0.18.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +141 -102
- data/lib/ember/rails/engine.rb +8 -5
- data/lib/ember/rails/version.rb +1 -1
- data/lib/ember_rails.rb +36 -16
- data/lib/generators/ember/adapter_generator.rb +21 -0
- data/lib/generators/ember/bootstrap_generator.rb +6 -3
- data/lib/generators/ember/component_generator.rb +2 -2
- data/lib/generators/ember/generator_helpers.rb +7 -5
- data/lib/generators/ember/install_generator.rb +64 -32
- data/lib/generators/ember/resource_override.rb +8 -2
- data/lib/generators/ember/template_generator.rb +2 -2
- data/lib/generators/templates/adapter.js +5 -0
- data/lib/generators/templates/adapter.js.coffee +5 -0
- data/lib/generators/templates/adapter.js.em +3 -0
- data/lib/generators/templates/app.js +2 -2
- data/lib/generators/templates/app.js.coffee +2 -1
- data/lib/generators/templates/app.js.em +3 -1
- data/lib/generators/templates/{application.handlebars → application.hbs} +0 -0
- data/lib/generators/templates/application.js +3 -2
- data/lib/generators/templates/application.js.coffee +3 -1
- data/lib/generators/templates/application.js.em +3 -1
- data/lib/generators/templates/application_adapter.js +5 -0
- data/lib/generators/templates/application_adapter.js.coffee +5 -0
- data/lib/generators/templates/application_adapter.js.em +3 -0
- data/lib/generators/templates/array_controller.js +1 -1
- data/lib/generators/templates/{component.template.handlebars → component.template.hbs} +0 -0
- data/lib/generators/templates/model.js +1 -1
- data/lib/generators/templates/model.js.coffee +1 -1
- data/lib/generators/templates/model.js.em +1 -1
- data/lib/generators/templates/{template.handlebars → template.hbs} +0 -0
- metadata +77 -103
- data/lib/ember/handlebars/template.rb +0 -113
- data/lib/generators/templates/store.js +0 -7
- data/lib/generators/templates/store.js.coffee +0 -6
- data/lib/generators/templates/store.js.em +0 -7
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ember-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.18.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Keith Pitt
|
@@ -11,232 +11,202 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2015-03-29 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
|
-
- !ruby/object:Gem::Dependency
|
17
|
-
name: execjs
|
18
|
-
requirement: !ruby/object:Gem::Requirement
|
19
|
-
requirements:
|
20
|
-
- - '>='
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: '1.2'
|
23
|
-
type: :runtime
|
24
|
-
prerelease: false
|
25
|
-
version_requirements: !ruby/object:Gem::Requirement
|
26
|
-
requirements:
|
27
|
-
- - '>='
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '1.2'
|
30
16
|
- !ruby/object:Gem::Dependency
|
31
17
|
name: railties
|
32
18
|
requirement: !ruby/object:Gem::Requirement
|
33
19
|
requirements:
|
34
|
-
- -
|
20
|
+
- - ">="
|
35
21
|
- !ruby/object:Gem::Version
|
36
22
|
version: '3.1'
|
37
23
|
type: :runtime
|
38
24
|
prerelease: false
|
39
25
|
version_requirements: !ruby/object:Gem::Requirement
|
40
26
|
requirements:
|
41
|
-
- -
|
27
|
+
- - ">="
|
42
28
|
- !ruby/object:Gem::Version
|
43
29
|
version: '3.1'
|
44
30
|
- !ruby/object:Gem::Dependency
|
45
31
|
name: active_model_serializers
|
46
32
|
requirement: !ruby/object:Gem::Requirement
|
47
33
|
requirements:
|
48
|
-
- -
|
34
|
+
- - ">="
|
49
35
|
- !ruby/object:Gem::Version
|
50
36
|
version: '0'
|
51
37
|
type: :runtime
|
52
38
|
prerelease: false
|
53
39
|
version_requirements: !ruby/object:Gem::Requirement
|
54
40
|
requirements:
|
55
|
-
- -
|
41
|
+
- - ">="
|
56
42
|
- !ruby/object:Gem::Version
|
57
43
|
version: '0'
|
58
44
|
- !ruby/object:Gem::Dependency
|
59
|
-
name:
|
45
|
+
name: jquery-rails
|
60
46
|
requirement: !ruby/object:Gem::Requirement
|
61
47
|
requirements:
|
62
|
-
- -
|
48
|
+
- - ">="
|
63
49
|
- !ruby/object:Gem::Version
|
64
|
-
version: 0.
|
50
|
+
version: 1.0.17
|
65
51
|
type: :runtime
|
66
52
|
prerelease: false
|
67
53
|
version_requirements: !ruby/object:Gem::Requirement
|
68
54
|
requirements:
|
69
|
-
- -
|
55
|
+
- - ">="
|
70
56
|
- !ruby/object:Gem::Version
|
71
|
-
version: 0.
|
57
|
+
version: 1.0.17
|
72
58
|
- !ruby/object:Gem::Dependency
|
73
59
|
name: ember-source
|
74
60
|
requirement: !ruby/object:Gem::Requirement
|
75
61
|
requirements:
|
76
|
-
- -
|
62
|
+
- - ">="
|
77
63
|
- !ruby/object:Gem::Version
|
78
|
-
version:
|
79
|
-
type: :runtime
|
80
|
-
prerelease: false
|
81
|
-
version_requirements: !ruby/object:Gem::Requirement
|
82
|
-
requirements:
|
83
|
-
- - '>='
|
84
|
-
- !ruby/object:Gem::Version
|
85
|
-
version: '0'
|
86
|
-
- !ruby/object:Gem::Dependency
|
87
|
-
name: handlebars-source
|
88
|
-
requirement: !ruby/object:Gem::Requirement
|
89
|
-
requirements:
|
90
|
-
- - '>='
|
91
|
-
- !ruby/object:Gem::Version
|
92
|
-
version: '0'
|
64
|
+
version: 1.1.0
|
93
65
|
type: :runtime
|
94
66
|
prerelease: false
|
95
67
|
version_requirements: !ruby/object:Gem::Requirement
|
96
68
|
requirements:
|
97
|
-
- -
|
69
|
+
- - ">="
|
98
70
|
- !ruby/object:Gem::Version
|
99
|
-
version:
|
71
|
+
version: 1.1.0
|
100
72
|
- !ruby/object:Gem::Dependency
|
101
73
|
name: ember-data-source
|
102
74
|
requirement: !ruby/object:Gem::Requirement
|
103
75
|
requirements:
|
104
|
-
- -
|
76
|
+
- - ">="
|
105
77
|
- !ruby/object:Gem::Version
|
106
|
-
version:
|
78
|
+
version: 1.0.0.beta.5
|
107
79
|
type: :runtime
|
108
80
|
prerelease: false
|
109
81
|
version_requirements: !ruby/object:Gem::Requirement
|
110
82
|
requirements:
|
111
|
-
- -
|
83
|
+
- - ">="
|
112
84
|
- !ruby/object:Gem::Version
|
113
|
-
version:
|
85
|
+
version: 1.0.0.beta.5
|
114
86
|
- !ruby/object:Gem::Dependency
|
115
|
-
name:
|
87
|
+
name: ember-handlebars-template
|
116
88
|
requirement: !ruby/object:Gem::Requirement
|
117
89
|
requirements:
|
118
|
-
- -
|
90
|
+
- - ">="
|
119
91
|
- !ruby/object:Gem::Version
|
120
|
-
version: 1.0
|
92
|
+
version: 0.1.0
|
93
|
+
- - "<"
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '1.0'
|
121
96
|
type: :runtime
|
122
97
|
prerelease: false
|
123
98
|
version_requirements: !ruby/object:Gem::Requirement
|
124
99
|
requirements:
|
125
|
-
- -
|
100
|
+
- - ">="
|
126
101
|
- !ruby/object:Gem::Version
|
127
|
-
version: 1.0
|
102
|
+
version: 0.1.0
|
103
|
+
- - "<"
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: '1.0'
|
128
106
|
- !ruby/object:Gem::Dependency
|
129
107
|
name: bundler
|
130
108
|
requirement: !ruby/object:Gem::Requirement
|
131
109
|
requirements:
|
132
|
-
- -
|
110
|
+
- - ">="
|
133
111
|
- !ruby/object:Gem::Version
|
134
112
|
version: 1.2.2
|
135
113
|
type: :development
|
136
114
|
prerelease: false
|
137
115
|
version_requirements: !ruby/object:Gem::Requirement
|
138
116
|
requirements:
|
139
|
-
- -
|
117
|
+
- - ">="
|
140
118
|
- !ruby/object:Gem::Version
|
141
119
|
version: 1.2.2
|
142
120
|
- !ruby/object:Gem::Dependency
|
143
121
|
name: appraisal
|
144
122
|
requirement: !ruby/object:Gem::Requirement
|
145
123
|
requirements:
|
146
|
-
- -
|
124
|
+
- - ">="
|
147
125
|
- !ruby/object:Gem::Version
|
148
|
-
version:
|
126
|
+
version: 1.0.0
|
149
127
|
type: :development
|
150
128
|
prerelease: false
|
151
129
|
version_requirements: !ruby/object:Gem::Requirement
|
152
130
|
requirements:
|
153
|
-
- -
|
131
|
+
- - ">="
|
154
132
|
- !ruby/object:Gem::Version
|
155
|
-
version:
|
133
|
+
version: 1.0.0
|
156
134
|
- !ruby/object:Gem::Dependency
|
157
135
|
name: tzinfo
|
158
136
|
requirement: !ruby/object:Gem::Requirement
|
159
137
|
requirements:
|
160
|
-
- -
|
138
|
+
- - ">="
|
161
139
|
- !ruby/object:Gem::Version
|
162
140
|
version: '0'
|
163
141
|
type: :development
|
164
142
|
prerelease: false
|
165
143
|
version_requirements: !ruby/object:Gem::Requirement
|
166
144
|
requirements:
|
167
|
-
- -
|
145
|
+
- - ">="
|
168
146
|
- !ruby/object:Gem::Version
|
169
147
|
version: '0'
|
170
148
|
- !ruby/object:Gem::Dependency
|
171
|
-
name:
|
149
|
+
name: vcr
|
172
150
|
requirement: !ruby/object:Gem::Requirement
|
173
151
|
requirements:
|
174
|
-
- -
|
152
|
+
- - ">="
|
175
153
|
- !ruby/object:Gem::Version
|
176
|
-
version:
|
154
|
+
version: '0'
|
177
155
|
type: :development
|
178
156
|
prerelease: false
|
179
157
|
version_requirements: !ruby/object:Gem::Requirement
|
180
158
|
requirements:
|
181
|
-
- -
|
159
|
+
- - ">="
|
182
160
|
- !ruby/object:Gem::Version
|
183
|
-
version:
|
161
|
+
version: '0'
|
184
162
|
- !ruby/object:Gem::Dependency
|
185
|
-
name:
|
163
|
+
name: webmock
|
186
164
|
requirement: !ruby/object:Gem::Requirement
|
187
165
|
requirements:
|
188
|
-
- -
|
166
|
+
- - "<"
|
189
167
|
- !ruby/object:Gem::Version
|
190
|
-
version: 1.
|
168
|
+
version: 1.14.0
|
191
169
|
type: :development
|
192
170
|
prerelease: false
|
193
171
|
version_requirements: !ruby/object:Gem::Requirement
|
194
172
|
requirements:
|
195
|
-
- -
|
173
|
+
- - "<"
|
196
174
|
- !ruby/object:Gem::Version
|
197
|
-
version: 1.
|
175
|
+
version: 1.14.0
|
198
176
|
- !ruby/object:Gem::Dependency
|
199
177
|
name: sprockets-rails
|
200
178
|
requirement: !ruby/object:Gem::Requirement
|
201
179
|
requirements:
|
202
|
-
- -
|
180
|
+
- - ">="
|
203
181
|
- !ruby/object:Gem::Version
|
204
182
|
version: '0'
|
205
183
|
type: :development
|
206
184
|
prerelease: false
|
207
185
|
version_requirements: !ruby/object:Gem::Requirement
|
208
186
|
requirements:
|
209
|
-
- -
|
187
|
+
- - ">="
|
210
188
|
- !ruby/object:Gem::Version
|
211
189
|
version: '0'
|
212
190
|
- !ruby/object:Gem::Dependency
|
213
|
-
name:
|
191
|
+
name: handlebars-source
|
214
192
|
requirement: !ruby/object:Gem::Requirement
|
215
193
|
requirements:
|
216
|
-
- -
|
217
|
-
- !ruby/object:Gem::Version
|
218
|
-
version: '0'
|
219
|
-
type: :development
|
220
|
-
prerelease: false
|
221
|
-
version_requirements: !ruby/object:Gem::Requirement
|
222
|
-
requirements:
|
223
|
-
- - '>='
|
194
|
+
- - ">"
|
224
195
|
- !ruby/object:Gem::Version
|
225
|
-
version:
|
226
|
-
-
|
227
|
-
name: webmock
|
228
|
-
requirement: !ruby/object:Gem::Requirement
|
229
|
-
requirements:
|
230
|
-
- - <
|
196
|
+
version: 1.0.0
|
197
|
+
- - "<"
|
231
198
|
- !ruby/object:Gem::Version
|
232
|
-
version:
|
199
|
+
version: '3'
|
233
200
|
type: :development
|
234
201
|
prerelease: false
|
235
202
|
version_requirements: !ruby/object:Gem::Requirement
|
236
203
|
requirements:
|
237
|
-
- -
|
204
|
+
- - ">"
|
238
205
|
- !ruby/object:Gem::Version
|
239
|
-
version: 1.
|
206
|
+
version: 1.0.0
|
207
|
+
- - "<"
|
208
|
+
- !ruby/object:Gem::Version
|
209
|
+
version: '3'
|
240
210
|
description:
|
241
211
|
email:
|
242
212
|
- me@keithpitt.com
|
@@ -245,13 +215,13 @@ executables: []
|
|
245
215
|
extensions: []
|
246
216
|
extra_rdoc_files: []
|
247
217
|
files:
|
248
|
-
- README.md
|
249
218
|
- LICENSE
|
250
|
-
-
|
219
|
+
- README.md
|
220
|
+
- lib/ember-rails.rb
|
251
221
|
- lib/ember/rails/engine.rb
|
252
222
|
- lib/ember/rails/version.rb
|
253
|
-
- lib/ember-rails.rb
|
254
223
|
- lib/ember_rails.rb
|
224
|
+
- lib/generators/ember/adapter_generator.rb
|
255
225
|
- lib/generators/ember/bootstrap_generator.rb
|
256
226
|
- lib/generators/ember/component_generator.rb
|
257
227
|
- lib/generators/ember/controller_generator.rb
|
@@ -263,20 +233,26 @@ files:
|
|
263
233
|
- lib/generators/ember/route_generator.rb
|
264
234
|
- lib/generators/ember/template_generator.rb
|
265
235
|
- lib/generators/ember/view_generator.rb
|
236
|
+
- lib/generators/templates/adapter.js
|
237
|
+
- lib/generators/templates/adapter.js.coffee
|
238
|
+
- lib/generators/templates/adapter.js.em
|
266
239
|
- lib/generators/templates/app.js
|
267
240
|
- lib/generators/templates/app.js.coffee
|
268
241
|
- lib/generators/templates/app.js.em
|
269
|
-
- lib/generators/templates/application.
|
242
|
+
- lib/generators/templates/application.hbs
|
270
243
|
- lib/generators/templates/application.js
|
271
244
|
- lib/generators/templates/application.js.coffee
|
272
245
|
- lib/generators/templates/application.js.em
|
246
|
+
- lib/generators/templates/application_adapter.js
|
247
|
+
- lib/generators/templates/application_adapter.js.coffee
|
248
|
+
- lib/generators/templates/application_adapter.js.em
|
273
249
|
- lib/generators/templates/array_controller.js
|
274
250
|
- lib/generators/templates/array_controller.js.coffee
|
275
251
|
- lib/generators/templates/array_controller.js.em
|
276
252
|
- lib/generators/templates/component.js
|
277
253
|
- lib/generators/templates/component.js.coffee
|
278
254
|
- lib/generators/templates/component.js.em
|
279
|
-
- lib/generators/templates/component.template.
|
255
|
+
- lib/generators/templates/component.template.hbs
|
280
256
|
- lib/generators/templates/controller.js
|
281
257
|
- lib/generators/templates/controller.js.coffee
|
282
258
|
- lib/generators/templates/controller.js.em
|
@@ -292,15 +268,13 @@ files:
|
|
292
268
|
- lib/generators/templates/router.js
|
293
269
|
- lib/generators/templates/router.js.coffee
|
294
270
|
- lib/generators/templates/router.js.em
|
295
|
-
- lib/generators/templates/
|
296
|
-
- lib/generators/templates/store.js.coffee
|
297
|
-
- lib/generators/templates/store.js.em
|
298
|
-
- lib/generators/templates/template.handlebars
|
271
|
+
- lib/generators/templates/template.hbs
|
299
272
|
- lib/generators/templates/view.js
|
300
273
|
- lib/generators/templates/view.js.coffee
|
301
274
|
- lib/generators/templates/view.js.em
|
302
275
|
homepage: https://github.com/emberjs/ember-rails
|
303
|
-
licenses:
|
276
|
+
licenses:
|
277
|
+
- MIT
|
304
278
|
metadata: {}
|
305
279
|
post_install_message:
|
306
280
|
rdoc_options: []
|
@@ -308,17 +282,17 @@ require_paths:
|
|
308
282
|
- lib
|
309
283
|
required_ruby_version: !ruby/object:Gem::Requirement
|
310
284
|
requirements:
|
311
|
-
- -
|
285
|
+
- - ">="
|
312
286
|
- !ruby/object:Gem::Version
|
313
287
|
version: '0'
|
314
288
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
315
289
|
requirements:
|
316
|
-
- -
|
290
|
+
- - ">="
|
317
291
|
- !ruby/object:Gem::Version
|
318
292
|
version: '0'
|
319
293
|
requirements: []
|
320
294
|
rubyforge_project:
|
321
|
-
rubygems_version: 2.
|
295
|
+
rubygems_version: 2.4.5
|
322
296
|
signing_key:
|
323
297
|
specification_version: 4
|
324
298
|
summary: Ember for Rails 3.1+
|
@@ -1,113 +0,0 @@
|
|
1
|
-
require 'sprockets'
|
2
|
-
require 'sprockets/engines'
|
3
|
-
require 'barber'
|
4
|
-
|
5
|
-
module Ember
|
6
|
-
module Handlebars
|
7
|
-
class Template < Tilt::Template
|
8
|
-
def self.default_mime_type
|
9
|
-
'application/javascript'
|
10
|
-
end
|
11
|
-
|
12
|
-
def prepare; end
|
13
|
-
|
14
|
-
def evaluate(scope, locals, &block)
|
15
|
-
raw = handlebars?(scope)
|
16
|
-
|
17
|
-
if raw
|
18
|
-
template = data
|
19
|
-
else
|
20
|
-
template = mustache_to_handlebars(scope, data)
|
21
|
-
end
|
22
|
-
|
23
|
-
if configuration.precompile
|
24
|
-
if raw
|
25
|
-
template = precompile_handlebars(template)
|
26
|
-
else
|
27
|
-
template = precompile_ember_handlebars(template)
|
28
|
-
end
|
29
|
-
else
|
30
|
-
if raw
|
31
|
-
template = compile_handlebars(data)
|
32
|
-
else
|
33
|
-
template = compile_ember_handlebars(template)
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
if configuration.output_type == :amd
|
38
|
-
target = amd_template_target(scope)
|
39
|
-
|
40
|
-
"define('#{target}', ['exports'], function(__exports__){ __exports__.default = #{template} });"
|
41
|
-
else
|
42
|
-
target = global_template_target(scope)
|
43
|
-
|
44
|
-
"#{target} = #{template}\n"
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
private
|
49
|
-
|
50
|
-
def handlebars?(scope)
|
51
|
-
scope.pathname.to_s =~ /\.raw\.(handlebars|hjs|hbs)/
|
52
|
-
end
|
53
|
-
|
54
|
-
def amd_template_target(scope)
|
55
|
-
"#{configuration.amd_namespace}/#{scope.logical_path.split(".").first}"
|
56
|
-
end
|
57
|
-
|
58
|
-
def global_template_target(scope)
|
59
|
-
"Ember.TEMPLATES[#{template_path(scope.logical_path).inspect}]"
|
60
|
-
end
|
61
|
-
|
62
|
-
def compile_handlebars(string)
|
63
|
-
"Handlebars.compile(#{indent(string).inspect});"
|
64
|
-
end
|
65
|
-
|
66
|
-
def precompile_handlebars(string)
|
67
|
-
Barber::FilePrecompiler.call(string)
|
68
|
-
end
|
69
|
-
|
70
|
-
def compile_ember_handlebars(string)
|
71
|
-
"Ember.Handlebars.compile(#{indent(string).inspect});"
|
72
|
-
end
|
73
|
-
|
74
|
-
def precompile_ember_handlebars(string)
|
75
|
-
Barber::Ember::FilePrecompiler.call(string)
|
76
|
-
end
|
77
|
-
|
78
|
-
def mustache_to_handlebars(scope, template)
|
79
|
-
if scope.pathname.to_s =~ /\.mustache\.(handlebars|hjs|hbs)/
|
80
|
-
template.gsub(/\{\{(\w[^\}\}]+)\}\}/){ |x| "{{unbound #{$1}}}" }
|
81
|
-
else
|
82
|
-
template
|
83
|
-
end
|
84
|
-
end
|
85
|
-
|
86
|
-
def template_path(path)
|
87
|
-
root = configuration.templates_root
|
88
|
-
|
89
|
-
if root.kind_of? Array
|
90
|
-
root.each do |root|
|
91
|
-
path.sub!(/#{Regexp.quote(root)}\//, '')
|
92
|
-
end
|
93
|
-
else
|
94
|
-
unless root.empty?
|
95
|
-
path.sub!(/#{Regexp.quote(root)}\/?/, '')
|
96
|
-
end
|
97
|
-
end
|
98
|
-
|
99
|
-
path = path.split('/')
|
100
|
-
|
101
|
-
path.join(configuration.templates_path_separator)
|
102
|
-
end
|
103
|
-
|
104
|
-
def configuration
|
105
|
-
::Rails.configuration.handlebars
|
106
|
-
end
|
107
|
-
|
108
|
-
def indent(string)
|
109
|
-
string.gsub(/$(.)/m, "\\1 ").strip
|
110
|
-
end
|
111
|
-
end
|
112
|
-
end
|
113
|
-
end
|