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 +4 -4
- data/lib/active_generator/base.rb +6 -6
- data/lib/active_generator/version.rb +1 -1
- data/lib/generators/active_generator/install/install_generator.rb +1 -1
- data/lib/generators/environment/environment_generator.rb +3 -3
- data/lib/generators/initializer/initializer_generator.rb +1 -1
- data/lib/generators/locale/api/api_generator.rb +4 -4
- data/lib/generators/locale/controller/controller_generator.rb +4 -4
- data/lib/generators/locale/helper/helper_generator.rb +4 -4
- data/lib/generators/locale/job/job_generator.rb +4 -4
- data/lib/generators/locale/mailer/mailer_generator.rb +4 -4
- data/lib/generators/locale/model/model_generator.rb +4 -4
- data/lib/generators/locale/service/service_generator.rb +4 -4
- data/lib/generators/locale/task/task_generator.rb +4 -4
- data/lib/generators/locale/uploader/uploader_generator.rb +4 -4
- data/lib/generators/locale/view/view_generator.rb +4 -4
- data/lib/generators/rails/controller_generator.rb +2 -2
- data/lib/generators/rails/helper_generator.rb +1 -1
- data/lib/generators/rails/job_generator.rb +1 -1
- data/lib/generators/rails/mailer_generator.rb +2 -2
- data/lib/generators/rails/model_generator.rb +1 -1
- data/lib/generators/rails/scaffold_generator.rb +1 -1
- data/lib/generators/rails/task_generator.rb +1 -1
- data/lib/generators/service/service_generator.rb +2 -2
- data/lib/generators/view/view_generator.rb +5 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d579a5d35dcf5dd24dbfad0ed44e189cc7466ef7
|
4
|
+
data.tar.gz: 5ebe26e8b1af343354f623b63153f5979d31a5b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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(
|
11
|
+
file_name_table.gsub('_'.freeze, ' '.freeze).downcase.capitalize
|
12
12
|
end
|
13
13
|
|
14
14
|
def namespace
|
15
|
-
name.downcase.split(
|
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(
|
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
|
@@ -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(
|
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:
|
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(
|
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
|
-
|
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(
|
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
|
2
|
-
require
|
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:
|
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(
|
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
|
2
|
-
require
|
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:
|
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(
|
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
|
2
|
-
require
|
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:
|
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(
|
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
|
2
|
-
require
|
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:
|
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(
|
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
|
2
|
-
require
|
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:
|
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(
|
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
|
2
|
-
require
|
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:
|
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(
|
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
|
2
|
-
require
|
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:
|
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(
|
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
|
2
|
-
require
|
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:
|
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(
|
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
|
2
|
-
require
|
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:
|
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(
|
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
|
2
|
-
require
|
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:
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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
|
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:
|
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(
|
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(
|
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(
|
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.
|
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-
|
11
|
+
date: 2015-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|