active_generator 2.2.8 → 2.3.0

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: db4192191bf48905c99dbac7b4c0ba8c6a80a2e9
4
- data.tar.gz: 3484702f43f23a1c7ef33f0b59facaffff01b6df
3
+ metadata.gz: d579a5d35dcf5dd24dbfad0ed44e189cc7466ef7
4
+ data.tar.gz: 5ebe26e8b1af343354f623b63153f5979d31a5b5
5
5
  SHA512:
6
- metadata.gz: fb4885cb8f096c11f15197ef0a1a4ac9f918896384aab6b3c90d99e8460ea49f7b8894cf14c00180e0d401efc27ba115c0d38b65c9303a3b310cd333059adb98
7
- data.tar.gz: 0aca2980152f2055ca83bf8ab63ceb2709754af90018e5ef6a394accc841e6f0c878bfc82580b660630af108ee21528b158c455beadf07953ea3550a9bcd5411
6
+ metadata.gz: a41dc183dc222d220fb1b87233ebee6fe5cb9eedc06c00edbc35271a08bd795e94ab295ad5aa03179f92ae6ecac89244bff66182b4b259112de2dbd200ff8883
7
+ data.tar.gz: f8913f9eee939a59f782797171d5068533fc147985a1f2a0b6ab87142da6647a85a8e0e380c55ad2611afe78e4b2969e0a7439a8474ad072e1585d1a0eb40261
@@ -8,27 +8,27 @@ module ActiveGenerator
8
8
  end
9
9
 
10
10
  def file_name_human
11
- file_name_table.gsub("_", " ").downcase.capitalize
11
+ file_name_table.gsub('_'.freeze, ' '.freeze).downcase.capitalize
12
12
  end
13
13
 
14
14
  def namespace
15
- name.downcase.split("/").delete_last
15
+ name.downcase.split('/'.freeze).delete_last
16
16
  end
17
17
 
18
18
  def namespaced?
19
- name.include?("/")
19
+ name.include?('/'.freeze)
20
20
  end
21
21
 
22
22
  def namespace_human
23
- namespace.join(" ").gsub("_", " ").downcase.capitalize
23
+ namespace.join(' '.freeze).gsub('_'.freeze, ' '.freeze).downcase.capitalize
24
24
  end
25
25
 
26
26
  def namespace_table
27
- namespace.join("_")
27
+ namespace.join('_'.freeze)
28
28
  end
29
29
 
30
30
  def namespace_path
31
- namespace.join("/")
31
+ namespace.join('/'.freeze)
32
32
  end
33
33
 
34
34
  end
@@ -1,3 +1,3 @@
1
1
  module ActiveGenerator
2
- VERSION = "2.2.8"
2
+ VERSION = "2.3.0"
3
3
  end
@@ -3,7 +3,7 @@ module ActiveGenerator
3
3
  source_root File.expand_path('../templates', __FILE__)
4
4
 
5
5
  def copy_initializer_file
6
- copy_file("install.rb", "config/initializers/active_generator.rb")
6
+ copy_file('install.rb'.freeze, 'config/initializers/active_generator.rb'.freeze)
7
7
  end
8
8
 
9
9
  end
@@ -1,10 +1,10 @@
1
1
  class EnvironmentGenerator < Rails::Generators::NamedBase
2
2
  source_root File.expand_path('../templates', __FILE__)
3
- argument :environment, type: :string, required: false, default: nil, desc: "The environment template to copy"
3
+ argument :environment, type: :string, required: false, default: nil, desc: 'The environment template to copy'
4
4
 
5
5
  def create_environment_file
6
6
  assert_valid_environment!
7
- template("environment.rb", File.join("config/environments", class_path, "#{file_name}.rb"))
7
+ template('environment.rb'.freeze, File.join('config/environments'.freeze, class_path, "#{file_name}.rb"))
8
8
  end
9
9
 
10
10
  private
@@ -19,7 +19,7 @@ class EnvironmentGenerator < Rails::Generators::NamedBase
19
19
  unless environment.nil?
20
20
  unless ENVIRONMENTS.include?(environment)
21
21
  raise ArgumentError,
22
- "Unknown environment: #{environment.inspect}. Valid environments are: #{ENVIRONMENTS.map(&:inspect).join(', ')}"
22
+ "Unknown environment: #{environment.inspect}. Valid environments are: #{ENVIRONMENTS.map(&:inspect).join(', '.freeze)}"
23
23
  end
