Class: Solidstats::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Solidstats::Generators::InstallGenerator
- Defined in:
- lib/generators/solidstats/install/install_generator.rb
Overview
This generator installs Solidstats routes in the host application
This will:
-
Add the Solidstats routes to the host application’s config/routes.rb
-
Show a helpful README with next steps
Instance Method Summary collapse
Instance Method Details
#add_routes ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/generators/solidstats/install/install_generator.rb', line 17 def add_routes route_code = " # Solidstats Routes (development only)\n mount Solidstats::Engine => \"/solidstats\" if Rails.env.development?\n RUBY\n\n route route_code\n say_status :routes, \"Mounting Solidstats engine at /solidstats (development environment only)\", :green\nend\n" |
#show_readme ⇒ Object
27 28 29 |
# File 'lib/generators/solidstats/install/install_generator.rb', line 27 def show_readme readme "README" if behavior == :invoke end |