active_generator 4.0.4 → 4.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +15 -13
- data/active_generator.gemspec +2 -1
- data/lib/active_generator.rb +3 -3
- data/lib/active_generator/version.rb +1 -1
- data/lib/generators/environment/environment_generator.rb +4 -10
- data/lib/generators/locale/base.rb +3 -4
- data/lib/generators/service/service_generator.rb +2 -3
- data/lib/generators/view/view_generator.rb +4 -5
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d12317015c6ce79efe000541b30db07153072930
|
4
|
+
data.tar.gz: ab228a3c8e32ea42e3fca60ce32291063df8215a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9db262949f626ee0109040324c13aab07efb9260bf3bccbec43182173a38058f3d52f7b8c11c808caf7126a15bf2241acded4c1c542e195b069b6569babe3c14
|
7
|
+
data.tar.gz: 5f37bca71cdcb84a6570f20806cf89d7d84dc27eb7dc878c4c3e946a0b2d994a6fa630ad64086481358ca2e4ec56af3e8491fcc8cabfd4c528c67a5ae07a7563
|
data/.rubocop.yml
CHANGED
@@ -1,12 +1,26 @@
|
|
1
1
|
AllCops:
|
2
2
|
DisplayCopNames: true
|
3
3
|
DisplayStyleGuide: true
|
4
|
-
TargetRubyVersion: 2.
|
4
|
+
TargetRubyVersion: 2.4
|
5
5
|
Exclude:
|
6
6
|
- 'lib/**/**/templates/*'
|
7
7
|
- 'spec/**/**/*'
|
8
|
+
Layout/ClosingParenthesisIndentation:
|
9
|
+
Enabled: false
|
10
|
+
Layout/EmptyLinesAroundBlockBody:
|
11
|
+
Enabled: false
|
12
|
+
Layout/EmptyLinesAroundClassBody:
|
13
|
+
Enabled: false
|
14
|
+
Layout/EmptyLinesAroundModuleBody:
|
15
|
+
Enabled: false
|
16
|
+
Layout/FirstParameterIndentation:
|
17
|
+
Enabled: false
|
18
|
+
Layout/MultilineMethodCallIndentation:
|
19
|
+
EnforcedStyle: aligned
|
8
20
|
LineLength:
|
9
21
|
Max: 100
|
22
|
+
Lint/ScriptPermission:
|
23
|
+
Enabled: false
|
10
24
|
Metrics/ClassLength:
|
11
25
|
Enabled: false
|
12
26
|
Metrics/ModuleLength:
|
@@ -15,24 +29,12 @@ Style/Alias:
|
|
15
29
|
EnforcedStyle: prefer_alias_method
|
16
30
|
Style/BracesAroundHashParameters:
|
17
31
|
Enabled: false
|
18
|
-
Style/ClosingParenthesisIndentation:
|
19
|
-
Enabled: false
|
20
32
|
Style/Documentation:
|
21
33
|
Enabled: false
|
22
|
-
Style/EmptyLinesAroundBlockBody:
|
23
|
-
Enabled: false
|
24
|
-
Style/EmptyLinesAroundClassBody:
|
25
|
-
Enabled: false
|
26
|
-
Style/EmptyLinesAroundModuleBody:
|
27
|
-
Enabled: false
|
28
34
|
Style/HashSyntax:
|
29
35
|
Enabled: false
|
30
|
-
Style/FirstParameterIndentation:
|
31
|
-
Enabled: false
|
32
36
|
Style/FrozenStringLiteralComment:
|
33
37
|
Enabled: false
|
34
|
-
Style/MultilineMethodCallIndentation:
|
35
|
-
EnforcedStyle: aligned
|
36
38
|
Style/NumericLiterals:
|
37
39
|
Enabled: false
|
38
40
|
Style/RescueModifier:
|
data/active_generator.gemspec
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# coding: utf-8
|
2
|
+
|
2
3
|
lib = File.expand_path('../lib', __FILE__)
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
5
|
require 'active_generator/version'
|
@@ -17,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
17
18
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
19
|
spec.bindir = 'exe'
|
19
20
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
|
-
spec.require_paths = [
|
21
|
+
spec.require_paths = %w[lib]
|
21
22
|
|
22
23
|
spec.add_runtime_dependency 'rails'
|
23
24
|
|
data/lib/active_generator.rb
CHANGED
@@ -3,12 +3,12 @@ require 'active_generator/version'
|
|
3
3
|
require 'active_generator/settings'
|
4
4
|
require 'generators/active_generator/install/install_generator'
|
5
5
|
|
6
|
-
%w
|
6
|
+
%w[environment initializer service view].each do |generator_name|
|
7
7
|
require "generators/#{generator_name}/#{generator_name}_generator"
|
8
8
|
end
|
9
|
-
%w
|
9
|
+
%w[api controller helper job mailer model service task uploader view].each do |generator_name|
|
10
10
|
require "generators/locale/#{generator_name}/#{generator_name}_generator"
|
11
11
|
end
|
12
|
-
%w
|
12
|
+
%w[controller helper job mailer model scaffold task].each do |generator_name|
|
13
13
|
require "generators/rails/#{generator_name}_generator"
|
14
14
|
end
|
@@ -10,22 +10,16 @@ class EnvironmentGenerator < Rails::Generators::NamedBase
|
|
10
10
|
|
11
11
|
private
|
12
12
|
|
13
|
-
ENVIRONMENTS = %w
|
13
|
+
ENVIRONMENTS = %w[development test production].freeze
|
14
14
|
|
15
15
|
ENVIRONMENTS.each do |env|
|
16
16
|
define_method("#{env}?") { environment == env }
|
17
17
|
end
|
18
18
|
|
19
19
|
def assert_valid_environment!
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
[
|
24
|
-
"Unknown environment: #{environment.inspect}.",
|
25
|
-
"Valid options: #{ENVIRONMENTS.map(&:inspect).join(', ')}"
|
26
|
-
].join(' ')
|
27
|
-
end
|
28
|
-
end
|
20
|
+
return if environment.nil? || ENVIRONMENTS.include?(environment)
|
21
|
+
raise ArgumentError, ["Unknown environment: #{environment.inspect}.",
|
22
|
+
"Valid options: #{ENVIRONMENTS.map(&:inspect).join(', ')}"].join(' ')
|
29
23
|
end
|
30
24
|
|
31
25
|
end
|
@@ -4,10 +4,9 @@ module Locale
|
|
4
4
|
private
|
5
5
|
|
6
6
|
def assert_valid_language!
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
end
|
7
|
+
return if [2, 4, 5, 6].include?(language.size) && /^[A-Za-z-]+$/.match?(language)
|
8
|
+
raise ArgumentError,
|
9
|
+
"Unknown language format: #{language.inspect}. Valid format example is: 'en'"
|
11
10
|
end
|
12
11
|
|
13
12
|
end
|
@@ -6,9 +6,8 @@ class ServiceGenerator < Rails::Generators::NamedBase
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def generate_locale_file
|
9
|
-
|
10
|
-
|
11
|
-
end
|
9
|
+
return unless ActiveGenerator::Settings.config.autoload_service_generator_locale
|
10
|
+
invoke('locale:service', [name])
|
12
11
|
end
|
13
12
|
|
14
13
|
end
|
@@ -9,12 +9,11 @@ class ViewGenerator < Rails::Generators::NamedBase
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def create_view_file
|
12
|
-
|
13
|
-
actions.each do |filename|
|
14
|
-
path = File.join('app/views', class_path, file_name, "#{filename}.html.erb")
|
12
|
+
return if actions.empty?
|
15
13
|
|
16
|
-
|
17
|
-
|
14
|
+
actions.each do |filename|
|
15
|
+
path = File.join('app/views', class_path, file_name, "#{filename}.html.erb")
|
16
|
+
template('view.html.erb', path)
|
18
17
|
end
|
19
18
|
end
|
20
19
|
|
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.
|
4
|
+
version: 4.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juan Gomez
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -235,7 +235,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
235
235
|
version: '0'
|
236
236
|
requirements: []
|
237
237
|
rubyforge_project:
|
238
|
-
rubygems_version: 2.6.
|
238
|
+
rubygems_version: 2.6.12
|
239
239
|
signing_key:
|
240
240
|
specification_version: 4
|
241
241
|
summary: Gem for commonly used generators.
|