Class: Portfolio::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/portfolio/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#copy_initializer_fileObject



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_javascriptObject



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_stylesheetsObject



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_engineObject



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