Class: Stopover::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Stopover::Generators::InstallGenerator
- Defined in:
- lib/generators/stopover/install_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.banner ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/generators/stopover/install_generator.rb', line 11 def self. <<-BANNER.chomp rails g stopover:install Copies a layout, template and initializer to your application. BANNER end |
Instance Method Details
#copy_initializer ⇒ Object
20 21 22 |
# File 'lib/generators/stopover/install_generator.rb', line 20 def copy_initializer template 'stopover.rb', 'config/initializers/stopover.rb' end |
#copy_layout ⇒ Object
24 25 26 27 |
# File 'lib/generators/stopover/install_generator.rb', line 24 def copy_layout layout = "layouts/#{Stopover.layout_name}.html.#{template_engine}" copy_file layout, "app/views/#{layout}" end |
#copy_view ⇒ Object
29 30 31 32 |
# File 'lib/generators/stopover/install_generator.rb', line 29 def copy_view view = "404.html.#{template_engine}" copy_file "views/#{view}", "app/views/#{Stopover.view_path}/#{view}" end |
#show_readme ⇒ Object
34 35 36 |
# File 'lib/generators/stopover/install_generator.rb', line 34 def show_readme readme 'README' if behavior == :invoke end |