[Docs] rake watch now rebuilds stylesheets independently from docs content so doc styling is faster

This commit is contained in:
B Mathis 2010-05-02 14:08:58 -05:00 committed by Chris Eppstein
parent 46b7343b80
commit 6bbbb94bfa

View File

@ -24,23 +24,28 @@ task :watch do
end
rebuild_site = lambda do |base, relative|
if relative
puts ">>> Change Detected to #{relative} <<<"
if relative && relative =~ /\.s[ac]ss/
puts ">>> Change Detected to #{relative} : updating stylsheets <<<"
system "bundle exec compass compile"
else
puts ">>> Compiling <<<"
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`
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
rebuild_site.call(nil,nil)