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
6 7 8 |
# File 'lib/generators/bootstrap/bootstrap_generator.rb', line 6 def add_gems gem "bootstrap-sass" end |
#create_coffee_manifest ⇒ Object
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_layout ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/generators/bootstrap/bootstrap_generator.rb', line 23 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
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_manifest ⇒ Object
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 |