Class: Lobby::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/lobby/install_generator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#session_nameObject

Returns the value of attribute session_name.



8
9
10
# File 'lib/generators/lobby/install_generator.rb', line 8

def session_name
  @session_name
end

#user_nameObject

Returns the value of attribute user_name.



8
9
10
# File 'lib/generators/lobby/install_generator.rb', line 8

def user_name
  @user_name
end

Instance Method Details

#create_config_filesObject



24
25
26
27
# File 'lib/generators/lobby/install_generator.rb', line 24

def create_config_files
  template "config/config.yml", "config/app_config.yml"
  template "config/locales/en.yml", "config/locales/en.lobby.yml"
end

#create_localesObject



19
20
21
22
# File 'lib/generators/lobby/install_generator.rb', line 19

def create_locales
  template "config/locales/de.yml", "config/locales/de.lobby.yml"
  template "config/locales/en.yml", "config/locales/en.lobby.yml"
end

#create_migrationObject



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

def create_migration
  migration_template 'db/migrate/create_users.rb', "db/migrate/create_#{user_plural_name}.rb"
end

#create_viewsObject



15
16
17
# File 'lib/generators/lobby/install_generator.rb', line 15

def create_views
  directory "views", "app/views/lobby"
end

#setup_routesObject



35
36
37
# File 'lib/generators/lobby/install_generator.rb', line 35

def setup_routes
  route "mount Lobby::Engine => '/', :as => 'lobby_engine'"
end