27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
# File 'lib/less/command.rb', line 27
def run!
if watch?
parse(true) unless File.exist? @destination
log "Watching for changes in #@source... Ctrl-C to abort.\n: "
loop do
watch { sleep 1 }
if File.stat( @source ).mtime > File.stat( @destination ).mtime
print Time.now.strftime("%H:%M:%S -- ") if @options[:timestamps]
print "Change detected... "
until parse
log "Press [return] to continue..."
watch { $stdin.gets }
end
end
end
else
parse
end
end
|