11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'lib/generators/bootstrap_assets/install/install_generator.rb', line 11
def download_assets
plugins = %w(alert button carousel collapse dropdown modal popover scrollspy tab tooltip transition typeahead)
less = %w(accordion alerts bootstrap breadcrumbs button-groups buttons carousel close code component-animations dropdowns forms grid hero-unit labels-badges layouts mixins modals navbar navs pager pagination popovers progress-bars reset responsive-767px-max responsive-768px-979px responsive-1200px-min responsive-navbar responsive-utilities responsive scaffolding sprites tables thumbnails tooltip type utilities variables wells)
images = %w(glyphicons-halflings-white glyphicons-halflings)
js_path = 'vendor/assets/javascripts/twitter/bootstrap'
less_path = 'vendor/assets/stylesheets/twitter/bootstrap'
img_path = 'vendor/assets/images/twitter/bootstrap'
FileUtils.mkdir_p(js_path)
FileUtils.mkdir_p(less_path)
FileUtils.mkdir_p(img_path)
plugins.each do |plugin|
filename = "bootstrap-#{plugin}.js"
download("https://raw.github.com/twitter/bootstrap/master/js/#{filename}", "#{js_path}/#{filename}")
end
less.each do |l|
filename = "#{l}.less"
download("https://raw.github.com/twitter/bootstrap/master/less/#{filename}", "#{less_path}/#{filename}")
end
images.each do |image|
filename = "#{image}.png"
download("https://github.com/twitter/bootstrap/raw/master/img/#{filename}", "#{img_path}/#{filename}")
end
end
|