active_generator 4.0.1 → 4.0.2

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: e03c2c9f0ff2757a54adbac0597bafd164c81576
4
- data.tar.gz: a8bba9b3547e1e52c27021e0eb13aad63a82bd5c
3
+ metadata.gz: aaf1c1e12a16b1b8eeb76c1e3bc84cab50b51f6e
4
+ data.tar.gz: 8e2c58e99340d39afdd422295790e741adc3d85e
5
5
  SHA512:
6
- metadata.gz: 4f8fcaf18b7239c97a6a310950858533237c2c16a0b2004902c5c7fc6d56a366cbe92a58c73c0117e36bcbeec2f2e2a7e40f6883dbe870ff1c0b268bdc07034a
7
- data.tar.gz: 0ff3a24b029c62fc05950d794aa8d16f0f5726b8ad82a10138b33d48da870ea783a2057419adc3478461c0464ae07102c73d442ed62abda74ecef1d1012a07c1
6
+ metadata.gz: 2db97c82034ce58252d3c1898c9511d67dd6a9430df84192bdd87bd6e1bc7b0d29335ee5b20df680873452289958ca86e228677b3f2bf4530e50ce14a6bd4bb2
7
+ data.tar.gz: 5b0f8e12f0112be6e0e88d403b264fc89c1e60219dba9d56ed2d060368ba015915308615a57518c0f4b0c99e0225d3c4c53254d17f578f1d1a7ed1dd04548725
data/.rubocop.yml CHANGED
@@ -13,10 +13,6 @@ Style/Alias:
13
13
  EnforcedStyle: prefer_alias_method
14
14
  Style/BracesAroundHashParameters:
15
15
  Enabled: false
16
- Style/ClassAndModuleChildren:
17
- EnforcedStyle: compact
18
- Exclude:
19
- - 'lib/generators/locale/base.rb'
20
16
  Style/ClosingParenthesisIndentation:
21
17
  Enabled: false
22
18
  Style/Documentation:
@@ -1,33 +1,35 @@
1
- module ActiveGenerator::Base
1
+ module ActiveGenerator
2
+ module Base
2
3
 
3
- private
4
+ private
4
5
 
5
- def file_name_table
6
- file_name.underscore
7
- end
6
+ def file_name_table
7
+ file_name.underscore
8
+ end
8
9
 
9
- def file_name_human
10
- file_name_table.tr('_', ' ').downcase.capitalize
11
- end
10
+ def file_name_human
11
+ file_name_table.tr('_', ' ').downcase.capitalize
12
+ end
12
13
 
13
- def namespace
14
- name.downcase.split('/')[0...-1]
15
- end
14
+ def namespace
15
+ name.downcase.split('/')[0...-1]
16
+ end
16
17
 
17
- def namespaced?
18
- name.include?('/')
19
- end
18
+ def namespaced?
19
+ name.include?('/')
20
+ end
20
21
 
21
- def namespace_human
22
- namespace.join(' ').tr('_', ' ').downcase.capitalize
23
- end
22
+ def namespace_human
23
+ namespace.join(' ').tr('_', ' ').downcase.capitalize
24
+ end
24
25
 
25
- def namespace_table
26
- namespace.join('_')
27
- end
26
+ def namespace_table
27
+ namespace.join('_')
28
+ end
28
29
 
29
- def namespace_path
30
- namespace.join('/')
31
- end
30
+ def namespace_path
31
+ namespace.join('/')
32
+ end
32
33
 
34
+ end
33
35
  end
@@ -1,16 +1,18 @@
1
1
  require 'dry-configurable'
2
2
 
3
- class ActiveGenerator::Settings
4
- extend Dry::Configurable
3
+ module ActiveGenerator
4
+ class Settings
5
+ extend Dry::Configurable
5
6
 
6
- setting :autoload_controller_generator_locale, true
7
- setting :autoload_helper_generator_locale, true
8
- setting :autoload_job_generator_locale, true
9
- setting :autoload_mailer_generator_locale, true
10
- setting :autoload_model_generator_locale, true
11
- setting :autoload_service_generator_locale, true
12
- setting :autoload_task_generator_locale, true
13
- setting :autoload_view_generator_locale, true
14
- setting :test_framework, 'test_unit'
7
+ setting :autoload_controller_generator_locale, true
8
+ setting :autoload_helper_generator_locale, true
9
+ setting :autoload_job_generator_locale, true
10
+ setting :autoload_mailer_generator_locale, true
11
+ setting :autoload_model_generator_locale, true
12
+ setting :autoload_service_generator_locale, true
13
+ setting :autoload_task_generator_locale, true
14
+ setting :autoload_view_generator_locale, true
15
+ setting :test_framework, 'test_unit'
15
16
 
17
+ end
16
18
  end
@@ -1,3 +1,3 @@
1
1
  module ActiveGenerator
2
- VERSION = '4.0.1'.freeze
2
+ VERSION = '4.0.2'.freeze
3
3
  end
@@ -1,8 +1,10 @@
1
- class ActiveGenerator::InstallGenerator < Rails::Generators::Base
2
- source_root File.expand_path('../templates', __FILE__)
1
+ module ActiveGenerator
2
+ class InstallGenerator < Rails::Generators::Base
3
+ source_root File.expand_path('../templates', __FILE__)
3
4
 
4
- def copy_initializer_file
5
- copy_file('install.rb', 'config/initializers/active_generator.rb')
6
- end
5
+ def copy_initializer_file
6
+ copy_file('install.rb', 'config/initializers/active_generator.rb')
7
+ end
7
8
 
9
+ end
8
10
  end
@@ -1,18 +1,20 @@
1
1
  require 'active_generator/base'
2
2
  require 'generators/locale/base'
3
3
 
4
- class Locale::ApiGenerator < Rails::Generators::NamedBase
5
- include ActiveGenerator::Base
6
- include Locale::Base
4
+ module Locale
5
+ class ApiGenerator < Rails::Generators::NamedBase
6
+ include ActiveGenerator::Base
7
+ include Locale::Base
7
8
 
8
- source_root File.expand_path('../templates', __FILE__)
9
- argument :language, type: :string, required: false, default: 'en', desc: 'The locale alpha code'
9
+ source_root File.expand_path('../templates', __FILE__)
10
+ argument :language, type: :string, required: false, default: 'en', desc: 'The locale alpha code'
10
11
 
11
- def create_api_file
12
- assert_valid_language!
13
- path = File.join("config/locales/#{language}/apis", namespace_path, "#{file_name}.yml")
12
+ def create_api_file
13
+ assert_valid_language!
14
+ path = File.join("config/locales/#{language}/apis", namespace_path, "#{file_name}.yml")
14
15
 
15
- template('api.yml', path)
16
- end
16
+ template('api.yml', path)
17
+ end
17
18
 
19
+ end
18
20
  end
@@ -1,18 +1,19 @@
1
1
  require 'active_generator/base'
2
2
  require 'generators/locale/base'
3
3
 
4
- class Locale::ControllerGenerator < Rails::Generators::NamedBase
5
- include ActiveGenerator::Base
6
- include Locale::Base
4
+ module Locale
5
+ class ControllerGenerator < Rails::Generators::NamedBase
6
+ include ActiveGenerator::Base
7
+ include Locale::Base
7
8
 
8
- source_root File.expand_path('../templates', __FILE__)
9
- argument :language, type: :string, required: false, default: 'en', desc: 'The locale alpha code'
9
+ source_root File.expand_path('../templates', __FILE__)
10
+ argument :language, type: :string, required: false, default: 'en', desc: 'The locale alpha code'
10
11
 
11
- def create_controller_file
12
- assert_valid_language!
13
- path = File.join("config/locales/#{language}/controllers", namespace_path, "#{file_name}.yml")
12
+ def create_controller_file
13
+ assert_valid_language!
14
+ path = File.join("config/locales/#{language}/controllers", namespace_path, "#{file_name}.yml")
14
15
 
15
- template('controller.yml', path)
16
+ template('controller.yml', path)
17
+ end
16
18
  end
17
-
18
19
  end
@@ -1,18 +1,20 @@
1
1
  require 'active_generator/base'
2
2
  require 'generators/locale/base'
