Class: ProductTours::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- ProductTours::Generators::InstallGenerator
- Includes:
- ActiveRecord::Generators::Migration, MigrationHelpers
- Defined in:
- lib/generators/product_tours/install/install_generator.rb
Instance Method Summary collapse
- #create_initializer ⇒ Object
- #create_migration_file ⇒ Object
- #mount_engine ⇒ Object
- #post_install ⇒ Object
Instance Method Details
#create_initializer ⇒ Object
16 17 18 |
# File 'lib/generators/product_tours/install/install_generator.rb', line 16 def create_initializer copy_file 'initializer.rb', 'config/initializers/product_tours.rb' end |
#create_migration_file ⇒ Object
20 21 22 |
# File 'lib/generators/product_tours/install/install_generator.rb', line 20 def create_migration_file migration_template 'create_product_tours_posts.rb.tt', 'db/migrate/create_product_tours_posts.rb' end |
#mount_engine ⇒ Object
24 25 26 |
# File 'lib/generators/product_tours/install/install_generator.rb', line 24 def mount_engine route %(mount_product_tours at: "/product_tours") end |
#post_install ⇒ Object
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/generators/product_tours/install/install_generator.rb', line 28 def post_install say "\nproduct_tours installed. Run `bin/rails db:migrate`.", :green say 'The migration adds ready-to-use demo posts in development.' say "\nCopy this into any ERB view to try them:\n\n" say ProductTours::Seeds.trigger_html say 'Manage tutorials at /product_tours (development only until config.authorize_admin is set).' say 'Run `bin/rails product_tours:seed_demo` any time to refresh every demo locale.' say 'Run `bin/rails active_storage:install` for uploads and ' say '`bin/rails action_text:install` for rich descriptions.\n' end |