Class: Marilyn::Generators::WelcomeGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Marilyn::Generators::WelcomeGenerator
- Defined in:
- lib/generators/marilyn/welcome/welcome_generator.rb
Instance Method Summary collapse
Instance Method Details
#copy_controller_files ⇒ Object
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_html ⇒ Object
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_route ⇒ Object
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 |