Class: Jets::Generators::EngineGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- Jets::Generators::EngineGenerator
- Defined in:
- lib/generators/jets/engine/engine_generator.rb
Instance Method Summary collapse
- #add_engine_to_gemfile_as_component ⇒ Object
- #create_engine_file ⇒ Object
- #mount_engine_to_routes ⇒ Object
Instance Method Details
#add_engine_to_gemfile_as_component ⇒ Object
25 26 27 |
# File 'lib/generators/jets/engine/engine_generator.rb', line 25 def add_engine_to_gemfile_as_component append_to_file "Gemfile", "component \"#{name}\"" end |
#create_engine_file ⇒ Object
14 15 16 17 18 19 |
# File 'lib/generators/jets/engine/engine_generator.rb', line 14 def create_engine_file directory(".", "engines/#{name}") chmod "engines/#{name}/bin/console", 0o755, verbose: false chmod "engines/#{name}/bin/rails", 0o755, verbose: false end |
#mount_engine_to_routes ⇒ Object
21 22 23 |
# File 'lib/generators/jets/engine/engine_generator.rb', line 21 def mount_engine_to_routes route "mount #{class_name}::Engine, at: \"/\", as: :#{name}_root" end |