Class: BootstrapGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- BootstrapGenerator
- Defined in:
- lib/generators/bootstrap/bootstrap_generator.rb
Instance Method Summary collapse
- #add_gems ⇒ Object
- #create_coffee_manifest ⇒ Object
- #create_layout ⇒ Object
- #create_scss_files ⇒ Object
- #create_scss_manifest ⇒ Object
Instance Method Details
#add_gems ⇒ Object
7 8 9 |
# File 'lib/generators/bootstrap/bootstrap_generator.rb', line 7 def add_gems gem 'bootstrap-sass' end |
#create_coffee_manifest ⇒ Object
20 21 22 |
# File 'lib/generators/bootstrap/bootstrap_generator.rb', line 20 def create_coffee_manifest template 'application.js', "app/assets/javascripts/#{resource_name}.js" end |
#create_layout ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/generators/bootstrap/bootstrap_generator.rb', line 24 def create_layout if [: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_files ⇒ Object
11 12 13 14 |
# File 'lib/generators/bootstrap/bootstrap_generator.rb', line 11 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_manifest ⇒ Object
16 17 18 |
# File 'lib/generators/bootstrap/bootstrap_generator.rb', line 16 def create_scss_manifest template 'application.scss', "app/assets/stylesheets/#{resource_name}.scss" end |