1
0
Fork 0
mirror of https://github.com/twbs/bootstrap-sass.git synced 2022-11-09 12:27:02 -05:00
twbs--bootstrap-sass/tasks/converter/js_conversion.rb
Gleb Mazovetskiy f076f64a4a Minor refactorings and rake less_to_scss
less_to_scss:

    $ echo '.p { #gradient > .horizontal(red,blue) }' | rake less_to_scss[master]
    .p { @include gradient-horizontal(red,blue) }
2013-12-20 23:20:01 +01:00

39 lines
1 KiB
Ruby

class Converter
module JsConversion
def process_javascript_assets
log_status 'Processing javascripts...'
save_to = @save_to[:js]
read_files('js', bootstrap_js_files).each do |name, file|
save_file("#{save_to}/#{name}", file)
end
log_processed "#{bootstrap_js_files * ' '}"
log_status 'Updating javascript manifest'
content = ''
bootstrap_js_files.each do |name|
name = name.gsub(/\.js$/, '')
content << "//= require bootstrap/#{name}\n"
end
path = 'vendor/assets/javascripts/bootstrap.js'
save_file(path, content)
log_processed path
end
def bootstrap_js_files
@bootstrap_js_files ||= begin
files = get_paths_by_type 'js', /\.js$/
files.sort_by { |f|
case f
# tooltip depends on popover and must be loaded earlier
when /tooltip/ then
1
when /popover/ then
2
else
0
end
}
end
end
end
end