Class: BootstrapGenerator

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

Instance Method Summary collapse

Instance Method Details

#add_gemsObject



6
7
8
# File 'lib/generators/bootstrap/bootstrap_generator.rb', line 6

def add_gems
  gem "bootstrap-sass"
end

#create_coffee_manifestObject



19
20
21
# File 'lib/generators/bootstrap/bootstrap_generator.rb', line 19

def create_coffee_manifest
  template "application.js", "app/assets/javascripts/#{resource_name}.js"
end

#create_layoutObject



23
24
25
26
27
28
29
# File 'lib/generators/bootstrap/bootstrap_generator.rb', line 23

def create_layout
  if options[:haml]
    template "application.html.haml", "app/views/layouts/#{resource_name}.html.haml"
  else
    template "application.html.erb", "app/views/layouts/#{resource_name}.html.erb"
  end
end

#create_scss_filesObject



10
11
12
13
# File 'lib/generators/bootstrap/bootstrap_generator.rb', line 10

def create_scss_files
  copy_file "_variables.css.scss", "app/assets/stylesheets/#{resource_name}/_variables.css.scss"
  copy_file "_application.css.scss", "app/assets/stylesheets/#{resource_name}/_#{resource_name}.css.scss"
end

#create_scss_manifestObject



15
16
17
# File 'lib/generators/bootstrap/bootstrap_generator.rb', line 15

def create_scss_manifest
  template "application.scss", "app/assets/stylesheets/#{resource_name}.scss"
end