Created
May 2, 2010 18:56
-
-
Save imathis/387354 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rebuild_site = lambda do |base, relative| | |
if relative && relative =~ /\.s[ac]ss/ | |
puts ">>> Change Detected to #{relative} : updating stylsheets <<<" | |
system "compass" | |
else | |
if !relative | |
puts ">>> Compiling <<<" | |
else | |
puts ">>> Change Detected to #{relative} <<<" | |
end | |
start = Time.now | |
# Nanoc3::CLI::Base.new.run(["co"]) | |
site = Nanoc3::Site.new('.') | |
site.load_data | |
begin | |
site.compiler.run | |
puts ">>> Done in #{((Time.now - start)*10000).round.to_f / 10}ms <<<" | |
`growlnotify -m "Compilation Complete" --image misc/success-icon.png; exit 0` | |
rescue Exception => e | |
puts ">>> ERROR: #{e.message} <<<" | |
puts e.backtrace.join("\n") | |
`growlnotify -m "Compilation Error!" --image misc/error-icon.png; exit 0` | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment