Class: Portfolio::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Portfolio::Generators::InstallGenerator
- Defined in:
- lib/generators/portfolio/install_generator.rb
Instance Method Summary collapse
- #copy_initializer_file ⇒ Object
- #insert_javascript ⇒ Object
- #insert_stylesheets ⇒ Object
- #mount_engine ⇒ Object
Instance Method Details
#copy_initializer_file ⇒ Object
21 22 23 |
# File 'lib/generators/portfolio/install_generator.rb', line 21 def copy_initializer_file copy_file 'initializer.rb', 'config/initializers/portfolio.rb' end |
#insert_javascript ⇒ Object
30 31 32 33 34 |
# File 'lib/generators/portfolio/install_generator.rb', line 30 def insert_javascript inject_into_file 'app/assets/javascripts/application.js', after: "//= require jquery\n" do "//= require portfolio/application\n" end end |
#insert_stylesheets ⇒ Object
36 37 38 39 40 |
# File 'lib/generators/portfolio/install_generator.rb', line 36 def insert_stylesheets inject_into_file 'app/assets/stylesheets/application.css', before: "\n */" do "\n *= require portfolio/application" end end |
#mount_engine ⇒ Object
25 26 27 28 |
# File 'lib/generators/portfolio/install_generator.rb', line 25 def mount_engine route "\n mount Portfolio::Engine, at: '/portfolio'\n"+ " # root 'portfolio/sites#default'\n\n" end |