Sha256: 1f6c3fc1d17409a42ce2580773178a965bfd33a7488644c698081bad29e16a54

Contents?: true

Size: 1.18 KB

Versions: 10

Compression:

Stored size: 1.18 KB

Contents

#!/usr/bin/env rake
require "bundler/gem_tasks"

desc "Update Twitter's Bootstrap"
task "update-twitter" do

  Dir["vendor/twitter/img/*.*"].each do |file|
    cp file, "vendor/assets/images/", :verbose => true
  end

  Dir["vendor/assets/stylesheets/*.*"].each {|f| FileUtils.rm(f)}
  Dir["vendor/twitter/scss/*.scss"].each do |file|
    cp file, "vendor/assets/stylesheets/", :verbose => true
  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)] = 1}

  # dependencies
  js_priorities["bootstrap-transition.js"]  = 0
  js_priorities["bootstrap-tooltip.js"]     = 2
  js_priorities["bootstrap-popover.js"]     = 3
  
  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|
    js_list.each do |js|
      f.write "//= require #{js}\n"
    end
  end
end

require 'rake/testtask'

Rake::TestTask.new do |t|
  t.libs << "test"
  t.test_files = FileList['test/*_test.rb']
  t.verbose = true
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
anjlab-bootstrap-rails-2.0.2.1 Rakefile
anjlab-bootstrap-rails-2.0.2.0 Rakefile
cmaitchison-bootstrap-rails-2.0.1.1 Rakefile
anjlab-bootstrap-rails-2.0.1.1 Rakefile
anjlab-bootstrap-rails-2.0.1.0 Rakefile
anjlab-bootstrap-rails-2.0.0.5 Rakefile
anjlab-bootstrap-rails-2.0.0.4 Rakefile
anjlab-bootstrap-rails-2.0.0.3 Rakefile
anjlab-bootstrap-rails-2.0.0.2 Rakefile
anjlab-bootstrap-rails-2.0.0.1 Rakefile