Class: FrontendGenerators::Bootstrap

Inherits:
Object
  • Object
show all
Defined in:
lib/frontend_generators/bootstrap.rb

Instance Method Summary collapse

Instance Method Details

#add_assetsObject



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_cssObject



22
23
24
# File 'lib/frontend_generators/bootstrap.rb', line 22

def bootstrap_css
  File.join(root, "assets", "bootstrap", "bootstrap.css")
end

#bootstrap_jsObject



26
27
28
# File 'lib/frontend_generators/bootstrap.rb', line 26

def bootstrap_js
  File.join(root, "assets", "bootstrap", "bootstrap.js")
end

#css_destinationObject



18
19
20
# File 'lib/frontend_generators/bootstrap.rb', line 18

def css_destination
  File.join(Rails.root, "vendor", "assets", "stylesheets")
end

#fontsObject



10
11
12
# File 'lib/frontend_generators/bootstrap.rb', line 10

def fonts
  Dir.glob("#{root}/assets/bootstrap/fonts/**/*")
end

#fonts_dirnameObject



14
15
16
# File 'lib/frontend_generators/bootstrap.rb', line 14

def fonts_dirname
  File.join(Rails.root, "public", "fonts")
end

#js_destinationObject



30
31
32
# File 'lib/frontend_generators/bootstrap.rb', line 30

def js_destination
  File.join(Rails.root, "vendor", "assets", "javascripts")
end

#rootObject



34
35
36
# File 'lib/frontend_generators/bootstrap.rb', line 34

def root
  File.expand_path("../../", File.dirname(__FILE__))
end