module Guard
def setup(cmdline_options = {})
-
(Guard)
- the Guard singleton
Options Hash:
(**options)
-
guardfile
(String
) -- the path to the Guardfile -
watchdir
(Array
) -- the directories to watch -
group
(Array
) -- the list of groups to start -
debug
(Boolean
) -- if debug output should be shown -
notify
(Boolean
) -- if system notifications should be shown -
clear
(Boolean
) -- if auto clear the UI should be done
def setup(cmdline_options = {}) init(cmdline_options) @queue = Internals::Queue.new(Guard) _evaluate(state.session.evaluator_options) # NOTE: this should be *after* evaluate so :directories can work # TODO: move listener setup to session? @listener = Listen.send(*state.session.listener_args, &_listener_callback) ignores = state.session.guardfile_ignore @listener.ignore(ignores) unless ignores.empty? ignores = state.session.guardfile_ignore_bang @listener.ignore!(ignores) unless ignores.empty? Notifier.connect(state.session.notify_options) traps = Internals::Traps traps.handle("USR1") { async_queue_add([:guard_pause, :paused]) } traps.handle("USR2") { async_queue_add([:guard_pause, :unpaused]) } @interactor = Interactor.new(state.session.interactor_name == :sleep) traps.handle("INT") { @interactor.handle_interrupt } self end