Class: Locomotive::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Locomotive::InstallGenerator
- Defined in:
- lib/generators/locomotive/install/install_generator.rb
Instance Method Summary collapse
- #copy_initializers ⇒ Object
- #insert_engine_routes ⇒ Object
- #remove_index_html ⇒ Object
- #show_readme ⇒ Object
Instance Method Details
#copy_initializers ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/generators/locomotive/install/install_generator.rb', line 6 def copy_initializers @source_paths = nil # reset it for the find_in_source_paths method Locomotive::InstallGenerator.source_root(File.('../templates', __FILE__)) template 'locomotive.rb', 'config/initializers/locomotive.rb' template 'carrierwave.rb', 'config/initializers/carrierwave.rb' template 'dragonfly.rb', 'config/initializers/dragonfly.rb' template 'mongoid.yml', 'config/mongoid.yml' end |
#insert_engine_routes ⇒ Object
20 21 22 23 24 |
# File 'lib/generators/locomotive/install/install_generator.rb', line 20 def insert_engine_routes route %( mount Locomotive::Engine => '/locomotive', :as => 'locomotive' # you can change the value of the path, by default set to "/locomotive" ) end |
#remove_index_html ⇒ Object
26 27 28 |
# File 'lib/generators/locomotive/install/install_generator.rb', line 26 def remove_index_html remove_file 'public/index.html' end |
#show_readme ⇒ Object
30 31 32 |
# File 'lib/generators/locomotive/install/install_generator.rb', line 30 def show_readme readme 'README' end |