Class: Mensa::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Mensa::InstallGenerator
- Defined in:
- lib/generators/mensa/install_generator.rb
Instance Method Summary collapse
- #add_route ⇒ Object
- #copy_migrations ⇒ Object
- #create_initializer_file ⇒ Object
- #tailwindcss_config ⇒ Object
Instance Method Details
#add_route ⇒ Object
11 12 13 14 |
# File 'lib/generators/mensa/install_generator.rb', line 11 def add_route return if Rails.application.routes.routes.detect { |route| route.app.app == Mensa::Engine } route %(mount Mensa::Engine => "/mensa") end |
#copy_migrations ⇒ Object
16 17 18 |
# File 'lib/generators/mensa/install_generator.rb', line 16 def copy_migrations rake "mensa:install:migrations" end |
#create_initializer_file ⇒ Object
7 8 9 |
# File 'lib/generators/mensa/install_generator.rb', line 7 def create_initializer_file template "config/initializers/mensa.rb" end |
#tailwindcss_config ⇒ Object
20 21 22 |
# File 'lib/generators/mensa/install_generator.rb', line 20 def tailwindcss_config rake "mensa:tailwindcss:config" end |