Class: Gearhead::Generators::InstallGenerator

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

Instance Method Summary collapse

Instance Method Details

#generate_config_fileObject



11
12
13
14
15
16
17
# File 'lib/generators/gearhead/install/install_generator.rb', line 11

def generate_config_file
  @automount = options[:automount]
  @endpoint = options[:endpoint]
  Gearhead::Utils.check_endpoint!(@endpoint)

  template "gearhead.rb.erb", "config/initializers/gearhead.rb"
end

#install_routesObject



19
20
21
# File 'lib/generators/gearhead/install/install_generator.rb', line 19

def install_routes
  inject_into_file "config/routes.rb", "\n  Gearhead.routes(self)", after: /Rails.application.routes.draw do/
end