Class: HrLite::Generators::InstallGenerator

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

Overview

rails g hr_lite:install — drops the annotated initializer and prints the remaining wiring steps. With --route it also appends a mount line.

Instance Method Summary collapse

Instance Method Details

#add_routeObject



18
19
20
21
22
# File 'lib/generators/hr_lite/install/install_generator.rb', line 18

def add_route
  return unless options[:route]

  route 'mount HrLite::Engine => "/hr", as: :hr_lite'
end

#copy_initializerObject



14
15
16
# File 'lib/generators/hr_lite/install/install_generator.rb', line 14

def copy_initializer
  template "initializer.rb", "config/initializers/hr_lite.rb"
end

#show_next_stepsObject



24
25
26
# File 'lib/generators/hr_lite/install/install_generator.rb', line 24

def show_next_steps
  readme "AFTER_INSTALL" if behavior == :invoke
end