3
3
 
4
- class Locale::HelperGenerator < Rails::Generators::NamedBase
5
- include ActiveGenerator::Base
6
- include Locale::Base
4
+ module Locale
5
+ class HelperGenerator < Rails::Generators::NamedBase
6
+ include ActiveGenerator::Base
7
+ include Locale::Base
7
8
 
8
- source_root File.expand_path('../templates', __FILE__)
9
- argument :language, type: :string, required: false, default: 'en', desc: 'The locale alpha code'
9
+ source_root File.expand_path('../templates', __FILE__)
10
+ argument :language, type: :string, required: false, default: 'en', desc: 'The locale alpha code'
10
11
 
11
- def create_helper_file
12
- assert_valid_language!
13
- path = File.join("config/locales/#{language}/helpers", namespace_path, "#{file_name}.yml")
12
+ def create_helper_file
13
+ assert_valid_language!
14
+ path = File.join("config/locales/#{language}/helpers", namespace_path, "#{file_name}.yml")
14
15
 
15
- template('helper.yml', path)
16
- end
16
+ template('helper.yml', path)
17
+ end
17
18
 
19
+ end
18
20
  end
@@ -1,18 +1,20 @@
1
1
  require 'active_generator/base'
2
2
  require 'generators/locale/base'
3
3
 
4
- class Locale::JobGenerator < Rails::Generators::NamedBase
5
- include ActiveGenerator::Base
6
- include Locale::Base
4
+ module Locale
5
+ class JobGenerator < Rails::Generators::NamedBase
6
+ include ActiveGenerator::Base
7
+ include Locale::Base
7
8
 
8
- source_root File.expand_path('../templates', __FILE__)
9
- argument :language, type: :string, required: false, default: 'en', desc: 'The locale alpha code'
9
+ source_root File.expand_path('../templates', __FILE__)
10
+ argument :language, type: :string, required: false, default: 'en', desc: 'The locale alpha code'
10
11
 
11
- def create_job_file
12
- assert_valid_language!
13
- path = File.join("config/locales/#{language}/jobs", namespace_path, "#{file_name}.yml")
12
+ def create_job_file
13
+ assert_valid_language!
14
+ path = File.join("config/locales/#{language}/jobs", namespace_path, "#{file_name}.yml")
14
15
 
15
- template('job.yml', path)
16
- end
16
+ template('job.yml', path)
17
+ end
17
18
 
19
+ end
18
20
  end
@@ -1,18 +1,20 @@
1
1
  require 'active_generator/base'
2
2
  require 'generators/locale/base'
3
3
 
4
- class Locale::MailerGenerator < Rails::Generators::NamedBase
5
- include ActiveGenerator::Base
6
- include Locale::Base
4
+ module Locale
5
+ class MailerGenerator < Rails::Generators::NamedBase
6
+ include ActiveGenerator::Base
7
+ include Locale::Base
7
8
 
8
- source_root File.expand_path('../templates', __FILE__)
9
- argument :language, type: :string, required: false, default: 'en', desc: 'The locale alpha code'
9
+ source_root File.expand_path('../templates', __FILE__)
10
+ argument :language, type: :string, required: false, default: 'en', desc: 'The locale alpha code'
10
11
 
11
- def create_mailer_file
12
- assert_valid_language!
13
- path = File.join("config/locales/#{language}/mailers", namespace_path, "#{file_name}.yml")
12
+ def create_mailer_file
13
+ assert_valid_language!
14
+ path = File.join("config/locales/#{language}/mailers", namespace_path, "#{file_name}.yml")
14
15
 
15
- template('mailer.yml', path)
16
- end
16
+ template('mailer.yml', path)
17
+ end
17
18
 
19
+ end
18
20
  end
@@ -1,18 +1,20 @@
1
1
  require 'active_generator/base'
2
2
  require 'generators/locale/base'
3
3
 
4
- class Locale::ModelGenerator < Rails::Generators::NamedBase
5
- include ActiveGenerator::Base
6
- include Locale::Base
4
+ module Locale
5
+ class ModelGenerator < Rails::Generators::NamedBase
6
+ include ActiveGenerator::Base
7
+ include Locale::Base
7
8
 
