Class: Bootstrap::Generators::InstallGenerator

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

Instance Method Summary collapse

Instance Method Details

#install_javascriptObject



15
16
17
18
19
20
# File 'lib/generators/bootstrap/install_generator.rb', line 15

def install_javascript
  line = "//= require_tree ."
  gsub_file 'app/assets/javascripts/application.js', /(#{Regexp.escape(line)})/mi do |match|
    "//= require bootstrap\n#{match}"
  end
end

#install_stylesheetsObject



8
9
10
11
12
13
# File 'lib/generators/bootstrap/install_generator.rb', line 8

def install_stylesheets
  line = " *= require_tree ."
  gsub_file 'app/assets/stylesheets/application.css', /(#{Regexp.escape(line)})/mi do |match|
    " *= require bootstrap\n#{match}"
  end
end