Class: Schienenzeppelin::AppGenerator
- Inherits:
-
Rails::Generators::AppGenerator
- Object
- Rails::Generators::AppGenerator
- Schienenzeppelin::AppGenerator
- Includes:
- GeneratorUtils
- Defined in:
- lib/schienenzeppelin/app_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
- #after_install ⇒ Object
- #create_root_files ⇒ Object
- #create_test_files ⇒ Object
- #finish_template ⇒ Object
-
#initialize(*args) ⇒ AppGenerator
constructor
A new instance of AppGenerator.
Methods included from GeneratorUtils
Constructor Details
#initialize(*args) ⇒ AppGenerator
Returns a new instance of AppGenerator.
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/schienenzeppelin/app_generator.rb', line 12 def initialize(*args) super return unless [:api] self. = .merge( skip_errors: true, skip_high_voltage: true, skip_stimulus: true, skip_tailwind: true, skip_views: true ).freeze end |
Class Method Details
.banner ⇒ Object
77 78 79 |
# File 'lib/schienenzeppelin/app_generator.rb', line 77 def self. "sz new #{arguments.map(&:usage).join(' ')} [options]" end |
Instance Method Details
#after_install ⇒ Object
62 63 64 65 66 |
# File 'lib/schienenzeppelin/app_generator.rb', line 62 def after_install add(:tailwind, :stimulus, :stimulus_components) add(:devise) add(:capistrano) end |
#create_root_files ⇒ Object
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/schienenzeppelin/app_generator.rb', line 26 def create_root_files super add(:irbrc) add(:foreman) add(:dotenv) add(:docker) add(:docker_compose) add(:rubocop) end |
#create_test_files ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/schienenzeppelin/app_generator.rb', line 37 def create_test_files return if [:skip_test] super if [:testing_framework] == 'minitest' add(:rspec) if [:testing_framework] == 'rspec' end |
#finish_template ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/schienenzeppelin/app_generator.rb', line 45 def finish_template super # These require the presence of config/controllers, so they must be done after everything else add(:annotate) add(:continuous_integration) add(:high_voltage) add(:generators) add(:lograge) add(:pundit) add(:services) add(:sidekiq) add(:views, :errors, :scaffold) add(:factory_bot) add(:shoulda) end |