24
24
  end
25
25
  end
@@ -2,7 +2,7 @@ class InitializerGenerator < Rails::Generators::NamedBase
2
2
  source_root File.expand_path('../templates', __FILE__)
3
3
 
4
4
  def copy_initializer_file
5
- copy_file("initializer.rb", File.join("config/initializers", class_path, "#{file_name}.rb"))
5
+ copy_file('initializer.rb'.freeze, File.join('config/initializers'.freeze, class_path, "#{file_name}.rb"))
6
6
  end
7
7
 
8
8
  end
@@ -1,5 +1,5 @@
1
- require "active_generator/base"
2
- require "generators/locale/base"
1
+ require 'active_generator/base'
2
+ require 'generators/locale/base'
3
3
 
4
4
  module Locale
5
5
  class ApiGenerator < Rails::Generators::NamedBase
@@ -7,11 +7,11 @@ module Locale
7
7
  include Locale::Base
8
8
 
9
9
  source_root File.expand_path('../templates', __FILE__)
10
- argument :language, type: :string, required: false, default: "en", desc: "The locale alpha code"
10
+ argument :language, type: :string, required: false, default: 'en', desc: 'The locale alpha code'
11
11
 
12
12
  def create_api_file
13
13
  assert_valid_language!
14
- template("api.yml", File.join("config/locales/#{language}/apis", namespace_path, "#{file_name}.yml"))
14
+ template('api.yml'.freeze, File.join("config/locales/#{language}/apis", namespace_path, "#{file_name}.yml"))
15
15
  end
16
16
 
17
17
  end
@@ -1,5 +1,5 @@
1
- require "active_generator/base"
2
- require "generators/locale/base"
1
+ require 'active_generator/base'
2
+ require 'generators/locale/base'
3
3
 
4
4
  module Locale
5
5
  class ControllerGenerator < Rails::Generators::NamedBase
@@ -7,11 +7,11 @@ module Locale
7
7
  include Locale::Base
8
8
 
9
9
  source_root File.expand_path('../templates', __FILE__)
10
- argument :language, type: :string, required: false, default: "en", desc: "The locale alpha code"
10
+ argument :language, type: :string, required: false, default: 'en', desc: 'The locale alpha code'
11
11
 
12
12
  def create_controller_file
13
13
  assert_valid_language!
14
- template("controller.yml", File.join("config/locales/#{language}/controllers", namespace_path, "#{file_name}.yml"))
14
+ template('controller.yml'.freeze, File.join("config/locales/#{language}/controllers", namespace_path, "#{file_name}.yml"))
15
15
  end
16
16
 
17
17
  end
@@ -1,5 +1,5 @@
1
- require "active_generator/base"
2
- require "generators/locale/base"
1
+ require 'active_generator/base'
2
+ require 'generators/locale/base'
3
3
 
4
4
  module Locale
5
5
  class HelperGenerator < Rails::Generators::NamedBase
@@ -7,11 +7,11 @@ module Locale
7
7
  include Locale::Base
8
8
 
9
9
  source_root File.expand_path('../templates', __FILE__)
10
- argument :language, type: :string, required: false, default: "en", desc: "The locale alpha code"
10
+ argument :language, type: :string, required: false, default: 'en', desc: 'The locale alpha code'
11
11
 
12
12
  def create_helper_file
13
13
  assert_valid_language!
14
- template("helper.yml", File.join("config/locales/#{language}/helpers", namespace_path, "#{file_name}.yml"))
14
+ template('helper.yml'.freeze, File.join("config/locales/#{language}/helpers", namespace_path, "#{file_name}.yml"))
15
15
  end
16
16
 
17
17
  end
@@ -1,5 +1,5 @@
1
- require "active_generator/base"
2
- require "generators/locale/base"
1
+ require 'active_generator/base'
2
+ require 'generators/locale/base'
3
3
 
4
4
  module Locale
5
5
  class JobGenerator < Rails::Generators::NamedBase
@@ -7,11 +7,11 @@ module Locale
7
7
  include Locale::Base
8
8
 
9
9
  source_root File.expand_path('../templates', __FILE__)
10
- argument :language, type: :string, required: false, default: "en", desc: "The locale alpha code"
10
+ argument :language, type: :string, required: false, default: 'en', desc: 'The locale alpha code'
11
11
 
12
12
  def create_job_file
13
13
  assert_valid_language!
14
- template("job.yml", File.join("config/locales/#{language}/jobs", namespace_path, "#{file_name}.yml"))
14
+ template('job.yml'.freeze, File.join("config/locales/#{language}/jobs", namespace_path, "#{file_name}.yml"))
15
15
  end
16
16
 
17
17
  end
@@ -1,5 +1,5 @@
1
- require "active_generator/base"
2
- require "generators/locale/base"
1
+ require 'active_generator/base'
2
+ require 'generators/locale/base'
3
3
 
4
4
  module Locale
5
5
  class MailerGenerator < Rails::Generators::NamedBase
@@ -7,11 +7,11 @@ module Locale
7
7
  include Locale::Base
8
8
 
9
9
  source_root File.expand_path('../templates', __FILE__)
10
- argument :language, type: :string, required: false, default: "en", desc: "The locale alpha code"
10
+ argument :language, type: :string, required: false, default: 'en', desc: 'The locale alpha code'
11
11
 
12
12
  def create_mailer_file
13
13
  assert_valid_language!
14
- template("mailer.yml", File.join("config/locales/#{language}/mailers", namespace_path, "#{file_name}.yml"))
14
+ template('mailer.yml'.freeze, File.join("config/locales/#{language}/mailers", namespace_path, "#{file_name}.yml"))
15
15
  end
16
16
 
17
17
  end
@@ -1,5 +1,5 @@
1
- require "active_generator/base"
2
- require "generators/locale/base"
1
+ require 'active_generator/base'
2
+ require 'generators/locale/base'
3
3
 
4
4
  module Locale
5
5
  class ModelGenerator < Rails::Generators::NamedBase
@@ -7,11 +7,11 @@ module Locale
7
7
  include Locale::Base
8
8
 
9
9
  source_root File.expand_path('../templates', __FILE__)
10
- argument :language, type: :string, required: false, default: "en", desc: "The locale alpha code"
10
+ argument :language, type: :string, required: false, default: 'en', desc: 'The locale alpha code'
11
11
 
12
12
  def create_model_file
13
13
  assert_valid_language!
14
- template("model.yml", File.join("config/locales/#{language}/models", namespace_path, "#{file_name}.yml"))
14
+ template('model.yml'.freeze, File.join("config/locales/#{language}/models", namespace_path, "#{file_name}.yml"))
15
15
  end
16
16
 
17
17
  end
@@ -1,5 +1,5 @@
1
- require "active_generator/base"
2
- require "generators/locale/base"
1
+ require 'active_generator/base'
2
+ require 'generators/locale/base'
3
3
 
4
4
  module Locale
5
5
  class ServiceGenerator < Rails::Generators::NamedBase
@@ -7,11 +7,11 @@ module Locale
7
7
  include Locale::Base
8
8
 
9
9
  source_root File.expand_path('../templates', __FILE__)
10
- argument :language, type: :string, required: false, default: "en", desc: "The locale alpha code"
10
+ argument :language, type: :string, required: false, default: 'en', desc: 'The locale alpha code'
11
11
 
12
12
  def create_service_file
13
13
  assert_valid_language!
14
- template("service.yml", File.join("config/locales/#{language}/services", namespace_path, "#{file_name}.yml"))
14
+ template('service.yml'.freeze, File.join("config/locales/#{language}/services", namespace_path, "#{file_name}.yml"))
15
15
  end
16
16
 
17
17
  end
@@ -1,5 +1,5 @@
1
- require "active_generator/base"
2
- require "generators/locale/base"
1
+ require 'active_generator/base'
2
+ require 'generators/locale/base'
3
3
 
4
4
  module Locale
5
5
  class TaskGenerator < Rails::Generators::NamedBase
@@ -7,11 +7,11 @@ module Locale
7
7
  include Locale::Base
8
8
 
9
9
  source_root File.expand_path('../templates', __FILE__)
10
- argument :language, type: :string, required: false, default: "en", desc: "The locale alpha code"
10
+ argument :language, type: :string, required: false, default: 'en', desc: 'The locale alpha code'
11
11
 
12
12
  def copy_task_file
