2010-10-03 21:00:33 +00:00
|
|
|
module Guard
|
|
|
|
module Interactor
|
|
|
|
|
|
|
|
def self.init_signal_traps
|
|
|
|
# Run all (Ctrl-\)
|
|
|
|
Signal.trap('QUIT') do
|
|
|
|
::Guard.run do
|
2010-11-25 23:58:36 +00:00
|
|
|
::Guard.guards.each { |guard| ::Guard.supervised_task(guard, :run_all) }
|
2010-10-03 21:00:33 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
# Stop (Ctrl-C)
|
|
|
|
Signal.trap('INT') do
|
2010-11-30 20:15:03 +00:00
|
|
|
UI.info "Bye bye...", :reset => true
|
2010-10-03 21:00:33 +00:00
|
|
|
::Guard.listener.stop
|
2010-11-25 23:58:36 +00:00
|
|
|
::Guard.guards.each { |guard| ::Guard.supervised_task(guard, :stop) }
|
2010-10-27 13:18:00 +00:00
|
|
|
abort("\n")
|
2010-10-03 21:00:33 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
# Reload (Ctrl-Z)
|
|
|
|
Signal.trap('TSTP') do
|
|
|
|
::Guard.run do
|
2010-11-25 23:58:36 +00:00
|
|
|
::Guard.guards.each { |guard| ::Guard.supervised_task(guard, :reload) }
|
2010-10-03 21:00:33 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|