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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 84a9847720a4a744f31f233d7ac0e959aae78d4e
4
- data.tar.gz: fe13cee085434933457878368dd2238cff5ab5b8
3
+ metadata.gz: d12317015c6ce79efe000541b30db07153072930
4
+ data.tar.gz: ab228a3c8e32ea42e3fca60ce32291063df8215a
5
5
  SHA512:
6
- metadata.gz: 8fef3e29d6aaf8c7222a80fba4da9b13d2d9230cda4e7757d51a813c29cb559504534fd0296b66a50a2ef06bf7cde50d689a0098984ae357b5246ed2412e9a1d
7
- data.tar.gz: b36e66276e4870327e921106e62904e0f6a291504ed5e98d8f37423cf7a026831d397035e6209f0cab318b7a8d289a67ee16a2ecf94ce29e58cbfcac3cddd707
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.3
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:
@@ -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 = ['lib']
21
+ spec.require_paths = %w[lib]
21
22
 
22
23
  spec.add_runtime_dependency 'rails'
23
24
 
@@ -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(environment initializer service view).each do |generator_name|
6
+ %w[environment initializer service view].each do |generator_name|
7
7
  require "generators/#{generator_name}/#{generator_name}_generator"
8
8
  end
9
- %w(api controller helper job mailer model service task uploader view).each do |generator_name|
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(controller helper job mailer model scaffold task).each do |generator_name|
12
+ %w[controller helper job mailer model scaffold task].each do |generator_name|
13
13
  require "generators/rails/#{generator_name}_generator"
14
14
  end
@@ -1,3 +1,3 @@
1
1
  module ActiveGenerator
2
- VERSION = '4.0.4'.freeze
2
+ VERSION = '4.0.5'.freeze
3
3
  end
@@ -10,22 +10,16 @@ class EnvironmentGenerator < Rails::Generators::NamedBase
10
10
 
11
11
  private
12
12
 
13
- ENVIRONMENTS = %w(development test production).freeze
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
- unless environment.nil?
21
- unless ENVIRONMENTS.include?(environment)
22
- raise ArgumentError,
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
- unless [2, 4, 5, 6].include?(language.size) && (language =~ /^[A-Za-z-]+$/)
8
- raise ArgumentError,
9
- "Unknown language format: #{language.inspect}. Valid format example is: 'en'"
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
- if ActiveGenerator::Settings.config.autoload_service_generator_locale
10
- invoke('locale:service', [name])
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
- unless actions.empty?
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
- template('view.html.erb', path)
17
- end
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
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: 2016-11-12 00:00:00.000000000 Z
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.8
238
+ rubygems_version: 2.6.12
239
239
  signing_key:
240
240
  specification_version: 4
241
241
  summary: Gem for commonly used generators.