13
13
  assert_valid_language!
14
- template("task.yml", File.join("config/locales/#{language}/tasks", namespace_path, "#{file_name}.yml"))
14
+ template('task.yml'.freeze, File.join("config/locales/#{language}/tasks", namespace_path, "#{file_name}.yml"))
15
15
  end
16
16
 
17
17
  end
@@ -1,5 +1,5 @@
1
- require "active_generator/base"
2
- require "generators/locale/base"
1
+ require 'active_generator/base'
2
+ require 'generators/locale/base'
3
3
 
4
4
  module Locale
5
5
  class UploaderGenerator < Rails::Generators::NamedBase
@@ -7,11 +7,11 @@ module Locale
7
7
  include Locale::Base
8
8
 
9
9
  source_root File.expand_path('../templates', __FILE__)
10
- argument :language, type: :string, required: false, default: "en", desc: "The locale alpha code"
10
+ argument :language, type: :string, required: false, default: 'en', desc: 'The locale alpha code'
11
11
 
12
12
  def create_uploader_file
13
13
  assert_valid_language!
14
- template("uploader.yml", File.join("config/locales/#{language}/uploaders", namespace_path, "#{file_name}.yml"))
14
+ template('uploader.yml'.freeze, File.join("config/locales/#{language}/uploaders", namespace_path, "#{file_name}.yml"))
15
15
  end
16
16
 
17
17
  end
@@ -1,5 +1,5 @@
1
- require "active_generator/base"
2
- require "generators/locale/base"
1
+ require 'active_generator/base'
2
+ require 'generators/locale/base'
3
3
 
4
4
  module Locale
5
5
  class ViewGenerator < Rails::Generators::NamedBase
@@ -7,11 +7,11 @@ module Locale
7
7
  include Locale::Base
8
8
 
9
9
  source_root File.expand_path('../templates', __FILE__)
10
- argument :language, type: :string, required: false, default: "en", desc: "The locale alpha code"
10
+ argument :language, type: :string, required: false, default: 'en', desc: 'The locale alpha code'
11
11
 
12
12
  def create_view_file
13
13
  assert_valid_language!
14
- template("view.yml", File.join("config/locales/#{language}/views", namespace_path, "#{file_name}.yml"))
14
+ template('view.yml'.freeze, File.join("config/locales/#{language}/views", namespace_path, "#{file_name}.yml"))
15
15
  end
16
16
 
17
17
  end
@@ -6,7 +6,7 @@ module Erb
6
6
  class ControllerGenerator
7
7
 
8
8
  def generate_locale_file
9
- invoke("locale:view", [name]) if ActiveGenerator.configuration.autoload_view_generator_locale
9
+ invoke('locale:view'.freeze, [name]) if ActiveGenerator.configuration.autoload_view_generator_locale
10
10
  end
11
11
 
12
12
  def generate_test_file
@@ -24,7 +24,7 @@ module Rails
24
24
  class ControllerGenerator
25
25
 
26
26
  def generate_locale_file
27
- invoke("locale:controller", [name]) if ActiveGenerator.configuration.autoload_controller_generator_locale
27
+ invoke('locale:controller'.freeze, [name]) if ActiveGenerator.configuration.autoload_controller_generator_locale
28
28
  end
29
29
 
30
30
  def generate_test_file
@@ -5,7 +5,7 @@ module Rails
5
5
  class HelperGenerator
6
6
 
7
7
  def generate_locale_file
8
- invoke("locale:helper", [name]) if ActiveGenerator.configuration.autoload_helper_generator_locale
8
+ invoke('locale:helper'.freeze, [name]) if ActiveGenerator.configuration.autoload_helper_generator_locale
9
9
  end
10
10
 
11
11
  def generate_test_file
@@ -5,7 +5,7 @@ module Rails
5
5
  class JobGenerator
6
6
 
7
7
  def generate_locale_file
8
- invoke("locale:job", [name]) if ActiveGenerator.configuration.autoload_job_generator_locale
8
+ invoke('locale:job'.freeze, [name]) if ActiveGenerator.configuration.autoload_job_generator_locale
9
9
  end
10
10
 
11
11
  def generate_test_file
@@ -6,7 +6,7 @@ module Erb
6
6
  class MailerGenerator
7
7
 
8
8
  def generate_locale_file
