Class: FrontendGenerators::Bootstrap
- Inherits:
-
Object
- Object
- FrontendGenerators::Bootstrap
- Defined in:
- lib/frontend_generators/bootstrap.rb
Instance Method Summary collapse
- #add_assets ⇒ Object
- #bootstrap_css ⇒ Object
- #bootstrap_js ⇒ Object
- #css_destination ⇒ Object
- #fonts ⇒ Object
- #fonts_dirname ⇒ Object
- #js_destination ⇒ Object
- #root ⇒ Object
Instance Method Details
#add_assets ⇒ Object
3 4 5 6 7 8 |
# File 'lib/frontend_generators/bootstrap.rb', line 3 def add_assets FileUtils.cp(bootstrap_css, css_destination) FileUtils.cp(bootstrap_js, js_destination) FileUtils.mkdir_p(fonts_dirname) FileUtils.cp(fonts, fonts_dirname) end |
#bootstrap_css ⇒ Object
22 23 24 |
# File 'lib/frontend_generators/bootstrap.rb', line 22 def bootstrap_css File.join(root, "assets", "bootstrap", "bootstrap.css") end |
#bootstrap_js ⇒ Object
26 27 28 |
# File 'lib/frontend_generators/bootstrap.rb', line 26 def bootstrap_js File.join(root, "assets", "bootstrap", "bootstrap.js") end |
#css_destination ⇒ Object
18 19 20 |
# File 'lib/frontend_generators/bootstrap.rb', line 18 def css_destination File.join(Rails.root, "vendor", "assets", "stylesheets") end |
#fonts ⇒ Object
10 11 12 |
# File 'lib/frontend_generators/bootstrap.rb', line 10 def fonts Dir.glob("#{root}/assets/bootstrap/fonts/**/*") end |
#fonts_dirname ⇒ Object
14 15 16 |
# File 'lib/frontend_generators/bootstrap.rb', line 14 def fonts_dirname File.join(Rails.root, "public", "fonts") end |
#js_destination ⇒ Object
30 31 32 |
# File 'lib/frontend_generators/bootstrap.rb', line 30 def js_destination File.join(Rails.root, "vendor", "assets", "javascripts") end |
#root ⇒ Object
34 35 36 |
# File 'lib/frontend_generators/bootstrap.rb', line 34 def root File.("../../", File.dirname(__FILE__)) end |