Skip to content

Instantly share code, notes, and snippets.

@imathis
Created May 2, 2010 18:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save imathis/387354 to your computer and use it in GitHub Desktop.
Save imathis/387354 to your computer and use it in GitHub Desktop.
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