Class: Jobshop::Generators::AppGenerator
- Inherits:
-
Rails::Generators::AppGenerator
- Object
- Rails::Generators::AppGenerator
- Jobshop::Generators::AppGenerator
- Defined in:
- lib/generators/jobshop/app/app_generator.rb
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
- #finish_template ⇒ Object
-
#initialize(*args) ⇒ AppGenerator
constructor
A new instance of AppGenerator.
- #remove_session_store_initializer_until_rails_5_1 ⇒ Object
- #run_bundle ⇒ Object
Constructor Details
#initialize(*args) ⇒ AppGenerator
Returns a new instance of AppGenerator.
69 70 71 72 73 74 75 |
# File 'lib/generators/jobshop/app/app_generator.rb', line 69 def initialize(*args) super config = args.last.is_a?(Hash) ? args.pop : { } = config[:jobshop_options] || { } self. = .merge().freeze end |
Class Method Details
.banner ⇒ Object
77 78 79 |
# File 'lib/generators/jobshop/app/app_generator.rb', line 77 def self. "jobshop new #{arguments.map(&:usage).join(' ')} [options]" end |
.source_paths ⇒ Object
57 58 59 60 |
# File 'lib/generators/jobshop/app/app_generator.rb', line 57 def self.source_paths [ Rails::Generators::AppGenerator.source_root, Jobshop::Generators::AppGenerator.source_root ] end |
.source_root ⇒ Object
53 54 55 |
# File 'lib/generators/jobshop/app/app_generator.rb', line 53 def self.source_root File.("templates", __dir__) end |
Instance Method Details
#finish_template ⇒ Object
85 86 87 88 89 90 |
# File 'lib/generators/jobshop/app/app_generator.rb', line 85 def finish_template generate "jobshop:config" build :config_schema_format build :mount_engine super end |
#remove_session_store_initializer_until_rails_5_1 ⇒ Object
81 82 83 |
# File 'lib/generators/jobshop/app/app_generator.rb', line 81 def remove_session_store_initializer_until_rails_5_1 remove_file "config/initializers/session_store.rb" end |
#run_bundle ⇒ Object
92 93 94 95 |
# File 'lib/generators/jobshop/app/app_generator.rb', line 92 def run_bundle super bundle_command("binstub jobshop") if bundle_install? end |