Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 70 lines (54 sloc) 2.213 kb
7e67b67 @yury Initial Gem structure
yury authored
1 #!/usr/bin/env rake
5cc7c59 @yury Add 'update-twitter' rake task
yury authored
2 require "bundler/gem_tasks"
3
bc1db7f @yury Add twitter:pull and twitter:update rake tasks
yury authored
4 namespace :twitter do
203dbc8 @yury Switch assets to Twitter Boostrap 2.0
yury authored
5
53929b0 @yury Update readme
yury authored
6 desc "Pulls Twitter's Bootstrap Scss"
bc1db7f @yury Add twitter:pull and twitter:update rake tasks
yury authored
7 task :pull do
8 if !system "git pull -s subtree twitter twb2"
9 abort "Have to add twitter scss remote `git remote add -f twitter git@github.com:yury/bootstrap.git`"
10 end
203dbc8 @yury Switch assets to Twitter Boostrap 2.0
yury authored
11 end
12
5cc7c59 @yury Add 'update-twitter' rake task
yury authored
13
0a66599 @yury Namespace assets. Closes #23
yury authored
14 TW_IMGS = FileList["vendor/twitter/img/*.*"]
15 ASSETS_IMGS = TW_IMGS.pathmap("vendor/assets/images/twitter/%f")
16 ASSETS_IMGS.zip(TW_IMGS).each do |target, source|
17 file target => [source] { cp source, target, verbose: true }
18 end
bc1db7f @yury Add twitter:pull and twitter:update rake tasks
yury authored
19
0a66599 @yury Namespace assets. Closes #23
yury authored
20 TW_JS = FileList["vendor/twitter/js/*.*"]
21 ASSETS_JS = TW_JS.pathmap("vendor/assets/javascripts/twitter/bootstrap/%{bootstrap-,}f")
22 ASSETS_JS.zip(TW_JS).each do |target, source|
23 file target => [source] { cp source, target, verbose: true }
24 end
5cc7c59 @yury Add 'update-twitter' rake task
yury authored
25
0a66599 @yury Namespace assets. Closes #23
yury authored
26 TW_SCSS = FileList["vendor/twitter/scss/*.*"]
27 ASSETS_SCSS = TW_SCSS.pathmap("vendor/frameworks/twitter/bootstrap/%f")
28 ASSETS_SCSS.zip(TW_SCSS).each do |target, source|
29 file target => [source] { cp source, target, verbose: true }
30 end
d98c584 @yury popover.js depend on twipsy.js
yury authored
31
0a66599 @yury Namespace assets. Closes #23
yury authored
32 desc "Update Twitter's Bootstrap Images"
33 task :imgs => ASSETS_IMGS
34
35 desc "Update Twitter's Bootstrap JS"
36 task :js => ASSETS_JS do
37 js = {}
38 ASSETS_JS.pathmap("%f").each do |f|
39 js[f] = 1
40 end
bc1db7f @yury Add twitter:pull and twitter:update rake tasks
yury authored
41
42 # dependencies
0a66599 @yury Namespace assets. Closes #23
yury authored
43 js["transition.js"] = 0
44 js["tooltip.js"] = 2
45 js["popover.js"] = 3
bc1db7f @yury Add twitter:pull and twitter:update rake tasks
yury authored
46
0a66599 @yury Namespace assets. Closes #23
yury authored
47 list = js.to_a.sort {|a,b| a[1] <=> b[1]}.map{|p| p[0]}
fd484ad @yury Fix for namespaced requires
yury authored
48 File.write "vendor/assets/javascripts/twitter/bootstrap.js", list.map {|f| "//= require twitter/bootstrap/#{f}"}.join("\n")
5cc7c59 @yury Add 'update-twitter' rake task
yury authored
49 end
0a66599 @yury Namespace assets. Closes #23
yury authored
50
51 desc "Update Twitter's Bootstrap SCSS"
52 task :scss => ASSETS_SCSS do
53 File.write "vendor/frameworks/twitter/bootstrap.scss", '@import "bootstrap/bootstrap.scss";'
54 File.write "vendor/assets/stylesheets/twitter/bootstrap.scss", '@import "twitter/bootstrap/bootstrap.scss";'
55 File.write "vendor/assets/stylesheets/twitter/bootstrap-responsive.scss", '@import "twitter/bootstrap/responsive.scss";'
56 end
57
58 desc "Update Twitter's Bootstrap Assets"
59 task :assets => [:pull, :imgs, :scss, :js]
bc1db7f @yury Add twitter:pull and twitter:update rake tasks
yury authored
60
bc28d59 @bgarret Add tests for ie_hex_str
bgarret authored
61 end
62
63 require 'rake/testtask'
64
65 Rake::TestTask.new do |t|
66 t.libs << "test"
67 t.test_files = FileList['test/*_test.rb']
68 t.verbose = true
69 end
Something went wrong with that request. Please try again.