Module: Jets::Generators::Overrides::App::AppBaseOverrides::ClassMethods
- Defined in:
- lib/jets/generators/overrides/app/app_generator.rb
Instance Method Summary collapse
-
#add_shared_options_for(name) ⇒ Object
Override to support jets options only.
-
#banner ⇒ Object
:doc:.
-
#exit_on_failure? ⇒ Boolean
We want to exit on failure to be kind to other libraries This is only when accessing via CLI.
- #jets_generator_root ⇒ Object
- #jets_templates_path ⇒ Object
-
#source_paths ⇒ Object
Prepend jets_template_path to source_paths so that the jets templates can override the rails templates.
- #usage_path ⇒ Object
Instance Method Details
#add_shared_options_for(name) ⇒ Object
Override to support jets options only
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/jets/generators/overrides/app/app_generator.rb', line 17 def (name) class_option :name, type: :string, aliases: "-n", desc: "Name of the app" class_option :template, type: :string, aliases: "-m", desc: "Path to some #{name} template (can be a filesystem path or URL)" class_option :database, type: :string, aliases: "-d", default: "mysql", desc: "Preconfigure for selected database (options: #{DATABASES.join('/')})" class_option :mode, default: 'html', desc: "mode: #{VALID_MODES.join(',')}" class_option :javascript, type: :string, aliases: "-j", default: "importmap", desc: "Choose JavaScript approach [options: importmap (default)]" end |
#banner ⇒ Object
:doc:
50 51 52 |
# File 'lib/jets/generators/overrides/app/app_generator.rb', line 50 def # :doc: "jets new #{arguments.map(&:usage).join(' ')} [options]" end |
#exit_on_failure? ⇒ Boolean
We want to exit on failure to be kind to other libraries This is only when accessing via CLI
65 66 67 |
# File 'lib/jets/generators/overrides/app/app_generator.rb', line 65 def exit_on_failure? true end |
#jets_generator_root ⇒ Object
46 47 48 |
# File 'lib/jets/generators/overrides/app/app_generator.rb', line 46 def jets_generator_root File.(__dir__) end |
#jets_templates_path ⇒ Object
42 43 44 |
# File 'lib/jets/generators/overrides/app/app_generator.rb', line 42 def jets_templates_path File.join(jets_generator_root, "templates") end |
#source_paths ⇒ Object
Prepend jets_template_path to source_paths so that the jets templates can override the rails templates.
37 38 39 40 |
# File 'lib/jets/generators/overrides/app/app_generator.rb', line 37 def source_paths rails_templates_path = Rails::Generators::AppGenerator.source_root [jets_templates_path, rails_templates_path] + super end |