8
- source_root File.expand_path('../templates', __FILE__)
9
- argument :language, type: :string, required: false, default: 'en', desc: 'The locale alpha code'
9
+ source_root File.expand_path('../templates', __FILE__)
10
+ argument :language, type: :string, required: false, default: 'en', desc: 'The locale alpha code'
10
11
 
11
- def create_model_file
12
- assert_valid_language!
13
- path = File.join("config/locales/#{language}/models", namespace_path, "#{file_name}.yml")
12
+ def create_model_file
13
+ assert_valid_language!
14
+ path = File.join("config/locales/#{language}/models", namespace_path, "#{file_name}.yml")
14
15
 
15
- template('model.yml', path)
16
- end
16
+ template('model.yml', path)
17
+ end
17
18
 
19
+ end
18
20
  end
@@ -1,18 +1,20 @@
1
1
  require 'active_generator/base'
2
2
  require 'generators/locale/base'
3
3
 
4
- class Locale::ServiceGenerator < Rails::Generators::NamedBase
5
- include ActiveGenerator::Base
6
- include Locale::Base
4
+ module Locale
5
+ class ServiceGenerator < Rails::Generators::NamedBase
6
+ include ActiveGenerator::Base
7
+ include Locale::Base
7
8
 
8
- source_root File.expand_path('../templates', __FILE__)
9
- argument :language, type: :string, required: false, default: 'en', desc: 'The locale alpha code'
9
+ source_root File.expand_path('../templates', __FILE__)
10
+ argument :language, type: :string, required: false, default: 'en', desc: 'The locale alpha code'
10
11
 
11
- def create_service_file
12
- assert_valid_language!
13
- path = File.join("config/locales/#{language}/services", namespace_path, "#{file_name}.yml")
12
+ def create_service_file
13
+ assert_valid_language!
14
+ path = File.join("config/locales/#{language}/services", namespace_path, "#{file_name}.yml")
14
15
 
15
- template('service.yml', path)
16
- end
16
+ template('service.yml', path)
17
+ end
17
18
 
19
+ end
18
20
  end
@@ -1,18 +1,20 @@
1
1
  require 'active_generator/base'
2
2
  require 'generators/locale/base'
3
3
 
4
- class Locale::TaskGenerator < Rails::Generators::NamedBase
5
- include ActiveGenerator::Base
6
- include Locale::Base
4
+ module Locale
5
+ class TaskGenerator < Rails::Generators::NamedBase
6
+ include ActiveGenerator::Base
7
+ include Locale::Base
7
8
 
8
- source_root File.expand_path('../templates', __FILE__)
9
- argument :language, type: :string, required: false, default: 'en', desc: 'The locale alpha code'
9
+ source_root File.expand_path('../templates', __FILE__)
10
+ argument :language, type: :string, required: false, default: 'en', desc: 'The locale alpha code'
10
11
 
11
- def copy_task_file
12
- assert_valid_language!
13
- path = File.join("config/locales/#{language}/tasks", namespace_path, "#{file_name}.yml")
12
+ def copy_task_file
13
+ assert_valid_language!
14
+ path = File.join("config/locales/#{language}/tasks", namespace_path, "#{file_name}.yml")
14
15
 
15
- template('task.yml', path)
16
- end
16
+ template('task.yml', path)
17
+ end
17
18
 
19
+ end
18
20
  end
@@ -1,18 +1,20 @@
1
1
  require 'active_generator/base'
2
2
  require 'generators/locale/base'
3
3
 
4
- class Locale::UploaderGenerator < Rails::Generators::NamedBase
5
- include ActiveGenerator::Base
6
- include Locale::Base
4
+ module Locale
5
+ class UploaderGenerator < Rails::Generators::NamedBase
6
+ include ActiveGenerator::Base
7
+ include Locale::Base
7
8
 
8
- source_root File.expand_path('../templates', __FILE__)
9
- argument :language, type: :string, required: false, default: 'en', desc: 'The locale alpha code'
9
+ source_root File.expand_path('../templates', __FILE__)
10
+ argument :language, type: :string, required: false, default: 'en', desc: 'The locale alpha code'
10
11
 
