ember-rails 0.20.3 → 0.20.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e4c1ced464e937e3a8cf4033fbf76a0e4399a5ba
4
- data.tar.gz: 98b387136e9754746826f314c8ee42abba08c2fc
3
+ metadata.gz: f460a7d1062f0a12a4a5d4dbca47c6251a69cddf
4
+ data.tar.gz: 87ff3aa9e2357051cb00d239d97f56611f83d5ab
5
5
  SHA512:
6
- metadata.gz: 391b05abec66782c91db35fb3bd9794f159fc3f1cef2dad4f8b1ac0a52a81f9b76e0d8babf94e989107221c6d2efd643959093a6cc8d1cd45f619e61a11a14cf
7
- data.tar.gz: 0f83321b984c7b8b17c729e88b381b606f55bfcd004e761fd055b17defb0175e2cf26ba158da23508294fcf5a5116dad58a119f0cfbec260671bf6a7115c978a
6
+ metadata.gz: 293beaa12ef47a4757e04a2929e9712481a4e84e6efeff178c27fae571a2d106e62f8fae1780c223c8d48f9276297561c7dc8150d8c03b08f15475a32be08de7
7
+ data.tar.gz: 4d2eff017080719b39b59446deea1f724af427dd24f57fb21b24210338b7bb0910145f491b0ce029cab7f82cd333efa03d9ba8bfde064aa7ad9da2ee695109d7
@@ -1,5 +1,5 @@
1
1
  module Ember
2
2
  module Rails
3
- VERSION = '0.20.3'
3
+ VERSION = '0.20.4'
4
4
  end
5
5
  end
@@ -18,7 +18,7 @@ module Ember
18
18
  config.ember = ActiveSupport::OrderedOptions.new
19
19
  config.ember.module_prefix = 'ember-app'
20
20
  config.ember.prefix_files = %w(store router)
21
- config.ember.prefix_dirs = %w(models controllers views routes components helpers mixins serializers adapters transforms)
21
+ config.ember.prefix_dirs = %w(models controllers views routes components helpers mixins services serializers adapters transforms)
22
22
 
23
23
  generators do |app|
24
24
  app.config.generators.assets = false
@@ -21,7 +21,7 @@ module Ember
21
21
  else
22
22
  inject_into_application_file(engine_extension)
23
23
  end
24
- rescue Exception => e
24
+ rescue Exception
25
25
  inject_into_application_file('js')
26
26
  end
27
27
  end
@@ -69,14 +69,14 @@ module Ember
69
69
  end
70
70
 
71
71
  def get_options_from_contents(contents)
72
- if contents =~ regex = /^.*require_tree.*$/
73
- {:before => regex}
74
- elsif contents =~ regex = /^\s*$/
75
- {:before => regex}
76
- else
77
- regex = /\z/
78
- {:after => regex}
79
- end
72
+ regex = /^.*require_tree.*$/
73
+ return {:before => regex} if contents =~ regex
74
+
75
+ regex = /^\s*$/
76
+ return {:before => regex} if contents =~ regex
77
+
78
+ regex = /\z/
79
+ {:after => regex}
80
80
  end
81
81
  end
82
82
  end
@@ -181,7 +181,7 @@ module Ember
181
181
  raise Thor::Error
182
182
  end
183
183
  output.rewind
184
- content = output.read
184
+ output.read
185
185
  end
186
186
 
187
187
  def resource_exist?(target)
@@ -0,0 +1,23 @@
1
+ require 'generators/ember/generator_helpers'
2
+
3
+ module Ember
4
+ module Generators
5
+ class ServiceGenerator < ::Rails::Generators::NamedBase
6
+ include Ember::Generators::GeneratorHelpers
7
+
8
+ source_root File.expand_path("../../templates", __FILE__)
9
+
10
+ desc "Creates a new Ember.js service"
11
+
12
+ class_option :javascript_engine, :desc => "Engine for JavaScripts"
13
+ class_option :ember_path, :type => :string, :aliases => "-d", :default => false, :desc => "Custom ember app path"
14
+ class_option :app_name, :type => :string, :aliases => "-n", :default => false, :desc => "Custom ember app name"
15
+
16
+ def create_service_files
17
+ file_path = File.join(ember_path, 'services', class_path, "#{file_name.dasherize}.#{engine_extension}")
18
+
19
+ template "service.#{engine_extension}", file_path
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,3 @@
1
+ <%= application_name.camelize %>.<%= class_name %>Service = Ember.Service.extend({
2
+
3
+ })
@@ -0,0 +1 @@
1
+ class <%= application_name.camelize %>.<%= class_name %>Service extends Ember.Service
@@ -0,0 +1,3 @@
1
+ <%= application_name.camelize %>.<%= class_name %>Service = Ember.Service.extend({
2
+
3
+ });
@@ -0,0 +1,5 @@
1
+ import Ember from 'ember';
2
+
3
+ export default Ember.Service.extend({
4
+
5
+ });
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.20.3
4
+ version: 0.20.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Keith Pitt
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2016-03-07 00:00:00.000000000 Z
14
+ date: 2016-03-20 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: railties
@@ -290,6 +290,7 @@ files:
290
290
  - lib/generators/ember/resource_generator.rb
291
291
  - lib/generators/ember/resource_override.rb
292
292
  - lib/generators/ember/route_generator.rb
293
+ - lib/generators/ember/service_generator.rb
293
294
  - lib/generators/ember/template_generator.rb
294
295
  - lib/generators/ember/view_generator.rb
295
296
  - lib/generators/templates/adapter.coffee
@@ -341,6 +342,10 @@ files:
341
342
  - lib/generators/templates/router.em
342
343
  - lib/generators/templates/router.js
343
344
  - lib/generators/templates/router.module.es6
345
+ - lib/generators/templates/service.coffee
346
+ - lib/generators/templates/service.em
347
+ - lib/generators/templates/service.js
348
+ - lib/generators/templates/service.module.es6
344
349
  - lib/generators/templates/template.hbs
345
350
  - lib/generators/templates/view.coffee
346
351
  - lib/generators/templates/view.em