Class: Marilyn::Generators::WelcomeGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/marilyn/welcome/welcome_generator.rb

Instance Method Summary collapse

Instance Method Details

#copy_controller_filesObject



9
10
11
12
13
14
15
# File 'lib/generators/marilyn/welcome/welcome_generator.rb', line 9

def copy_controller_files
  copy_file('app/controllers/welcome_controller.rb')
  copy_file('test/functional/welcome_controller_test.rb')
  copy_file('app/helpers/welcome_helper.rb')
  copy_file('test/unit/helpers/welcome_helper_test.rb')
  copy_file('app/views/welcome/index.html.erb')
end

#remove_default_index_htmlObject



23
24
25
# File 'lib/generators/marilyn/welcome/welcome_generator.rb', line 23

def remove_default_index_html
  remove_file('public/index.html')
end

#set_root_routeObject



17
18
19
20
21
# File 'lib/generators/marilyn/welcome/welcome_generator.rb', line 17

def set_root_route
  #begin_regex = /^.*::Application.routes.draw do\n$/
  #inject_into_file('config/routes.rb', "\n  root :to => 'welcome#index'\n", :after => begin_regex)
  route "root :to => 'welcome#index'"
end