11
- def create_uploader_file
12
- assert_valid_language!
13
- path = File.join("config/locales/#{language}/uploaders", namespace_path, "#{file_name}.yml")
12
+ def create_uploader_file
13
+ assert_valid_language!
14
+ path = File.join("config/locales/#{language}/uploaders", namespace_path, "#{file_name}.yml")
14
15
 
15
- template('uploader.yml', path)
16
- end
16
+ template('uploader.yml', path)
17
+ end
17
18
 
19
+ end
18
20
  end
@@ -1,18 +1,20 @@
1
1
  require 'active_generator/base'
2
2
  require 'generators/locale/base'
3
3
 
4
- class Locale::ViewGenerator < Rails::Generators::NamedBase
5
- include ActiveGenerator::Base
6
- include Locale::Base
4
+ module Locale
5
+ class ViewGenerator < Rails::Generators::NamedBase
6
+ include ActiveGenerator::Base
7
+ include Locale::Base
7
8
 
8
- source_root File.expand_path('../templates', __FILE__)
9
- argument :language, type: :string, required: false, default: 'en', desc: 'The locale alpha code'
9
+ source_root File.expand_path('../templates', __FILE__)
10
+ argument :language, type: :string, required: false, default: 'en', desc: 'The locale alpha code'
10
11
 
11
- def create_view_file
12
- assert_valid_language!
13
- path = File.join("config/locales/#{language}/views", namespace_path, "#{file_name}.yml")
12
+ def create_view_file
13
+ assert_valid_language!
14
+ path = File.join("config/locales/#{language}/views", namespace_path, "#{file_name}.yml")
14
15
 
15
- template('view.yml', path)
16
- end
16
+ template('view.yml', path)
17
+ end
17
18
 
19
+ end
18
20
  end
@@ -1,9 +1,11 @@
1
- module Rails::Base
1
+ module Rails
2
+ module Base
2
3
 
3
- private
4
+ private
4
5
 
5
- def configuration
6
- ActiveGenerator::Settings.config
7
- end
6
+ def configuration
7
+ ActiveGenerator::Settings.config
8
+ end
8
9
 
10
+ end
9
11
  end
@@ -2,34 +2,42 @@ require 'rails/generators/erb/controller/controller_generator'
2
2
  require 'rails/generators/rails/controller/controller_generator'
3
3
  require 'generators/rails/base'
4
4
 
5
- class Erb::Generators::ControllerGenerator
6
- include Rails::Base
5
+ module Erb
6
+ module Generators
7
+ class ControllerGenerator
8
+ include Rails::Base
7
9
 
8
- def generate_locale_file
9
- invoke('locale:view', [name]) if configuration.autoload_view_generator_locale
10
- end
10
+ def generate_locale_file
11
+ invoke('locale:view', [name]) if configuration.autoload_view_generator_locale
12
+ end
11
13
 
12
- def generate_test_file
13
- framework = configuration.test_framework
14
+ def generate_test_file
15
+ framework = configuration.test_framework
14
16
 
15
- return if framework.nil?
16
- invoke("#{framework}:view", [name]) rescue nil
17
- end
17
+ return if framework.nil?
18
+ invoke("#{framework}:view", [name]) rescue nil
19
+ end
18
20
 
21
+ end
22
+ end
19
23
  end
20
24
 
21
- class Rails::Generators::ControllerGenerator
22
- include Rails::Base
25
+ module Rails
26
+ module Generators
27
+ class ControllerGenerator
28
+ include Rails::Base
23
29
 
24
- def generate_locale_file
25
- invoke('locale:controller', [name]) if configuration.autoload_controller_generator_locale
26
- end
30
+ def generate_locale_file
31
+ invoke('locale:controller', [name]) if configuration.autoload_controller_generator_locale
32
+ end
27
33
 
28
- def generate_test_file
29
- framework = configuration.test_framework
34
+ def generate_test_file
35
+ framework = configuration.test_framework
30
36
 
31
- return if framework.nil?
32
- invoke("#{framework}:controller", [name]) rescue nil
33
- end
37
+ return if framework.nil?
38
+ invoke("#{framework}:controller", [name]) rescue nil
39
+ end
34
40
 
