-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathrakefile
65 lines (57 loc) · 2.8 KB
/
rakefile
1
2
3
4
5
6
7
8
9
10
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
require 'rake/clean'
desc "run vows tests and coffeelint"
task :test => [:coffeelint]
task :default => :test
desc "run coffeelint"
task :coffeelint do
sh "find assets app -name '*.coffee' | xargs node_modules/.bin/coffeelint -f etc/coffeelint.json"
end
fixme_command = "grep -ri --after-context=5 fixme assets app"
desc fixme_command
task :fixme do
sh fixme_command
end
desc 'start the server'
task :start do
sh "./node_modules/.bin/coffee server.coffee"
end
desc 'start the server in production mode'
task "start:production" do
sh "export NODE_ENV=production; ./node_modules/.bin/coffee server.coffee"
end
desc 'git checkout documents'
task "checkout:documents" do
sh "git checkout documents"
end
desc 'generate static site from app running locally on port 7777; run rake start:production first'
# see
# http://www.noah.org/wiki/Offline_mirror_with_wget
# http://news.ycombinator.com/item?id=3196103
task "statify" do
sh "wget --mirror --page-requisites --no-host-directories --directory-prefix=static --convert-links localhost:7777"
end
desc 'update 3p'
task :update3p do
sh "curl -o assets/js/3p/underscore.js 'https://raw.github.com/documentcloud/underscore/master/underscore.js'"
sh "curl -o assets/js/3p/state-machine.js 'https://raw.github.com/jakesgordon/javascript-state-machine/master/state-machine.js'"
sh "curl -o assets/js/3p/raphael.js 'https://raw.github.com/DmitryBaranovskiy/raphael/master/raphael.js'"
sh "curl -o assets/js/3p/audiolet.js 'https://raw.github.com/oampo/Audiolet/master/src/audiolet/Audiolet.js'"
sh "curl -o assets/js/3p/backbone.js 'http://documentcloud.github.com/backbone/backbone.js'"
sh "curl -o assets/js/3p/jquery.js 'http://code.jquery.com/jquery-1.7.1.js'"
sh "curl -o assets/js/3p/coffee-script.js 'https://raw.github.com/jashkenas/coffee-script/master/extras/coffee-script.js'"
sh "curl -o assets/js/3p/jasmine.js 'https://raw.github.com/pivotal/jasmine/master/lib/jasmine-core/jasmine.js'"
sh "curl -o assets/js/3p/jasmine-html.js 'https://raw.github.com/pivotal/jasmine/master/lib/jasmine-core/jasmine-html.js'"
sh "curl -o assets/css/3p/jasmine.css 'https://raw.github.com/pivotal/jasmine/master/lib/jasmine-core/jasmine.css'"
# get bootstrap
# FIXME: clean up
sh "mkdir -p 'tmp_bootstrap'"
sh "curl -o tmp_bootstrap/bootstrap.zip 'http://twitter.github.com/bootstrap/assets/bootstrap.zip'"
sh "unzip -d tmp_bootstrap tmp_bootstrap/bootstrap.zip"
sh "cp tmp_bootstrap/bootstrap/css/*min*.css assets/css/3p/"
sh "cp tmp_bootstrap/bootstrap/js/*min*.js assets/js/3p/"
sh "cp tmp_bootstrap/bootstrap/img/* public/img"
#FIXME: Include images
sh "rm -r tmp_bootstrap"
# strip 'min' out of all names
sh "bash -c 'for file in `find assets -name \'*.min.*\'`; do mv $file ${file/\.min\./\.}; done;\'"
end