Class: Guard::Jobs::Sleep
- Inherits:
-
Base
- Object
- Base
- Guard::Jobs::Sleep
show all
- Defined in:
- lib/guard/jobs/sleep.rb
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Instance Method Details
#background ⇒ Object
17
18
19
|
# File 'lib/guard/jobs/sleep.rb', line 17
def background
Thread.main.wakeup
end
|
#foreground ⇒ Object
7
8
9
10
11
12
13
14
15
|
# File 'lib/guard/jobs/sleep.rb', line 7
def foreground
UI.debug "Guards jobs done. Sleeping..."
sleep
UI.debug "Sleep interrupted by events."
:stopped
rescue Interrupt
UI.debug "Sleep interrupted by user."
:exit
end
|
#handle_interrupt ⇒ Object
21
22
23
|
# File 'lib/guard/jobs/sleep.rb', line 21
def handle_interrupt
Thread.main.raise Interrupt
end
|