41
+ end
42
+ end
35
43
  end
@@ -1,18 +1,22 @@
1
1
  require 'rails/generators/rails/helper/helper_generator'
2
2
  require 'generators/rails/base'
3
3
 
4
- class Rails::Generators::HelperGenerator
5
- include Rails::Base
4
+ module Rails
5
+ module Generators
6
+ class HelperGenerator
7
+ include Rails::Base
6
8
 
7
- def generate_locale_file
8
- invoke('locale:helper', [name]) if configuration.autoload_helper_generator_locale
9
- end
9
+ def generate_locale_file
10
+ invoke('locale:helper', [name]) if configuration.autoload_helper_generator_locale
11
+ end
10
12
 
11
- def generate_test_file
12
- framework = configuration.test_framework
13
+ def generate_test_file
14
+ framework = configuration.test_framework
13
15
 
14
- return if framework.nil?
15
- invoke("#{framework}:helper", [name]) rescue nil
16
- end
16
+ return if framework.nil?
17
+ invoke("#{framework}:helper", [name]) rescue nil
18
+ end
17
19
 
20
+ end
21
+ end
18
22
  end
@@ -1,18 +1,21 @@
1
1
  require 'rails/generators/job/job_generator'
2
2
  require 'generators/rails/base'
3
3
 
4
- class Rails::Generators::JobGenerator
5
- include Rails::Base
4
+ module Rails
5
+ module Generators
6
+ class JobGenerator
7
+ include Rails::Base
6
8
 
7
- def generate_locale_file
8
- invoke('locale:job', [name]) if configuration.autoload_job_generator_locale
9
- end
9
+ def generate_locale_file
10
+ invoke('locale:job', [name]) if configuration.autoload_job_generator_locale
11
+ end
10
12
 
11
- def generate_test_file
12
- framework = configuration.test_framework
13
+ def generate_test_file
14
+ framework = configuration.test_framework
13
15
 
14
- return if framework.nil?
15
- invoke("#{framework}:job", [name]) rescue nil
16
+ return if framework.nil?
17
+ invoke("#{framework}:job", [name]) rescue nil
18
+ end
19
+ end
16
20
  end
17
-
18
21
  end
@@ -2,34 +2,42 @@ require 'rails/generators/erb/mailer/mailer_generator'
2
2
  require 'rails/generators/mailer/mailer_generator'
3
3
  require 'generators/rails/base'
4
4
 
5
- class Erb::Generators::MailerGenerator
6
- include Rails::Base
5
+ module Erb
6
+ module Generators
7
+ class MailerGenerator
8
+ include Rails::Base
7
9
 
8
- def generate_locale_file
9
- invoke('locale:view', [name]) if configuration.autoload_view_generator_locale
10
- end
10
+ def generate_locale_file
11
+ invoke('locale:view', [name]) if configuration.autoload_view_generator_locale
12
+ end
11
13
 
12
- def generate_test_file
13
- framework = configuration.test_framework
14
+ def generate_test_file
15
+ framework = configuration.test_framework
14
16
 
15
- return if framework.nil?
16
- invoke("#{framework}:view", [name]) rescue nil
17
- end
17
+ return if framework.nil?
18
+ invoke("#{framework}:view", [name]) rescue nil
19
+ end
18
20
 
21
+ end
22
+ end
19
23
  end
20
24
 
21
- class Rails::Generators::MailerGenerator
22
- include Rails::Base
25
+ module Rails
26
+ module Generators
27
+ class MailerGenerator
28
+ include Rails::Base
23
29
 
24
- def generate_locale_file
25
- invoke('locale:mailer', [name]) if configuration.autoload_mailer_generator_locale
26
- end
30
+ def generate_locale_file
31
+ invoke('locale:mailer', [name]) if configuration.autoload_mailer_generator_locale
32
+ end
27
33
 
28
- def generate_test_file
29
- framework = configuration.test_framework
34
+ def generate_test_file
35
+ framework = configuration.test_framework
30
36
 
