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.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/.reek +1 -13
  3. data/.rubocop.yml +2 -22
  4. data/Gemfile +2 -0
  5. data/README.md +1 -2
  6. data/Rakefile +2 -0
  7. data/active_generator.gemspec +2 -1
  8. data/bin/console +1 -0
  9. data/bin/rake +2 -2
  10. data/lib/active_generator.rb +6 -2
  11. data/lib/active_generator/base.rb +2 -0
  12. data/lib/active_generator/configuration.rb +38 -0
  13. data/lib/active_generator/version.rb +3 -1
  14. data/lib/generators/active_generator/install/install_generator.rb +2 -0
  15. data/lib/generators/active_generator/install/templates/install.rb +3 -1
  16. data/lib/generators/environment/environment_generator.rb +2 -0
  17. data/lib/generators/environment/templates/environment.rb +2 -0
  18. data/lib/generators/initializer/initializer_generator.rb +2 -0
  19. data/lib/generators/initializer/templates/initializer.rb +2 -0
  20. data/lib/generators/locale/api/api_generator.rb +2 -0
  21. data/lib/generators/locale/base.rb +2 -0
  22. data/lib/generators/locale/controller/controller_generator.rb +2 -0
  23. data/lib/generators/locale/helper/helper_generator.rb +2 -0
  24. data/lib/generators/locale/job/job_generator.rb +2 -0
  25. data/lib/generators/locale/mailer/mailer_generator.rb +2 -0
  26. data/lib/generators/locale/model/model_generator.rb +2 -0
  27. data/lib/generators/locale/service/service_generator.rb +2 -0
  28. data/lib/generators/locale/task/task_generator.rb +2 -0
  29. data/lib/generators/locale/uploader/uploader_generator.rb +2 -0
  30. data/lib/generators/locale/view/view_generator.rb +2 -0
  31. data/lib/generators/rails/base.rb +3 -1
  32. data/lib/generators/rails/controller_generator.rb +2 -0
  33. data/lib/generators/rails/helper_generator.rb +2 -0
  34. data/lib/generators/rails/job_generator.rb +2 -0
  35. data/lib/generators/rails/mailer_generator.rb +2 -0
  36. data/lib/generators/rails/model_generator.rb +2 -0
  37. data/lib/generators/rails/scaffold_generator.rb +2 -0
  38. data/lib/generators/rails/task_generator.rb +3 -1
  39. data/lib/generators/service/service_generator.rb +3 -1
  40. data/lib/generators/service/templates/service.rb +2 -0
  41. data/lib/generators/view/view_generator.rb +3 -1
  42. metadata +4 -19
  43. data/.coveralls.yml +0 -1
  44. data/lib/active_generator/settings.rb +0 -18
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a137b61423be7711ae8b93b84ee4d549561f0d0c
4
- data.tar.gz: 8adbd9b6548f92c0858ac4c9baa043cc3f7559d1
3
+ metadata.gz: 42522c4d97f6b3deb34f6d74fd3c016e6fd4b479
4
+ data.tar.gz: 81b786cba681cd79eb9dbb33d32508cc1dd0b8b5
5
5
  SHA512:
6
- metadata.gz: e25b980e78ba743fdc2eb375f0c60582b25512479afa7edd4ea2ca60651f8eae66643bc83378ebf5439ff70fa658e861773240573e140be851412691693542aa
7
- data.tar.gz: 36580c76858ff236ca2bfbb48b907183bf1f5043e3e504f90f80e587d2444e503af5e5349596de71c5be5e0f91913e4426e2275f4c054933b724ca4d02811fc1
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
- RepeatedConditional:
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/ScriptPermission:
23
- Enabled: false
24
- Metrics/ClassLength:
14
+ Lint/RescueWithoutErrorClass:
25
15
  Enabled: false
26
- Metrics/ModuleLength:
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
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  # Specify your gem's dependencies in active_generator.gemspec
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::Settings.configure do |config|
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
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler/gem_tasks'
2
4
 
3
5
  task default: :spec
@@ -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
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  require 'bundler/setup'
4
5
  require 'active_generator'
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)
@@ -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|
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActiveGenerator
2
4
  module Base
3
5
 
@@ -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,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActiveGenerator
2
- VERSION = '4.0.6'.freeze
4
+ VERSION ||= '5.0.0'
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActiveGenerator
2
4
  class InstallGenerator < Rails::Generators::Base
3
5
  source_root File.expand_path('../templates', __FILE__)
@@ -1,4 +1,6 @@
1
- ActiveGenerator::Settings.configure do |config|
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
  class EnvironmentGenerator < Rails::Generators::NamedBase
2
4
  source_root File.expand_path('../templates', __FILE__)
3
5
  argument :environment, type: :string, required: false, default: nil,
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Rails.application.configure do
2
4
  # Settings specified here will take precedence over those in config/application.rb.
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class InitializerGenerator < Rails::Generators::NamedBase
2
4
  source_root File.expand_path('../templates', __FILE__)
3
5
 
@@ -1,2 +1,4 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # TODO:
2
4
  # Add initializer code here.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'active_generator/base'
2
4
  require 'generators/locale/base'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Locale
2
4
  module Base
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'active_generator/base'
2
4
  require 'generators/locale/base'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'active_generator/base'
2
4
  require 'generators/locale/base'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'active_generator/base'
2
4
  require 'generators/locale/base'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'active_generator/base'
2
4
  require 'generators/locale/base'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'active_generator/base'
2
4
  require 'generators/locale/base'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'active_generator/base'
2
4
  require 'generators/locale/base'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'active_generator/base'
2
4
  require 'generators/locale/base'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'active_generator/base'
2
4
  require 'generators/locale/base'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'active_generator/base'
2
4
  require 'generators/locale/base'
3
5
 
@@ -1,10 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Rails
2
4
  module Base
3
5
 
4
6
  private
5
7
 
6
8
  def configuration
7
- ActiveGenerator::Settings.config
9
+ ActiveGenerator.configuration
8
10
  end
9
11
 
10
12
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rails/generators/erb/controller/controller_generator'
2
4
  require 'rails/generators/rails/controller/controller_generator'
3
5
  require 'generators/rails/base'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rails/generators/rails/helper/helper_generator'
2
4
  require 'generators/rails/base'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rails/generators/job/job_generator'
2
4
  require 'generators/rails/base'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rails/generators/erb/mailer/mailer_generator'
2
4
  require 'rails/generators/mailer/mailer_generator'
3
5
  require 'generators/rails/base'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rails/generators/active_record/model/model_generator'
2
4
  require 'generators/rails/base'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rails/generators/erb/scaffold/scaffold_generator'
2
4
  require 'generators/rails/base'
3
5
 
@@ -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::Settings.config.autoload_task_generator_locale
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::Settings.config.autoload_service_generator_locale
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
  class <%= class_name %>
2
4
  # TODO:
3
5
  # Add service code here.
@@ -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::Settings.config
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.0.6
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-08-03 00:00:00.000000000 Z
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/settings.rb
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.12
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