Flush stdout buffer to make sure the stdout message show up correctly.

This commit is contained in:
Jannis Leidel 2012-01-16 19:27:27 +01:00 committed by Chris Eppstein
parent e3d50c19e5
commit ff51850b90

View File

@ -81,6 +81,7 @@ module Compass
action = FSSM::Backends::Default.to_s == "FSSM::Backends::Polling" ? "polling" : "watching" action = FSSM::Backends::Default.to_s == "FSSM::Backends::Polling" ? "polling" : "watching"
puts ">>> Compass is #{action} for changes. Press Ctrl-C to Stop." puts ">>> Compass is #{action} for changes. Press Ctrl-C to Stop."
$stdout.flush
begin begin
FSSM.monitor do |monitor| FSSM.monitor do |monitor|
@ -100,14 +101,17 @@ module Compass
path.glob glob path.glob glob
path.update do |base, relative| path.update do |base, relative|
puts ">>> Change detected to: #{relative}" puts ">>> Change detected to: #{relative}"
$stdout.flush
callback.call(base, relative) callback.call(base, relative)
end end
path.create do |base, relative| path.create do |base, relative|
puts ">>> New file detected: #{relative}" puts ">>> New file detected: #{relative}"
$stdout.flush
callback.call(base, relative) callback.call(base, relative)
end end
path.delete do |base, relative| path.delete do |base, relative|
puts ">>> File Removed: #{relative}" puts ">>> File Removed: #{relative}"
$stdout.flush
callback.call(base, relative) callback.call(base, relative)
end end
end end
@ -139,6 +143,7 @@ module Compass
if file = compiler.out_of_date? if file = compiler.out_of_date?
begin begin
puts ">>> Change detected to: #{relative || compiler.relative_stylesheet_name(file)}" puts ">>> Change detected to: #{relative || compiler.relative_stylesheet_name(file)}"
$stdout.flush
compiler.run compiler.run
GC.start GC.start
rescue StandardError => e rescue StandardError => e