9
- invoke("locale:view", [name]) if ActiveGenerator.configuration.autoload_view_generator_locale
9
+ invoke('locale:view'.freeze, [name]) if ActiveGenerator.configuration.autoload_view_generator_locale
10
10
  end
11
11
 
12
12
  def generate_test_file
@@ -24,7 +24,7 @@ module Rails
24
24
  class MailerGenerator
25
25
 
26
26
  def generate_locale_file
27
- invoke("locale:mailer", [name]) if ActiveGenerator.configuration.autoload_mailer_generator_locale
27
+ invoke('locale:mailer'.freeze, [name]) if ActiveGenerator.configuration.autoload_mailer_generator_locale
28
28
  end
29
29
 
30
30
  def generate_test_file
@@ -11,7 +11,7 @@ module ActiveRecord
11
11
  end
12
12
 
13
13
  def generate_locale_file
14
- invoke("locale:model", [name]) if ActiveGenerator.configuration.autoload_model_generator_locale
14
+ invoke('locale:model'.freeze, [name]) if ActiveGenerator.configuration.autoload_model_generator_locale
15
15
  end
16
16
 
17
17
  def generate_test_file
@@ -5,7 +5,7 @@ module Erb
5
5
  class ScaffoldGenerator
6
6
 
7
7
  def generate_locale_file
8
- invoke("locale:view", [name]) if ActiveGenerator.configuration.autoload_view_generator_locale
8
+ invoke('locale:view'.freeze, [name]) if ActiveGenerator.configuration.autoload_view_generator_locale
9
9
  end
10
10
 
11
11
  def generate_test_file
@@ -5,7 +5,7 @@ module Rails
5
5
  class TaskGenerator
6
6
 
7
7
  def generate_locale_file
8
- invoke("locale:task", [name]) if ActiveGenerator.configuration.autoload_task_generator_locale
8
+ invoke('locale:task'.freeze, [name]) if ActiveGenerator.configuration.autoload_task_generator_locale
9
9
  end
10
10
 
11
11
  end
@@ -2,11 +2,11 @@ class ServiceGenerator < Rails::Generators::NamedBase
2
2
  source_root File.expand_path('../templates', __FILE__)
3
3
 
4
4
  def create_service_file
5
- template("service.rb", File.join("app/services", class_path, "#{file_name}.rb"))
5
+ template('service.rb'.freeze, File.join('app/services'.freeze, class_path, "#{file_name}.rb"))
6
6
  end
7
7
 
8
8
  def generate_locale_file
9
- invoke("locale:service", [name]) if ActiveGenerator.configuration.autoload_service_generator_locale
9
+ invoke('locale:service'.freeze, [name]) if ActiveGenerator.configuration.autoload_service_generator_locale
10
10
  end
11
11
 
12
12
  end
@@ -1,23 +1,23 @@
1
- require "fileutils"
1
+ require 'fileutils'
2
2
 
3
3
  class ViewGenerator < Rails::Generators::NamedBase
4
4
  source_root File.expand_path('../templates', __FILE__)
5
- argument :actions, type: :array, required: false, default: [], desc: "The pages to generate"
5
+ argument :actions, type: :array, required: false, default: [], desc: 'The pages to generate'
6
6
 
7
7
  def create_root_directory
8
- empty_directory(File.join("app/views", file_name)) if actions.empty?
8
+ empty_directory(File.join('app/views'.freeze, file_name)) if actions.empty?
9
9
  end
10
10
 
11
11
  def create_view_file
12
12
  unless actions.empty?
13
13
  actions.each do |filename|
14
- template("view.html.erb", File.join("app/views", class_path, file_name, "#{filename}.html.erb"))
14
+ template('view.html.erb'.freeze, File.join('app/views'.freeze, class_path, file_name, "#{filename}.html.erb"))
15
15
  end
16
16
  end
17
17
  end
18
18
 
19
19
  def generate_locale_file
20
- invoke("locale:view", [name]) if ActiveGenerator.configuration.autoload_view_generator_locale
20
+ invoke('locale:view'.freeze, [name]) if ActiveGenerator.configuration.autoload_view_generator_locale
21
21
  end
22
22
 
23
23
  def generate_test_file
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: 2.2.8
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-09-12 00:00:00.000000000 Z
11
+ date: 2015-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails