active_generator 2.4.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/.coveralls.yml +1 -1
  3. data/.gitignore +1 -1
  4. data/.rspec +1 -1
  5. data/.travis.yml +1 -1
  6. data/CODE_OF_CONDUCT.md +1 -1
  7. data/Gemfile +2 -2
  8. data/README.md +7 -5
  9. data/Rakefile +1 -1
  10. data/active_generator.gemspec +14 -15
  11. data/bin/console +1 -1
  12. data/bin/rake +6 -6
  13. data/bin/setup +1 -1
  14. data/lib/active_generator.rb +1 -2
  15. data/lib/active_generator/base.rb +7 -7
  16. data/lib/active_generator/configuration.rb +9 -9
  17. data/lib/active_generator/version.rb +2 -2
  18. data/lib/generators/active_generator/install/install_generator.rb +3 -3
  19. data/lib/generators/active_generator/install/templates/install.rb +9 -9
  20. data/lib/generators/environment/environment_generator.rb +4 -4
  21. data/lib/generators/environment/templates/environment.rb +1 -1
  22. data/lib/generators/initializer/initializer_generator.rb +3 -3
  23. data/lib/generators/initializer/templates/initializer.rb +1 -1
  24. data/lib/generators/locale/api/api_generator.rb +6 -6
  25. data/lib/generators/locale/api/templates/api.yml +1 -1
  26. data/lib/generators/locale/base.rb +1 -1
  27. data/lib/generators/locale/controller/controller_generator.rb +6 -6
  28. data/lib/generators/locale/controller/templates/controller.yml +1 -1
  29. data/lib/generators/locale/helper/helper_generator.rb +6 -6
  30. data/lib/generators/locale/helper/templates/helper.yml +1 -1
  31. data/lib/generators/locale/job/job_generator.rb +6 -6
  32. data/lib/generators/locale/job/templates/job.yml +1 -1
  33. data/lib/generators/locale/mailer/mailer_generator.rb +6 -6
  34. data/lib/generators/locale/mailer/templates/mailer.yml +1 -1
  35. data/lib/generators/locale/model/model_generator.rb +6 -6
  36. data/lib/generators/locale/model/templates/model.yml +1 -1
  37. data/lib/generators/locale/service/service_generator.rb +6 -6
  38. data/lib/generators/locale/service/templates/service.yml +1 -1
  39. data/lib/generators/locale/task/task_generator.rb +6 -6
  40. data/lib/generators/locale/task/templates/task.yml +1 -1
  41. data/lib/generators/locale/uploader/templates/uploader.yml +1 -1
  42. data/lib/generators/locale/uploader/uploader_generator.rb +6 -6
  43. data/lib/generators/locale/view/templates/view.yml +1 -1
  44. data/lib/generators/locale/view/view_generator.rb +6 -6
  45. data/lib/generators/rails/controller_generator.rb +5 -5
  46. data/lib/generators/rails/helper_generator.rb +3 -3
  47. data/lib/generators/rails/job_generator.rb +3 -3
  48. data/lib/generators/rails/mailer_generator.rb +5 -5
  49. data/lib/generators/rails/model_generator.rb +3 -3
  50. data/lib/generators/rails/scaffold_generator.rb +3 -3
  51. data/lib/generators/rails/task_generator.rb +3 -3
  52. data/lib/generators/service/service_generator.rb +4 -4
  53. data/lib/generators/service/templates/service.rb +1 -1
  54. data/lib/generators/view/templates/view.html.erb +1 -1
  55. data/lib/generators/view/view_generator.rb +7 -7
  56. metadata +4 -18
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d16b9787a2934503b732ec6fc387266f3fc3f7c4
4
- data.tar.gz: 1562289c1bc5bc45a523393d45a3616ebb01923d
3
+ metadata.gz: 44de9f0654eceba8035b7f78df2c501840f62507
4
+ data.tar.gz: 9e6e28cd6386142bdae69d01f6d61b1beb67fec1
5
5
  SHA512:
6
- metadata.gz: 940f547585d3f94897fdc6dce388c1aa132035ebec8cd1bedd592464839e69dd0c3816855d778e6d01750a6e54aaaa9c814682992f356124ee5ec0ba11e8636b
7
- data.tar.gz: 3722315a75d9c5a3876918fadb55465e207c33e25389d95adca180ef7679723a5e8f1854c15ea4778f05472ed9c084a91b77bc61f83bcf0c8c032fa8eaa33a89
6
+ metadata.gz: 00c3c9d3aa43397d8fedca75dbef24c67ea0288d0ac4e249c0dc6fbac85c4b31935055407255638f342ee53523fa3f636a2fb5824db9d14f3f32b3142141fa0a
7
+ data.tar.gz: 7d5b9c97f1de258cf0ab1430d31ce0a5d4fbb2fb0083db1153a4b256293ec718241e992971701e48ece81988ceaa88bef3a51e5ed54d0c032bc0c79b08a61f8f
@@ -1 +1 @@
1
- service_name: travis-ci
1
+ service_name: travis-ci
data/.gitignore CHANGED
@@ -6,4 +6,4 @@
6
6
  /doc/
7
7
  /pkg/
8
8
  /spec/reports/
9
- /tmp/
9
+ /tmp/
data/.rspec CHANGED
@@ -1,4 +1,4 @@
1
1
  --backtrace
2
2
  --color
3
3
  --format progress
4
- --order random
4
+ --order random
@@ -10,4 +10,4 @@ notifications:
10
10
  on_success: never
11
11
  rvm:
12
12
  - ruby-head
13
- script: 'bundle exec rake'
13
+ script: 'bundle exec rake'
@@ -10,4 +10,4 @@ Project maintainers have the right and responsibility to remove, edit, or reject
10
10
 
11
11
  Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
12
 
13
- This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source 'https://rubygems.org'
1
+ source "https://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in active_generator.gemspec
4
- gemspec
4
+ gemspec
data/README.md CHANGED
@@ -2,7 +2,7 @@
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/drexed/active_generator/badge.png)](https://coveralls.io/r/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
6
 
7
7
  ActiveGenerator extends the base rails generators with commonly used generators.
8
8
 
@@ -11,7 +11,7 @@ ActiveGenerator extends the base rails generators with commonly used generators.
11
11
  Add this line to your application's Gemfile:
12
12
 
13
13
  ```ruby
14
- gem 'active_generator'
14
+ gem "active_generator"
15
15
  ```
16
16
 
17
17
  And then execute:
@@ -175,8 +175,10 @@ Generates an view file in the `app/views` directory.
175
175
 
176
176
  ## Contributing
177
177
 
178
- 1. Fork it ( https://github.com/[my-github-username]/active_generator/fork )
178
+ Your contribution is welcome.
179
+
180
+ 1. Fork it
179
181
  2. Create your feature branch (`git checkout -b my-new-feature`)
180
- 3. Commit your changes (`git commit -am 'Add some feature'`)
182
+ 3. Commit your changes (`git commit -am 'Added some feature'`)
181
183
  4. Push to the branch (`git push origin my-new-feature`)
182
- 5. Create a new Pull Request
184
+ 5. Create new Pull Request
data/Rakefile CHANGED
@@ -1,3 +1,3 @@
1
1
  require "bundler/gem_tasks"
2
2
 
3
- task default: :spec
3
+ task default: :spec
@@ -1,30 +1,29 @@
1
1
  # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
2
+ lib = File.expand_path("../lib", __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'active_generator/version'
4
+ require "active_generator/version"
5
5
 
6
6
  Gem::Specification.new do |spec|
7
- spec.name = "active_generator"
8
- spec.version = ActiveGenerator::VERSION
9
- spec.authors = ["Juan Gomez"]
10
- spec.email = ["j.gomez@drexed.com"]
7
+ spec.name = "active_generator"
8
+ spec.version = ActiveGenerator::VERSION
9
+ spec.authors = ["Juan Gomez"]
10
+ spec.email = ["j.gomez@drexed.com"]
11
11
 
12
- spec.summary = %q{Gem for commonly used generators.}
13
- spec.description = %q{Extend the base rails generators with commonly used generators.}
14
- spec.homepage = "https://github.com/drexed/active_generator"
15
- spec.license = "MIT"
12
+ spec.summary = %q{Gem for commonly used generators.}
13
+ spec.description = %q{Extend the base rails generators with commonly used generators.}
14
+ spec.homepage = "http://drexed.github.io/active_generator"
15
+ spec.license = "MIT"
16
16
 
17
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
- spec.bindir = "exe"
19
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ spec.bindir = "exe"
19
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
20
  spec.require_paths = ["lib"]
21
21
 
22
22
  spec.add_runtime_dependency "rails"
23
- spec.add_runtime_dependency "active_object"
24
23
 
25
24
  spec.add_development_dependency "bundler"
26
25
  spec.add_development_dependency "coveralls"
27
26
  spec.add_development_dependency "rake"
28
27
  spec.add_development_dependency "rspec"
29
28
  spec.add_development_dependency "generator_spec"
30
- end
29
+ end
@@ -11,4 +11,4 @@ require "active_generator"
11
11
  # Pry.start
12
12
 
13
13
  require "irb"
14
- IRB.start
14
+ IRB.start
data/bin/rake CHANGED
@@ -2,15 +2,15 @@
2
2
  #
3
3
  # This file was generated by Bundler.
4
4
  #
5
- # The application 'rake' is installed as part of a gem, and
5
+ # The application "rake" is installed as part of a gem, and
6
6
  # this file is here to facilitate running it.
7
7
  #
8
8
 
9
- require 'pathname'
10
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
9
+ require "pathname"
10
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
11
11
  Pathname.new(__FILE__).realpath)
12
12
 
13
- require 'rubygems'
14
- require 'bundler/setup'
13
+ require "rubygems"
14
+ require "bundler/setup"
15
15
 
16
- load Gem.bin_path('rake', 'rake')
16
+ load Gem.bin_path("rake", "rake")
data/bin/setup CHANGED
@@ -4,4 +4,4 @@ IFS=$'\n\t'
4
4
 
5
5
  bundle install
6
6
 
7
- # Do any other automated setup that you need to do here
7
+ # Do any other automated setup that you need to do here
@@ -1,6 +1,5 @@
1
1
  require "rails/generators"
2
2
 
3
- require "active_object"
4
3
  require "active_generator/version"
5
4
  require "active_generator/configuration"
6
5
 
@@ -36,4 +35,4 @@ end
36
35
 
37
36
  %w(controller helper job mailer model scaffold task).each do |generator_name|
38
37
  require "generators/rails/#{generator_name}_generator"
39
- end
38
+ end
@@ -8,28 +8,28 @@ module ActiveGenerator
8
8
  end
9
9
 
10
10
  def file_name_human
11
- file_name_table.gsub('_'.freeze, ' '.freeze).downcase.capitalize
11
+ file_name_table.gsub("_".freeze, " ".freeze).downcase.capitalize
12
12
  end
13
13
 
14
14
  def namespace
15
- name.downcase.split('/'.freeze).delete_last
15
+ name.downcase.split("/".freeze)[0...-1]
16
16
  end
17
17
 
18
18
  def namespaced?
19
- name.include?('/'.freeze)
19
+ name.include?("/".freeze)
20
20
  end
21
21
 
22
22
  def namespace_human
23
- namespace.join(' '.freeze).gsub('_'.freeze, ' '.freeze).downcase.capitalize
23
+ namespace.join(" ".freeze).gsub("_".freeze, " ".freeze).downcase.capitalize
24
24
  end
25
25
 
26
26
  def namespace_table
27
- namespace.join('_'.freeze)
27
+ namespace.join("_".freeze)
28
28
  end
29
29
 
30
30
  def namespace_path
31
- namespace.join('/'.freeze)
31
+ namespace.join("/".freeze)
32
32
  end
33
33
 
34
34
  end
35
- end
35
+ end
@@ -12,14 +12,14 @@ class ActiveGenerator::Configuration
12
12
 
13
13
  def initialize
14
14
  @autoload_controller_generator_locale = true
15
- @autoload_helper_generator_locale = true
16
- @autoload_job_generator_locale = true
17
- @autoload_mailer_generator_locale = true
18
- @autoload_model_generator_locale = true
19
- @autoload_service_generator_locale = true
20
- @autoload_task_generator_locale = true
21
- @autoload_view_generator_locale = true
22
- @test_framework = :test_unit
15
+ @autoload_helper_generator_locale = true
16
+ @autoload_job_generator_locale = true
17
+ @autoload_mailer_generator_locale = true
18
+ @autoload_model_generator_locale = true
19
+ @autoload_service_generator_locale = true
20
+ @autoload_task_generator_locale = true
21
+ @autoload_view_generator_locale = true
22
+ @test_framework = "test_unit"
23
23
  end
24
24
 
25
- end
25
+ end
@@ -1,3 +1,3 @@
1
1
  module ActiveGenerator
2
- VERSION = "2.4.0"
3
- end
2
+ VERSION = "3.0.0"
3
+ end
@@ -1,10 +1,10 @@
1
1
  module ActiveGenerator
2
2
  class InstallGenerator < Rails::Generators::Base
3
- source_root File.expand_path('../templates', __FILE__)
3
+ source_root File.expand_path("../templates", __FILE__)
4
4
 
5
5
  def copy_initializer_file
6
- copy_file('install.rb', 'config/initializers/active_generator.rb')
6
+ copy_file("install.rb", "config/initializers/active_generator.rb")
7
7
  end
8
8
 
9
9
  end
10
- end
10
+ end
@@ -1,11 +1,11 @@
1
1
  ActiveGenerator.configure do |config|
2
2
  config.autoload_controller_generator_locale = true
3
- config.autoload_helper_generator_locale = true
4
- config.autoload_job_generator_locale = true
5
- config.autoload_mailer_generator_locale = true
6
- config.autoload_model_generator_locale = true
7
- config.autoload_service_generator_locale = true
8
- config.autoload_task_generator_locale = true
9
- config.autoload_view_generator_locale = true
10
- config.test_framework = "test_unit"
11
- end
3
+ config.autoload_helper_generator_locale = true
4
+ config.autoload_job_generator_locale = true
5
+ config.autoload_mailer_generator_locale = true
6
+ config.autoload_model_generator_locale = true
7
+ config.autoload_service_generator_locale = true
8
+ config.autoload_task_generator_locale = true
9
+ config.autoload_view_generator_locale = true
10
+ config.test_framework = "test_unit"
11
+ end
@@ -1,10 +1,10 @@
1
1
  class EnvironmentGenerator < Rails::Generators::NamedBase
2
- source_root File.expand_path('../templates', __FILE__)
3
- argument :environment, type: :string, required: false, default: nil, desc: 'The environment template to copy'
2
+ source_root File.expand_path("../templates", __FILE__)
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('environment.rb', File.join('config/environments', class_path, "#{file_name}.rb"))
7
+ template("environment.rb", File.join("config/environments", class_path, "#{file_name}.rb"))
8
8
  end
9
9
 
10
10
  private
@@ -24,4 +24,4 @@ class EnvironmentGenerator < Rails::Generators::NamedBase
24
24
  end
25
25
  end
26
26
 
27
- end
27
+ end
@@ -158,4 +158,4 @@ Rails.application.configure do
158
158
  # TODO:
159
159
  # Add environment code here.
160
160
  <% end -%>
161
- end
161
+ end
@@ -1,8 +1,8 @@
1
1
  class InitializerGenerator < Rails::Generators::NamedBase
2
- source_root File.expand_path('../templates', __FILE__)
2
+ source_root File.expand_path("../templates", __FILE__)
3
3
 
4
4
  def copy_initializer_file
5
- copy_file('initializer.rb', File.join('config/initializers', class_path, "#{file_name}.rb"))
5
+ copy_file("initializer.rb", File.join("config/initializers", class_path, "#{file_name}.rb"))
6
6
  end
7
7
 
8
- end
8
+ end
@@ -1,2 +1,2 @@
1
1
  # TODO:
2
- # Add initializer code here.
2
+ # Add initializer code here.
@@ -1,18 +1,18 @@
1
- require 'active_generator/base'
2
- require 'generators/locale/base'
1
+ require "active_generator/base"
2
+ require "generators/locale/base"
3
3
 
4
4
  module Locale
5
5
  class ApiGenerator < Rails::Generators::NamedBase
6
6
  include ActiveGenerator::Base
7
7
  include Locale::Base
8
8
 
9
- source_root File.expand_path('../templates', __FILE__)
10
- argument :language, type: :string, required: false, default: 'en', desc: 'The locale alpha code'
9
+ source_root File.expand_path("../templates", __FILE__)
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('api.yml', File.join("config/locales/#{language}/apis", namespace_path, "#{file_name}.yml"))
14
+ template("api.yml", File.join("config/locales/#{language}/apis", namespace_path, "#{file_name}.yml"))
15
15
  end
16
16
 
17
17
  end
18
- end
18
+ end
@@ -37,4 +37,4 @@
37
37
  # TODO
38
38
  #--------------------------------------------------
39
39
  todo: "TODO"
40
- <% end -%>
40
+ <% end -%>
@@ -11,4 +11,4 @@ module Locale
11
11
  end
12
12
 
13
13
  end
14
- end
14
+ end
@@ -1,18 +1,18 @@
1
- require 'active_generator/base'
2
- require 'generators/locale/base'
1
+ require "active_generator/base"
2
+ require "generators/locale/base"
3
3
 
4
4
  module Locale
5
5
  class ControllerGenerator < Rails::Generators::NamedBase
6
6
  include ActiveGenerator::Base
7
7
  include Locale::Base
8
8
 
9
- source_root File.expand_path('../templates', __FILE__)
10
- argument :language, type: :string, required: false, default: 'en', desc: 'The locale alpha code'
9
+ source_root File.expand_path("../templates", __FILE__)
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('controller.yml', File.join("config/locales/#{language}/controllers", namespace_path, "#{file_name}.yml"))
14
+ template("controller.yml", File.join("config/locales/#{language}/controllers", namespace_path, "#{file_name}.yml"))
15
15
  end
16
16
 
17
17
  end
18
- end
18
+ end
@@ -59,4 +59,4 @@
59
59
  # TODO
60
60
  #--------------------------------------------------
61
61
  todo: "TODO"
62
- <% end -%>
62
+ <% end -%>
@@ -1,18 +1,18 @@
1
- require 'active_generator/base'
2
- require 'generators/locale/base'
1
+ require "active_generator/base"
2
+ require "generators/locale/base"
3
3
 
4
4
  module Locale
5
5
  class HelperGenerator < Rails::Generators::NamedBase
6
6
  include ActiveGenerator::Base
7
7
  include Locale::Base
8
8
 
9
- source_root File.expand_path('../templates', __FILE__)
10
- argument :language, type: :string, required: false, default: 'en', desc: 'The locale alpha code'
9
+ source_root File.expand_path("../templates", __FILE__)
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('helper.yml', File.join("config/locales/#{language}/helpers", namespace_path, "#{file_name}.yml"))
14
+ template("helper.yml", File.join("config/locales/#{language}/helpers", namespace_path, "#{file_name}.yml"))
15
15
  end
16
16
 
17
17
  end
18
- end
18
+ end
@@ -37,4 +37,4 @@
37
37
  # TODO
38
38
  #--------------------------------------------------
39
39
  todo: "TODO"
40
- <% end -%>
40
+ <% end -%>
@@ -1,18 +1,18 @@
1
- require 'active_generator/base'
2
- require 'generators/locale/base'
1
+ require "active_generator/base"
2
+ require "generators/locale/base"
3
3
 
4
4
  module Locale
5
5
  class JobGenerator < Rails::Generators::NamedBase
6
6
  include ActiveGenerator::Base
7
7
  include Locale::Base
8
8
 
9
- source_root File.expand_path('../templates', __FILE__)
10
- argument :language, type: :string, required: false, default: 'en', desc: 'The locale alpha code'
9
+ source_root File.expand_path("../templates", __FILE__)
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('job.yml', File.join("config/locales/#{language}/jobs", namespace_path, "#{file_name}.yml"))
14
+ template("job.yml", File.join("config/locales/#{language}/jobs", namespace_path, "#{file_name}.yml"))
15
15
  end
16
16
 
17
17
  end
18
- end
18
+ end
@@ -37,4 +37,4 @@
37
37
  # TODO
38
38
  #--------------------------------------------------
39
39
  todo: "TODO"
40
- <% end -%>
40
+ <% end -%>
@@ -1,18 +1,18 @@
1
- require 'active_generator/base'
2
- require 'generators/locale/base'
1
+ require "active_generator/base"
2
+ require "generators/locale/base"
3
3
 
4
4
  module Locale
5
5
  class MailerGenerator < Rails::Generators::NamedBase
6
6
  include ActiveGenerator::Base
7
7
  include Locale::Base
8
8
 
9
- source_root File.expand_path('../templates', __FILE__)
10
- argument :language, type: :string, required: false, default: 'en', desc: 'The locale alpha code'
9
+ source_root File.expand_path("../templates", __FILE__)
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('mailer.yml', File.join("config/locales/#{language}/mailers", namespace_path, "#{file_name}.yml"))
14
+ template("mailer.yml", File.join("config/locales/#{language}/mailers", namespace_path, "#{file_name}.yml"))
15
15
  end
16
16
 
17
17
  end
18
- end
18
+ end
@@ -37,4 +37,4 @@
37
37
  # TODO
38
38
  #--------------------------------------------------
39
39
  todo: "TODO"
40
- <% end -%>
40
+ <% end -%>
@@ -1,18 +1,18 @@
1
- require 'active_generator/base'
2
- require 'generators/locale/base'
1
+ require "active_generator/base"
2
+ require "generators/locale/base"
3
3
 
4
4
  module Locale
5
5
  class ModelGenerator < Rails::Generators::NamedBase
6
6
  include ActiveGenerator::Base
7
7
  include Locale::Base
8
8
 
9
- source_root File.expand_path('../templates', __FILE__)
10
- argument :language, type: :string, required: false, default: 'en', desc: 'The locale alpha code'
9
+ source_root File.expand_path("../templates", __FILE__)
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('model.yml', File.join("config/locales/#{language}/models", namespace_path, "#{file_name}.yml"))
14
+ template("model.yml", File.join("config/locales/#{language}/models", namespace_path, "#{file_name}.yml"))
15
15
  end
16
16
 
17
17
  end
18
- end
18
+ end
@@ -51,4 +51,4 @@
51
51
  # TODO
52
52
  #--------------------------------------------------
53
53
  todo: "TODO"
54
- <% end -%>
54
+ <% end -%>
@@ -1,18 +1,18 @@
1
- require 'active_generator/base'
2
- require 'generators/locale/base'
1
+ require "active_generator/base"
2
+ require "generators/locale/base"
3
3
 
4
4
  module Locale
5
5
  class ServiceGenerator < Rails::Generators::NamedBase
6
6
  include ActiveGenerator::Base
7
7
  include Locale::Base
8
8
 
9
- source_root File.expand_path('../templates', __FILE__)
10
- argument :language, type: :string, required: false, default: 'en', desc: 'The locale alpha code'
9
+ source_root File.expand_path("../templates", __FILE__)
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('service.yml', File.join("config/locales/#{language}/services", namespace_path, "#{file_name}.yml"))
14
+ template("service.yml", File.join("config/locales/#{language}/services", namespace_path, "#{file_name}.yml"))
15
15
  end
16
16
 
17
17
  end
18
- end
18
+ end
@@ -37,4 +37,4 @@
37
37
  # TODO
38
38
  #--------------------------------------------------
39
39
  todo: "TODO"
40
- <% end -%>
40
+ <% end -%>
@@ -1,18 +1,18 @@
1
- require 'active_generator/base'
2
- require 'generators/locale/base'
1
+ require "active_generator/base"
2
+ require "generators/locale/base"
3
3
 
4
4
  module Locale
5
5
  class TaskGenerator < Rails::Generators::NamedBase
6
6
  include ActiveGenerator::Base
7
7
  include Locale::Base
8
8
 
9
- source_root File.expand_path('../templates', __FILE__)
10
- argument :language, type: :string, required: false, default: 'en', desc: 'The locale alpha code'
9
+ source_root File.expand_path("../templates", __FILE__)
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('task.yml', File.join("config/locales/#{language}/tasks", namespace_path, "#{file_name}.yml"))
14
+ template("task.yml", File.join("config/locales/#{language}/tasks", namespace_path, "#{file_name}.yml"))
15
15
  end
16
16
 
17
17
  end
18
- end
18
+ end
@@ -37,4 +37,4 @@
37
37
  # TODO
38
38
  #--------------------------------------------------
39
39
  todo: "TODO"
40
- <% end -%>
40
+ <% end -%>
@@ -37,4 +37,4 @@
37
37
  # TODO
38
38
  #--------------------------------------------------
39
39
  todo: "TODO"
40
- <% end -%>
40
+ <% end -%>
@@ -1,18 +1,18 @@
1
- require 'active_generator/base'
2
- require 'generators/locale/base'
1
+ require "active_generator/base"
2
+ require "generators/locale/base"
3
3
 
4
4
  module Locale
5
5
  class UploaderGenerator < Rails::Generators::NamedBase
6
6
  include ActiveGenerator::Base
7
7
  include Locale::Base
8
8
 
9
- source_root File.expand_path('../templates', __FILE__)
10
- argument :language, type: :string, required: false, default: 'en', desc: 'The locale alpha code'
9
+ source_root File.expand_path("../templates", __FILE__)
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('uploader.yml', File.join("config/locales/#{language}/uploaders", namespace_path, "#{file_name}.yml"))
14
+ template("uploader.yml", File.join("config/locales/#{language}/uploaders", namespace_path, "#{file_name}.yml"))
15
15
  end
16
16
 
17
17
  end
18
- end
18
+ end
@@ -59,4 +59,4 @@
59
59
  # TODO
60
60
  #--------------------------------------------------
61
61
  todo: "TODO"
62
- <% end -%>
62
+ <% end -%>
@@ -1,18 +1,18 @@
1
- require 'active_generator/base'
2
- require 'generators/locale/base'
1
+ require "active_generator/base"
2
+ require "generators/locale/base"
3
3
 
4
4
  module Locale
5
5
  class ViewGenerator < Rails::Generators::NamedBase
6
6
  include ActiveGenerator::Base
7
7
  include Locale::Base
8
8
 
9
- source_root File.expand_path('../templates', __FILE__)
10
- argument :language, type: :string, required: false, default: 'en', desc: 'The locale alpha code'
9
+ source_root File.expand_path("../templates", __FILE__)
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('view.yml', File.join("config/locales/#{language}/views", namespace_path, "#{file_name}.yml"))
14
+ template("view.yml", File.join("config/locales/#{language}/views", namespace_path, "#{file_name}.yml"))
15
15
  end
16
16
 
17
17
  end
18
- end
18
+ end
@@ -1,12 +1,12 @@
1
- require 'rails/generators/erb/controller/controller_generator'
2
- require 'rails/generators/rails/controller/controller_generator'
1
+ require "rails/generators/erb/controller/controller_generator"
2
+ require "rails/generators/rails/controller/controller_generator"
3
3
 
4
4
  module Erb
5
5
  module Generators
6
6
  class ControllerGenerator
7
7
 
8
8
  def generate_locale_file
9
- invoke('locale:view', [name]) if ActiveGenerator.configuration.autoload_view_generator_locale
9
+ invoke("locale:view", [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('locale:controller', [name]) if ActiveGenerator.configuration.autoload_controller_generator_locale
27
+ invoke("locale:controller", [name]) if ActiveGenerator.configuration.autoload_controller_generator_locale
28
28
  end
29
29
 
30
30
  def generate_test_file
@@ -35,4 +35,4 @@ module Rails
35
35
 
36
36
  end
37
37
  end
38
- end
38
+ end
@@ -1,11 +1,11 @@
1
- require 'rails/generators/rails/helper/helper_generator'
1
+ require "rails/generators/rails/helper/helper_generator"
2
2
 
3
3
  module Rails
4
4
  module Generators
5
5
  class HelperGenerator
6
6
 
7
7
  def generate_locale_file
8
- invoke('locale:helper', [name]) if ActiveGenerator.configuration.autoload_helper_generator_locale
8
+ invoke("locale:helper", [name]) if ActiveGenerator.configuration.autoload_helper_generator_locale
9
9
  end
10
10
 
11
11
  def generate_test_file
@@ -16,4 +16,4 @@ module Rails
16
16
 
17
17
  end
18
18
  end
19
- end
19
+ end
@@ -1,11 +1,11 @@
1
- require 'rails/generators/job/job_generator'
1
+ require "rails/generators/job/job_generator"
2
2
 
3
3
  module Rails
4
4
  module Generators
5
5
  class JobGenerator
6
6
 
7
7
  def generate_locale_file
8
- invoke('locale:job', [name]) if ActiveGenerator.configuration.autoload_job_generator_locale
8
+ invoke("locale:job", [name]) if ActiveGenerator.configuration.autoload_job_generator_locale
9
9
  end
10
10
 
11
11
  def generate_test_file
@@ -16,4 +16,4 @@ module Rails
16
16
 
17
17
  end
18
18
  end
19
- end
19
+ end
@@ -1,12 +1,12 @@
1
- require 'rails/generators/erb/mailer/mailer_generator'
2
- require 'rails/generators/mailer/mailer_generator'
1
+ require "rails/generators/erb/mailer/mailer_generator"
2
+ require "rails/generators/mailer/mailer_generator"
3
3
 
4
4
  module Erb
5
5
  module Generators
6
6
  class MailerGenerator
7
7
 
8
8
  def generate_locale_file
9
- invoke('locale:view', [name]) if ActiveGenerator.configuration.autoload_view_generator_locale
9
+ invoke("locale:view", [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('locale:mailer', [name]) if ActiveGenerator.configuration.autoload_mailer_generator_locale
27
+ invoke("locale:mailer", [name]) if ActiveGenerator.configuration.autoload_mailer_generator_locale
28
28
  end
29
29
 
30
30
  def generate_test_file
@@ -35,4 +35,4 @@ module Rails
35
35
 
36
36
  end
37
37
  end
38
- end
38
+ end
@@ -1,4 +1,4 @@
1
- require 'rails/generators/active_record/model/model_generator'
1
+ require "rails/generators/active_record/model/model_generator"
2
2
 
3
3
  module ActiveRecord
4
4
  module Generators
@@ -11,7 +11,7 @@ module ActiveRecord
11
11
  end
12
12
 
13
13
  def generate_locale_file
14
- invoke('locale:model', [name]) if ActiveGenerator.configuration.autoload_model_generator_locale
14
+ invoke("locale:model", [name]) if ActiveGenerator.configuration.autoload_model_generator_locale
15
15
  end
16
16
 
17
17
  def generate_test_file
@@ -22,4 +22,4 @@ module ActiveRecord
22
22
 
23
23
  end
24
24
  end
25
- end
25
+ end
@@ -1,11 +1,11 @@
1
- require 'rails/generators/erb/scaffold/scaffold_generator'
1
+ require "rails/generators/erb/scaffold/scaffold_generator"
2
2
 
3
3
  module Erb
4
4
  module Generators
5
5
  class ScaffoldGenerator
6
6
 
7
7
  def generate_locale_file
8
- invoke('locale:view', [name]) if ActiveGenerator.configuration.autoload_view_generator_locale
8
+ invoke("locale:view", [name]) if ActiveGenerator.configuration.autoload_view_generator_locale
9
9
  end
10
10
 
11
11
  def generate_test_file
@@ -16,4 +16,4 @@ module Erb
16
16
 
17
17
  end
18
18
  end
19
- end
19
+ end
@@ -1,13 +1,13 @@
1
- require 'rails/generators/rails/task/task_generator'
1
+ require "rails/generators/rails/task/task_generator"
2
2
 
3
3
  module Rails
4
4
  module Generators
5
5
  class TaskGenerator
6
6
 
7
7
  def generate_locale_file
8
- invoke('locale:task', [name]) if ActiveGenerator.configuration.autoload_task_generator_locale
8
+ invoke("locale:task", [name]) if ActiveGenerator.configuration.autoload_task_generator_locale
9
9
  end
10
10
 
11
11
  end
12
12
  end
13
- end
13
+ end
@@ -1,12 +1,12 @@
1
1
  class ServiceGenerator < Rails::Generators::NamedBase
2
- source_root File.expand_path('../templates', __FILE__)
2
+ source_root File.expand_path("../templates", __FILE__)
3
3
 
4
4
  def create_service_file
5
- template('service.rb', File.join('app/services', class_path, "#{file_name}.rb"))
5
+ template("service.rb", File.join("app/services", class_path, "#{file_name}.rb"))
6
6
  end
7
7
 
8
8
  def generate_locale_file
9
- invoke('locale:service', [name]) if ActiveGenerator.configuration.autoload_service_generator_locale
9
+ invoke("locale:service", [name]) if ActiveGenerator.configuration.autoload_service_generator_locale
10
10
  end
11
11
 
12
- end
12
+ end
@@ -1,4 +1,4 @@
1
1
  class <%= class_name %>
2
2
  # TODO:
3
3
  # Add service code here.
4
- end
4
+ end
@@ -1,2 +1,2 @@
1
1
  <!-- TODO: -->
2
- <!-- Add view code here. -->
2
+ <!-- Add view code here. -->
@@ -1,23 +1,23 @@
1
- require 'fileutils'
1
+ require "fileutils"
2
2
 
3
3
  class ViewGenerator < Rails::Generators::NamedBase
4
- source_root File.expand_path('../templates', __FILE__)
5
- argument :actions, type: :array, required: false, default: [], desc: 'The pages to generate'
4
+ source_root File.expand_path("../templates", __FILE__)
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('app/views', file_name)) if actions.empty?
8
+ empty_directory(File.join("app/views", 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('view.html.erb', File.join('app/views', class_path, file_name, "#{filename}.html.erb"))
14
+ template("view.html.erb", File.join("app/views", 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('locale:view', [name]) if ActiveGenerator.configuration.autoload_view_generator_locale
20
+ invoke("locale:view", [name]) if ActiveGenerator.configuration.autoload_view_generator_locale
21
21
  end
22
22
 
23
23
  def generate_test_file
@@ -26,4 +26,4 @@ class ViewGenerator < Rails::Generators::NamedBase
26
26
  end
27
27
  end
28
28
 
29
- end
29
+ 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: 2.4.0
4
+ version: 3.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: 2016-01-07 00:00:00.000000000 Z
11
+ date: 2016-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -24,20 +24,6 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
- - !ruby/object:Gem::Dependency
28
- name: active_object
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: bundler
43
29
  requirement: !ruby/object:Gem::Requirement
@@ -183,7 +169,7 @@ files:
183
169
  - lib/generators/view/USAGE
184
170
  - lib/generators/view/templates/view.html.erb
185
171
  - lib/generators/view/view_generator.rb
186
- homepage: https://github.com/drexed/active_generator
172
+ homepage: http://drexed.github.io/active_generator
187
173
  licenses:
188
174
  - MIT
189
175
  metadata: {}
@@ -203,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
203
189
  version: '0'
204
190
  requirements: []
205
191
  rubyforge_project:
206
- rubygems_version: 2.5.1
192
+ rubygems_version: 2.6.4
207
193
  signing_key:
208
194
  specification_version: 4
209
195
  summary: Gem for commonly used generators.