2010-11-27 21:00:43 -05:00
|
|
|
require "bundler/setup"
|
2009-02-14 14:15:07 -05:00
|
|
|
|
2010-11-27 21:00:43 -05:00
|
|
|
task :default => :watch
|
2008-07-18 20:37:24 -04:00
|
|
|
|
2011-09-23 17:03:13 -04:00
|
|
|
desc "Publish \"marketing\" docs"
|
2008-07-18 11:34:06 -04:00
|
|
|
task :publish do
|
2009-02-14 14:15:07 -05:00
|
|
|
sh("git rebase master gh-pages")
|
|
|
|
sh("git checkout master")
|
2010-06-21 15:13:59 -04:00
|
|
|
sh("git push origin master")
|
|
|
|
sh("git push origin gh-pages")
|
2009-02-14 14:15:07 -05:00
|
|
|
sh("git push --tags")
|
2008-07-18 11:34:06 -04:00
|
|
|
end
|
2008-07-18 20:37:24 -04:00
|
|
|
|
2010-11-27 21:00:43 -05:00
|
|
|
desc "Build everything"
|
|
|
|
task :build do
|
|
|
|
rebuild_coffee
|
|
|
|
end
|
|
|
|
|
|
|
|
desc "Watch for changes and test the site"
|
|
|
|
task :watch => :build do
|
|
|
|
sh("open test/index.html")
|
|
|
|
monitor
|
|
|
|
end
|
|
|
|
|
|
|
|
desc "Open your default browser with the test page"
|
2008-07-18 20:37:24 -04:00
|
|
|
task :test do
|
2009-07-30 13:31:38 -04:00
|
|
|
sh("open test/index.html")
|
2008-07-18 20:37:24 -04:00
|
|
|
end
|
2010-11-27 21:00:43 -05:00
|
|
|
|
|
|
|
def rebuild_coffee(base = nil, relative = "**/*.coffee")
|
|
|
|
sh("coffee -c #{relative}")
|
|
|
|
end
|
|
|
|
|
|
|
|
def monitor
|
|
|
|
require "fssm"
|
|
|
|
puts ">>> Monitoring for changes. Press Ctrl-C to Stop."
|
|
|
|
FSSM.monitor do
|
|
|
|
path "." do
|
|
|
|
glob "**/*.coffee"
|
|
|
|
update &method(:rebuild_coffee)
|
|
|
|
delete &method(:rebuild_coffee)
|
|
|
|
create &method(:rebuild_coffee)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|