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 19 20 |
# 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 'devise.rb', 'config/initializers/devise.rb' template 'dragonfly.rb', 'config/initializers/dragonfly.rb' template 'mongoid.yml', 'config/mongoid.yml' end |
#insert_engine_routes ⇒ Object
22 23 24 25 26 |
# File 'lib/generators/locomotive/install/install_generator.rb', line 22 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
28 29 30 |
# File 'lib/generators/locomotive/install/install_generator.rb', line 28 def remove_index_html remove_file 'public/index.html' end |
#show_readme ⇒ Object
32 33 34 |
# File 'lib/generators/locomotive/install/install_generator.rb', line 32 def show_readme readme 'README' end |