31
- return if framework.nil?
32
- invoke("#{framework}:mailer", [name]) rescue nil
33
- end
37
+ return if framework.nil?
38
+ invoke("#{framework}:mailer", [name]) rescue nil
39
+ end
34
40
 
41
+ end
42
+ end
35
43
  end
@@ -1,32 +1,36 @@
1
1
  require 'rails/generators/active_record/model/model_generator'
2
2
  require 'generators/rails/base'
3
3
 
4
- class ActiveRecord::Generators::ModelGenerator
5
- include Rails::Base
4
+ module ActiveRecord
5
+ module Generators
6
+ class ModelGenerator
7
+ include Rails::Base
6
8
 
7
- def create_migration_file
8
- # return unless options[:migration] && options[:parent].nil?
9
+ def create_migration_file
10
+ # return unless options[:migration] && options[:parent].nil?
9
11
 
10
- if options[:indexes] == false
11
- attributes.each do |attr|
12
- attr.attr_options.delete(:index) if attr.reference? && !attr.has_index?
13
- end
14
- end
12
+ if options[:indexes] == false
13
+ attributes.each do |attr|
14
+ attr.attr_options.delete(:index) if attr.reference? && !attr.has_index?
15
+ end
16
+ end
15
17
 
16
- path = "db/migrate/create_#{table_name}.rb"
18
+ path = "db/migrate/create_#{table_name}.rb"
17
19
 
18
- migration_template('../../migration/templates/create_table_migration.rb', path)
19
- end
20
+ migration_template('../../migration/templates/create_table_migration.rb', path)
21
+ end
20
22
 
21
- def generate_locale_file
22
- invoke('locale:model', [name]) if configuration.autoload_model_generator_locale
23
- end
23
+ def generate_locale_file
24
+ invoke('locale:model', [name]) if configuration.autoload_model_generator_locale
25
+ end
24
26
 
25
- def generate_test_file
26
- framework = configuration.test_framework
27
+ def generate_test_file
28
+ framework = configuration.test_framework
27
29
 
28
- return if framework.nil?
29
- invoke("#{framework}:model", [name]) rescue nil
30
- end
30
+ return if framework.nil?
31
+ invoke("#{framework}:model", [name]) rescue nil
32
+ end
31
33
 
34
+ end
35
+ end
32
36
  end
@@ -1,18 +1,22 @@
1
1
  require 'rails/generators/erb/scaffold/scaffold_generator'
2
2
  require 'generators/rails/base'
3
3
 
4
- class Erb::Generators::ScaffoldGenerator
5
- include Rails::Base
4
+ module Erb
5
+ module Generators
6
+ class ScaffoldGenerator
7
+ include Rails::Base
6
8
 
7
- def generate_locale_file
8
- invoke('locale:view', [name]) if configuration.autoload_view_generator_locale
9
- end
9
+ def generate_locale_file
10
+ invoke('locale:view', [name]) if configuration.autoload_view_generator_locale
11
+ end
10
12
 
11
- def generate_test_file
12
- framework = configuration.test_framework
13
+ def generate_test_file
14
+ framework = configuration.test_framework
13
15
 
14
- return if framework.nil?
15
- invoke("#{framework}:view", [name]) rescue nil
16
- end
16
+ return if framework.nil?
17
+ invoke("#{framework}:view", [name]) rescue nil
18
+ end
17
19
 
20
+ end
21
+ end
18
22
  end
@@ -1,10 +1,14 @@
1
1
  require 'rails/generators/rails/task/task_generator'
2
2
 
3
- class Rails::Generators::TaskGenerator
3
+ module Rails
4
+ module Generators
5
+ class TaskGenerator
4
6
 
5
- def generate_locale_file
6
- return unless ActiveGenerator::Settings.config.autoload_task_generator_locale
7
- invoke('locale:task', [name])
8
- end
7
+ def generate_locale_file
8
+ return unless ActiveGenerator::Settings.config.autoload_task_generator_locale
9
+ invoke('locale:task', [name])
10
+ end
9
11
 
12
+ end
13
+ end
10
14
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.1
4
+ version: 4.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-09-06 00:00:00.000000000 Z
11
+ date: 2016-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails