ember-rails 0.20.4 → 0.20.5

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: f460a7d1062f0a12a4a5d4dbca47c6251a69cddf
4
- data.tar.gz: 87ff3aa9e2357051cb00d239d97f56611f83d5ab
3
+ metadata.gz: 83a8b7c6fea2c25f45fe04cba8a910249d4efc99
4
+ data.tar.gz: 6d74b54b523102a5102bb3d8c71c266d9ad04f8d
5
5
  SHA512:
6
- metadata.gz: 293beaa12ef47a4757e04a2929e9712481a4e84e6efeff178c27fae571a2d106e62f8fae1780c223c8d48f9276297561c7dc8150d8c03b08f15475a32be08de7
7
- data.tar.gz: 4d2eff017080719b39b59446deea1f724af427dd24f57fb21b24210338b7bb0910145f491b0ce029cab7f82cd333efa03d9ba8bfde064aa7ad9da2ee695109d7
6
+ metadata.gz: ebe6a524e6a697321c996fa517bf83a9531cb93803169a5add839c2e3a54eb62dc71d69a49726d9a80c08da78174fe17c714f0984f14390fcb8b4507bb05f6ea
7
+ data.tar.gz: 7c4228055e884d066e15c7a5d4f49603395f8184ad9815c02605043856b04907f500d27733be27c2b7c2bc0577c80449468b8b0d42ff5063f5780b3c7ed1d385
data/README.md CHANGED
@@ -184,6 +184,8 @@ config files (`config/application.rb`, `config/environments/development.rb`, etc
184
184
  | `config.ember.app_name` | Specificies a default application name for all generators. |
185
185
  | `config.ember.ember_path` | Specifies a default custom root path for all generators. |
186
186
  | `config.ember.module_prefix` | Sets module prefix for es6 module. This option is used for only `es6` scripts. Default value: `ember-app`. |
187
+ | `config.ember.prefix_files` | Sets some file names to add `config.ember.module_prefix` into its file name as es6 module name. |
188
+ | `config.ember.prefix_dirs` | Sets some dir names to add `config.ember.module_prefix` into its directory name as es6 module name. |
187
189
  | `config.handlebars.precompile` | Enables or disables precompilation. Default value: `true`. |
188
190
  | `config.handlebars.templates_root` | Sets the root path (under `app/assets/javascripts`) for templates to be looked up in. Default value: `"templates"`. |
189
191
  | `config.handlebars.templates_path_separator` | The path separator to use for templates. Default value: `'/'`. |
@@ -1,5 +1,5 @@
1
1
  module Ember
2
2
  module Rails
3
- VERSION = '0.20.4'
3
+ VERSION = '0.20.5'
4
4
  end
5
5
  end
@@ -18,7 +18,21 @@ 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 services serializers adapters transforms)
21
+ config.ember.prefix_dirs = %w(
22
+ models
23
+ controllers
24
+ views
25
+ routes
26
+ components
27
+ helpers
28
+ mixins
29
+ services
30
+ initializers
31
+ instance-initializers
32
+ serializers
33
+ adapters
34
+ transforms
35
+ )
22
36
 
23
37
  generators do |app|
24
38
  app.config.generators.assets = false
@@ -27,7 +27,7 @@ module Ember
27
27
  end
28
28
 
29
29
  def create_dir_layout
30
- %W{models controllers views routes helpers components templates templates/components mixins adapters}.each do |dir|
30
+ ember_prefix_dirs.each do |dir|
31
31
  empty_directory "#{ember_path}/#{dir}"
32
32
  create_file "#{ember_path}/#{dir}/.gitkeep" unless options[:skip_git]
33
33
  end
@@ -78,6 +78,17 @@ module Ember
78
78
  regex = /\z/
79
79
  {:after => regex}
80
80
  end
81
+
82
+ def ember_prefix_dirs
83
+ dirs =
84
+ if configuration
85
+ Array(configuration.prefix_dirs)
86
+ else
87
+ %w(models controllers views routes components helpers mixins serializers adapters transforms)
88
+ end
89
+
90
+ dirs + %w(templates templates/components)
91
+ end
81
92
  end
82
93
  end
83
94
  end
@@ -0,0 +1,23 @@
1
+ require 'generators/ember/generator_helpers'
2
+
3
+ module Ember
4
+ module Generators
5
+ class InitializerGenerator < ::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 initializer"
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_initializer_files
17
+ file_path = File.join(ember_path, 'initializers', class_path, "#{file_name.dasherize}.#{engine_extension}")
18
+
19
+ template "initializer.#{engine_extension}", file_path
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,23 @@
1
+ require 'generators/ember/generator_helpers'
2
+
3
+ module Ember
4
+ module Generators
5
+ class InstanceInitializerGenerator < ::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 instance initializer"
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_instance_initializer_files
17
+ file_path = File.join(ember_path, 'instance-initializers', class_path, "#{file_name.dasherize}.#{engine_extension}")
18
+
19
+ template "instance-initializer.#{engine_extension}", file_path
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,6 @@
1
+ <%= application_name.camelize %>.initializer({
2
+ name: '<%= class_name.underscore.dasherize %>'
3
+
4
+ initialize: ->
5
+ # Write your initializer here
6
+ })
@@ -0,0 +1,5 @@
1
+ <%= application_name.camelize %>.initializer
2
+ name: '<%= class_name.underscore.dasherize %>'
3
+
4
+ initialize: ->
5
+ # Write your initializer here
@@ -0,0 +1,7 @@
1
+ <%= application_name.camelize %>.initializer({
2
+ name: '<%= class_name.underscore.dasherize %>',
3
+
4
+ initialize: function() {
5
+ // Write your initializer here
6
+ }
7
+ });
@@ -0,0 +1,7 @@
1
+ export default {
2
+ name: '<%= class_name.underscore.dasherize %>',
3
+
4
+ initialize() {
5
+ // Write your initializer here
6
+ }
7
+ };
@@ -0,0 +1,6 @@
1
+ <%= application_name.camelize %>.instanceInitializer({
2
+ name: '<%= class_name.underscore.dasherize %>'
3
+
4
+ initialize: (application) ->
5
+ # Write your initializer here
6
+ })
@@ -0,0 +1,6 @@
1
+ <%= application_name.camelize %>.instanceInitializer({
2
+ name: '<%= class_name.underscore.dasherize %>'
3
+
4
+ initialize: (application) ->
5
+ # Write your initializer here
6
+ })
@@ -0,0 +1,7 @@
1
+ <%= application_name.camelize %>.instanceInitializer({
2
+ name: '<%= class_name.underscore.dasherize %>',
3
+
4
+ initialize: function(application) {
5
+ // Write your initializer here
6
+ }
7
+ });
@@ -0,0 +1,7 @@
1
+ export default {
2
+ name: '<%= class_name.underscore.dasherize %>',
3
+
4
+ initialize(application) {
5
+ // Write your initializer here
6
+ }
7
+ };
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.4
4
+ version: 0.20.5
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-20 00:00:00.000000000 Z
14
+ date: 2016-03-23 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: railties
@@ -285,7 +285,9 @@ files:
285
285
  - lib/generators/ember/component_generator.rb
286
286
  - lib/generators/ember/controller_generator.rb
287
287
  - lib/generators/ember/generator_helpers.rb
288
+ - lib/generators/ember/initializer_generator.rb
288
289
  - lib/generators/ember/install_generator.rb
290
+ - lib/generators/ember/instance_initializer_generator.rb
289
291
  - lib/generators/ember/model_generator.rb
290
292
  - lib/generators/ember/resource_generator.rb
291
293
  - lib/generators/ember/resource_override.rb
@@ -326,6 +328,14 @@ files:
326
328
  - lib/generators/templates/environment.em
327
329
  - lib/generators/templates/environment.js
328
330
  - lib/generators/templates/environment.module.es6
331
+ - lib/generators/templates/initializer.coffee
332
+ - lib/generators/templates/initializer.em
333
+ - lib/generators/templates/initializer.js
334
+ - lib/generators/templates/initializer.module.es6
335
+ - lib/generators/templates/instance-initializer.coffee
336
+ - lib/generators/templates/instance-initializer.em
337
+ - lib/generators/templates/instance-initializer.js
338
+ - lib/generators/templates/instance-initializer.module.es6
329
339
  - lib/generators/templates/model.coffee
330
340
  - lib/generators/templates/model.em
331
341
  - lib/generators/templates/model.js