Class: Siracha::Generators::BootstrapGenerator

Inherits:
Rails::Generators::AppBase
  • Object
show all
Defined in:
lib/generators/css_framework.rb

Instance Method Summary collapse

Instance Method Details

#add_gemsObject



7
8
9
# File 'lib/generators/css_framework.rb', line 7

def add_gems
  gem 'bootstrap-sass', '~> 3.3.7'
end

#css_templateObject



15
16
17
18
# File 'lib/generators/css_framework.rb', line 15

def css_template
  remove_file('app/assets/stylesheets/application.css')
  directory 'stylesheets', 'app/assets/stylesheets'
end

#js_configurationObject



20
21
22
# File 'lib/generators/css_framework.rb', line 20

def js_configuration
  gsub_file('app/assets/javascripts/application.js', Regexp.escape(%q(//= require_tree .)), "\n//= require bootstrap-sprockets\n")
end

#run_bundle_installObject



11
12
13
# File 'lib/generators/css_framework.rb', line 11

def run_bundle_install
  bundle_command('install')
end