Skip to content

Instantly share code, notes, and snippets.

@jacquescrocker
Created April 16, 2010 04:04
Show Gist options
  • Save jacquescrocker/367989 to your computer and use it in GitHub Desktop.
Save jacquescrocker/367989 to your computer and use it in GitHub Desktop.
use this with webby (in your Sitefile). Replaces `webby autobuild`
# add this to your Sitefile
desc "an autobuild that doesnt suck"
task :watchr => [:rebuild] do
watch_script = %%
def rebuild
puts system("webby rebuild")
puts "DONE REBUILDING!"
end
watch("lib/") { rebuild }
watch("content/") { rebuild }
watch("layouts/") { rebuild }
watch("templates/") { rebuild }
%
File.open(".autowatchr", 'w') {|f| f.write(watch_script) }
require "rubygems"
require "watchr"
puts "Setting up Watchr..."
Watchr::Controller.new(Watchr::Script.new(Pathname.new('.autowatchr')), Watchr.handler.new).run
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment