Class: Bobot::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Extended by:
Generators::Utils::ClassMethods
Includes:
Generators::Utils::InstanceMethods, Rails::Generators::Migration
Defined in:
lib/generators/bobot/install_generator.rb

Instance Method Summary collapse

Methods included from Generators::Utils::InstanceMethods

#ask_for, #display

Instance Method Details

#installObject



15
16
17
18
19
20
21
22
23
24
# File 'lib/generators/bobot/install_generator.rb', line 15

def install
  remove_file 'config/initializers/bobot.rb'
  namespace = ask_for('Where do you want to mount bobot?', 'bot', _namespace)
  route("mount Bobot::Engine => '/#{namespace}', as: 'bot'")
  template 'config/initializers/bobot.rb', 'config/initializers/bobot.rb'
  template 'app/bobot/workflow.rb', 'app/bobot/workflow.rb'
  copy_file 'config/locales/bobot.en.yml', 'config/locales/bobot.en.yml'
  copy_file 'config/locales/bobot.fr.yml', 'config/locales/bobot.fr.yml'
  display 'Installation done', :green
end