Sha256: ae61f52437cd15f1facb011b0b7999e64251d2f8edad64cfb756270e92e54cf6
Contents?: true
Size: 1.25 KB
Versions: 1
Compression:
Stored size: 1.25 KB
Contents
#!/usr/bin/env rake require "bundler/gem_tasks" desc "Update Twitter's Bootstrap" task "update-twitter" do boostrap_version = "1.4.0" Dir["vendor/assets/stylesheets/*.*"].each {|f| FileUtils.rm(f)} Dir["vendor/twitter/lib/*.scss"].each do |file| cp file, "vendor/assets/stylesheets/", :verbose => true end bootstrap_scss = File.read("vendor/assets/stylesheets/bootstrap.scss") bootstrap_scss.gsub!(/@VERSION/, "v#{boostrap_version}") bootstrap_scss.gsub!(/^.*@DATE.*/, " *") File.open("vendor/assets/stylesheets/bootstrap.scss", "w") do |f| f.write(bootstrap_scss) end Dir["vendor/assets/javascripts/*.*"].each {|f| FileUtils.rm(f)} js_files = Dir["vendor/twitter/js/*.js"].map() js_files.each do |file| cp file, "vendor/assets/javascripts/", :verbose => true end js_priorities = {} js_files.each {|f| js_priorities[File.basename(f)] = 0} # popover depend on twipsy js_priorities["bootstrap-twipsy.js"] = 1 js_priorities["bootstrap-popover.js"] = 2 js_list = js_priorities.to_a.sort {|a,b| a[1] <=> b[1]}.map{|p| p[0]} File.open("vendor/assets/javascripts/bootstrap.js", "w") do |f| f.write "// Bootstrap v#{boostrap_version}\n" js_list.each do |js| f.write "//= require #{js}\n" end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
anjlab-bootstrap-rails-1.4.0.1 | Rakefile |