Class: Plum::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Plum::Generators::InstallGenerator
- Defined in:
- lib/generators/plum/install/install_generator.rb
Instance Method Summary collapse
- #copy_initializer ⇒ Object
- #copy_migrations ⇒ Object
- #create_theme_directory ⇒ Object
- #mount_engine ⇒ Object
- #print_next_steps ⇒ Object
Instance Method Details
#copy_initializer ⇒ Object
18 19 20 |
# File 'lib/generators/plum/install/install_generator.rb', line 18 def copy_initializer template "plum_initializer.rb", "config/initializers/plum.rb" end |
#copy_migrations ⇒ Object
22 23 24 |
# File 'lib/generators/plum/install/install_generator.rb', line 22 def copy_migrations rake "plum:install:migrations" end |
#create_theme_directory ⇒ Object
26 27 28 |
# File 'lib/generators/plum/install/install_generator.rb', line 26 def create_theme_directory empty_directory "app/themes" end |
#mount_engine ⇒ Object
30 31 32 33 34 |
# File 'lib/generators/plum/install/install_generator.rb', line 30 def mount_engine return if [:skip_route] route %(mount Plum::Engine, at: "#{[:mount_path]}") end |
#print_next_steps ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/generators/plum/install/install_generator.rb', line 36 def print_next_steps say <<~TEXT Plum is installed. Next steps: bin/rails active_storage:install # if not already installed bin/rails db:migrate Plum is mounted at #{[:mount_path]}. Migrations are copied to db/migrate/ and can be reviewed before running. JavaScript and CSS are served from the engine automatically. TEXT end |