class LuneCLI::FileWatcher

Defined in:

lune_cli/file_watcher.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(poll_interval : Time::Span = 500.milliseconds, debounce : Time::Span = 200.milliseconds) #

[View source]

Instance Method Detail

def changed?(before : Hash(String, Time), after : Hash(String, Time)) : Bool #

[View source]
def collect_mtimes(dir : String) : Hash(String, Time) #

[View source]
def debounce : Time::Span #

[View source]
def poll_interval : Time::Span #

[View source]
def wait_for_change(src_dir : String) : Nil #

[View source]
def watch(process : Process, src_dir : String) : Bool #

Blocks until a .cr file in src_dir changes or the process exits. Returns true if a change was detected (caller should restart), false if the process exited on its own.


[View source]