Class: Solidstats::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/solidstats/install/install_generator.rb

Overview

This generator installs Solidstats routes in the host application

This will:

  1. Add the Solidstats routes to the host application’s config/routes.rb

  2. Show a helpful README with next steps

Examples:

$ rails generate solidstats:install

Instance Method Summary collapse

Instance Method Details

#add_routesObject



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_readmeObject



27
28
29
# File 'lib/generators/solidstats/install/install_generator.rb', line 27

def show_readme
  readme "README" if behavior == :invoke
end