Class: RailsOrbit::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- RailsOrbit::Generators::InstallGenerator
- Includes:
- ActiveRecord::Generators::Migration
- Defined in:
- lib/generators/rails_orbit/install_generator.rb
Instance Method Summary collapse
- #copy_migrations ⇒ Object
- #create_initializer ⇒ Object
- #mount_route ⇒ Object
- #print_next_steps ⇒ Object
Instance Method Details
#copy_migrations ⇒ Object
17 18 19 20 21 22 |
# File 'lib/generators/rails_orbit/install_generator.rb', line 17 def copy_migrations migration_template( "create_orbit_metrics.rb.erb", "db/migrate/create_rails_orbit_metrics.rb" ) end |
#create_initializer ⇒ Object
13 14 15 |
# File 'lib/generators/rails_orbit/install_generator.rb', line 13 def create_initializer template "initializer.rb", "config/initializers/rails_orbit.rb" end |
#mount_route ⇒ Object
24 25 26 |
# File 'lib/generators/rails_orbit/install_generator.rb', line 24 def mount_route route 'mount RailsOrbit::Engine, at: "/orbit"' end |
#print_next_steps ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/generators/rails_orbit/install_generator.rb', line 28 def print_next_steps say "\n" say "rails_orbit installed!", :green say "" say "Next steps:" say "" say " For :host_db or :external adapters:" say " bin/rails db:migrate" say "" say " For :sqlite adapter (default):" say " The table is created automatically on first boot." say " Or run manually: bin/rails rails_orbit:setup" say "" say " Then:" say " 1. Edit config/initializers/rails_orbit.rb" say " 2. Set ORBIT_USER and ORBIT_PASSWORD in your environment" say " 3. Visit /orbit in your browser" say "" say " Useful commands:" say " bin/rails rails_orbit:setup — create the metrics table" say " bin/rails rails_orbit:status — check config and table status" say "" say "If you are deploying to Heroku or another ephemeral platform:", :yellow say " Set config.storage_adapter = :host_db in the initializer.", :yellow end |