active_generator 4.0.6 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.reek +1 -13
- data/.rubocop.yml +2 -22
- data/Gemfile +2 -0
- data/README.md +1 -2
- data/Rakefile +2 -0
- data/active_generator.gemspec +2 -1
- data/bin/console +1 -0
- data/bin/rake +2 -2
- data/lib/active_generator.rb +6 -2
- data/lib/active_generator/base.rb +2 -0
- data/lib/active_generator/configuration.rb +38 -0
- data/lib/active_generator/version.rb +3 -1
- data/lib/generators/active_generator/install/install_generator.rb +2 -0
- data/lib/generators/active_generator/install/templates/install.rb +3 -1
- data/lib/generators/environment/environment_generator.rb +2 -0
- data/lib/generators/environment/templates/environment.rb +2 -0
- data/lib/generators/initializer/initializer_generator.rb +2 -0
- data/lib/generators/initializer/templates/initializer.rb +2 -0
- data/lib/generators/locale/api/api_generator.rb +2 -0
- data/lib/generators/locale/base.rb +2 -0
- data/lib/generators/locale/controller/controller_generator.rb +2 -0
- data/lib/generators/locale/helper/helper_generator.rb +2 -0
- data/lib/generators/locale/job/job_generator.rb +2 -0
- data/lib/generators/locale/mailer/mailer_generator.rb +2 -0
- data/lib/generators/locale/model/model_generator.rb +2 -0
- data/lib/generators/locale/service/service_generator.rb +2 -0
- data/lib/generators/locale/task/task_generator.rb +2 -0
- data/lib/generators/locale/uploader/uploader_generator.rb +2 -0
- data/lib/generators/locale/view/view_generator.rb +2 -0
- data/lib/generators/rails/base.rb +3 -1
- data/lib/generators/rails/controller_generator.rb +2 -0
- data/lib/generators/rails/helper_generator.rb +2 -0
- data/lib/generators/rails/job_generator.rb +2 -0
- data/lib/generators/rails/mailer_generator.rb +2 -0
- data/lib/generators/rails/model_generator.rb +2 -0
- data/lib/generators/rails/scaffold_generator.rb +2 -0
- data/lib/generators/rails/task_generator.rb +3 -1
- data/lib/generators/service/service_generator.rb +3 -1
- data/lib/generators/service/templates/service.rb +2 -0
- data/lib/generators/view/view_generator.rb +3 -1
- metadata +4 -19
- data/.coveralls.yml +0 -1
- data/lib/active_generator/settings.rb +0 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42522c4d97f6b3deb34f6d74fd3c016e6fd4b479
|
4
|
+
data.tar.gz: 81b786cba681cd79eb9dbb33d32508cc1dd0b8b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5a078be27984a9a71bada2d9958c14cf4dc393e84a99e446de484a9102852857cdeaeaddc0863839116a8a226e36f732828d3799a397a5d8c3641bffd75449e
|
7
|
+
data.tar.gz: f6dc9736676f851d3bdf907b1fcb8c60cb8829bd08112989b80cb240b7f1637481f8c91ca78074e44d3489c9b08b78612bc6cd6ac77c662f63dd478ec13c8d34
|
data/.reek
CHANGED
@@ -1,25 +1,13 @@
|
|
1
1
|
---
|
2
2
|
Attribute:
|
3
3
|
enabled: false
|
4
|
-
BooleanParameter:
|
5
|
-
enabled: false
|
6
|
-
ControlParameter:
|
7
|
-
enabled: false
|
8
|
-
FeatureEnvy:
|
9
|
-
enabled: false
|
10
4
|
IrresponsibleModule:
|
11
5
|
enabled: false
|
12
|
-
LongParameterList:
|
13
|
-
enabled: false
|
14
|
-
ManualDispatch:
|
15
|
-
enabled: false
|
16
|
-
NestedIterators:
|
17
|
-
max_allowed_nesting: 2
|
18
6
|
NilCheck:
|
19
7
|
enabled: false
|
20
8
|
PrimaDonnaMethod:
|
21
9
|
enabled: false
|
22
|
-
|
10
|
+
TooManyInstanceVariables:
|
23
11
|
enabled: false
|
24
12
|
TooManyStatements:
|
25
13
|
max_statements: 10
|
data/.rubocop.yml
CHANGED
@@ -5,37 +5,17 @@ AllCops:
|
|
5
5
|
Exclude:
|
6
6
|
- 'lib/**/**/templates/*'
|
7
7
|
- 'spec/**/**/*'
|
8
|
-
Layout/ClosingParenthesisIndentation:
|
9
|
-
Enabled: false
|
10
|
-
Layout/EmptyLinesAroundBlockBody:
|
11
|
-
Enabled: false
|
12
8
|
Layout/EmptyLinesAroundClassBody:
|
13
9
|
Enabled: false
|
14
10
|
Layout/EmptyLinesAroundModuleBody:
|
15
11
|
Enabled: false
|
16
|
-
Layout/FirstParameterIndentation:
|
17
|
-
Enabled: false
|
18
|
-
Layout/MultilineMethodCallIndentation:
|
19
|
-
EnforcedStyle: aligned
|
20
12
|
LineLength:
|
21
13
|
Max: 100
|
22
|
-
Lint/
|
23
|
-
Enabled: false
|
24
|
-
Metrics/ClassLength:
|
14
|
+
Lint/RescueWithoutErrorClass:
|
25
15
|
Enabled: false
|
26
|
-
|
27
|
-
Enabled: false
|
28
|
-
Style/Alias:
|
29
|
-
EnforcedStyle: prefer_alias_method
|
30
|
-
Style/BracesAroundHashParameters:
|
16
|
+
Lint/ScriptPermission:
|
31
17
|
Enabled: false
|
32
18
|
Style/Documentation:
|
33
19
|
Enabled: false
|
34
|
-
Style/HashSyntax:
|
35
|
-
Enabled: false
|
36
|
-
Style/FrozenStringLiteralComment:
|
37
|
-
Enabled: false
|
38
|
-
Style/NumericLiterals:
|
39
|
-
Enabled: false
|
40
20
|
Style/RescueModifier:
|
41
21
|
Enabled: false
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -2,7 +2,6 @@
|
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/active_generator.svg)](http://badge.fury.io/rb/active_generator)
|
4
4
|
[![Build Status](https://travis-ci.org/drexed/active_generator.svg?branch=master)](https://travis-ci.org/drexed/active_generator)
|
5
|
-
[![Coverage Status](https://coveralls.io/repos/github/drexed/active_generator/badge.svg?branch=master)](https://coveralls.io/github/drexed/active_generator?branch=master)
|
6
5
|
|
7
6
|
ActiveGenerator extends the base rails generators with commonly used generators.
|
8
7
|
|
@@ -37,7 +36,7 @@ Or install it yourself as:
|
|
37
36
|
``../config/initalizers/active_generator.rb``
|
38
37
|
|
39
38
|
```ruby
|
40
|
-
ActiveGenerator
|
39
|
+
ActiveGenerator.configure do |config|
|
41
40
|
config.autoload_controller_generator_locale = true
|
42
41
|
config.autoload_helper_generator_locale = true
|
43
42
|
config.autoload_job_generator_locale = true
|
data/Rakefile
CHANGED
data/active_generator.gemspec
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# coding: utf-8
|
2
4
|
|
3
5
|
lib = File.expand_path('../lib', __FILE__)
|
@@ -23,7 +25,6 @@ Gem::Specification.new do |spec|
|
|
23
25
|
spec.add_runtime_dependency 'rails'
|
24
26
|
|
25
27
|
spec.add_development_dependency 'bundler'
|
26
|
-
spec.add_development_dependency 'coveralls'
|
27
28
|
spec.add_development_dependency 'rake'
|
28
29
|
spec.add_development_dependency 'rspec'
|
29
30
|
spec.add_development_dependency 'generator_spec'
|
data/bin/console
CHANGED
data/bin/rake
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
#
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
3
4
|
# This file was generated by Bundler.
|
4
5
|
#
|
5
6
|
# The application 'rake' is installed as part of a gem, and
|
6
7
|
# this file is here to facilitate running it.
|
7
|
-
#
|
8
8
|
|
9
9
|
require 'pathname'
|
10
10
|
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', Pathname.new(__FILE__).realpath)
|
data/lib/active_generator.rb
CHANGED
@@ -1,6 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
%w[version configuration].each do |file_name|
|
4
|
+
require "active_generator/#{file_name}"
|
5
|
+
end
|
6
|
+
|
1
7
|
require 'rails/generators'
|
2
|
-
require 'active_generator/version'
|
3
|
-
require 'active_generator/settings'
|
4
8
|
require 'generators/active_generator/install/install_generator'
|
5
9
|
|
6
10
|
%w[environment initializer service view].each do |generator_name|
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ActiveGenerator
|
4
|
+
class Configuration
|
5
|
+
|
6
|
+
attr_accessor :autoload_controller_generator_locale, :autoload_helper_generator_locale,
|
7
|
+
:autoload_job_generator_locale, :autoload_mailer_generator_locale,
|
8
|
+
:autoload_model_generator_locale, :autoload_service_generator_locale,
|
9
|
+
:autoload_task_generator_locale, :autoload_view_generator_locale,
|
10
|
+
:test_framework
|
11
|
+
|
12
|
+
def initialize
|
13
|
+
@autoload_controller_generator_locale = true
|
14
|
+
@autoload_helper_generator_locale = true
|
15
|
+
@autoload_job_generator_locale = true
|
16
|
+
@autoload_mailer_generator_locale = true
|
17
|
+
@autoload_model_generator_locale = true
|
18
|
+
@autoload_service_generator_locale = true
|
19
|
+
@autoload_task_generator_locale = true
|
20
|
+
@autoload_view_generator_locale = true
|
21
|
+
@test_framework = 'test_unit'
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.configuration
|
27
|
+
@configuration ||= Configuration.new
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.configuration=(config)
|
31
|
+
@configuration = config
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.configure
|
35
|
+
yield(configuration)
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
ActiveGenerator.configure do |config|
|
2
4
|
config.autoload_controller_generator_locale = true
|
3
5
|
config.autoload_helper_generator_locale = true
|
4
6
|
config.autoload_job_generator_locale = true
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'rails/generators/rails/task/task_generator'
|
2
4
|
|
3
5
|
module Rails
|
@@ -5,7 +7,7 @@ module Rails
|
|
5
7
|
class TaskGenerator
|
6
8
|
|
7
9
|
def generate_locale_file
|
8
|
-
return unless ActiveGenerator
|
10
|
+
return unless ActiveGenerator.configuration.autoload_task_generator_locale
|
9
11
|
invoke('locale:task', [name])
|
10
12
|
end
|
11
13
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
class ServiceGenerator < Rails::Generators::NamedBase
|
2
4
|
source_root File.expand_path('../templates', __FILE__)
|
3
5
|
|
@@ -6,7 +8,7 @@ class ServiceGenerator < Rails::Generators::NamedBase
|
|
6
8
|
end
|
7
9
|
|
8
10
|
def generate_locale_file
|
9
|
-
return unless ActiveGenerator
|
11
|
+
return unless ActiveGenerator.configuration.autoload_service_generator_locale
|
10
12
|
invoke('locale:service', [name])
|
11
13
|
end
|
12
14
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'fileutils'
|
2
4
|
|
3
5
|
class ViewGenerator < Rails::Generators::NamedBase
|
@@ -31,7 +33,7 @@ class ViewGenerator < Rails::Generators::NamedBase
|
|
31
33
|
private
|
32
34
|
|
33
35
|
def configuration
|
34
|
-
ActiveGenerator
|
36
|
+
ActiveGenerator.configuration
|
35
37
|
end
|
36
38
|
|
37
39
|
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
|
+
version: 5.0.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: 2017-
|
11
|
+
date: 2017-10-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -38,20 +38,6 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: coveralls
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
42
|
name: rake
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -143,7 +129,6 @@ executables: []
|
|
143
129
|
extensions: []
|
144
130
|
extra_rdoc_files: []
|
145
131
|
files:
|
146
|
-
- ".coveralls.yml"
|
147
132
|
- ".fasterer.yml"
|
148
133
|
- ".gitignore"
|
149
134
|
- ".reek"
|
@@ -160,7 +145,7 @@ files:
|
|
160
145
|
- bin/setup
|
161
146
|
- lib/active_generator.rb
|
162
147
|
- lib/active_generator/base.rb
|
163
|
-
- lib/active_generator/
|
148
|
+
- lib/active_generator/configuration.rb
|
164
149
|
- lib/active_generator/version.rb
|
165
150
|
- lib/generators/active_generator/install/install_generator.rb
|
166
151
|
- lib/generators/active_generator/install/templates/install.rb
|
@@ -235,7 +220,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
235
220
|
version: '0'
|
236
221
|
requirements: []
|
237
222
|
rubyforge_project:
|
238
|
-
rubygems_version: 2.6.
|
223
|
+
rubygems_version: 2.6.13
|
239
224
|
signing_key:
|
240
225
|
specification_version: 4
|
241
226
|
summary: Gem for commonly used generators.
|
data/.coveralls.yml
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
service_name: travis-ci
|
@@ -1,18 +0,0 @@
|
|
1
|
-
require 'dry-configurable'
|
2
|
-
|
3
|
-
module ActiveGenerator
|
4
|
-
class Settings
|
5
|
-
extend Dry::Configurable
|
6
|
-
|
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'
|
16
|
-
|
17
|
-
end
|
18
|
-
end
|