Class: CASino::InstallGenerator

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

Instance Method Summary collapse

Instance Method Details

#copy_config_filesObject


26
27
28
29
30
31
# File 'lib/generators/casino/install/install_generator.rb', line 26

def copy_config_files
  return unless options['config_files']

  copy_file 'cas.yml', 'config/cas.yml'
  copy_file 'casino_and_overrides.scss', 'app/assets/stylesheets/casino_and_overrides.scss'
end

#insert_assets_loaderObject


33
34
35
36
37
# File 'lib/generators/casino/install/install_generator.rb', line 33

def insert_assets_loader
  insert_into_file 'app/assets/javascripts/application.js', :after => %r{//= require +['"]?jquery_ujs['"]?} do
    "\n//= require casino"
  end
end

#insert_engine_routesObject


39
40
41
# File 'lib/generators/casino/install/install_generator.rb', line 39

def insert_engine_routes
  route "mount CASino::Engine => '/', :as => 'casino'"
end

#install_migrationsObject


20
21
22
23
24
# File 'lib/generators/casino/install/install_generator.rb', line 20

def install_migrations
  return unless options['migration']

  rake 'casino:install:migrations'
end

#show_readmeObject


43
44
45
# File 'lib/generators/casino/install/install_generator.rb', line 43

def show_readme
  readme 'README'
end