Class: Recot::Commands::GuardServer
- Inherits:
-
Object
- Object
- Recot::Commands::GuardServer
- Defined in:
- lib/recot/commands/guard_server.rb
Instance Method Summary collapse
-
#initialize ⇒ GuardServer
constructor
A new instance of GuardServer.
- #run ⇒ Object
- #start_guard ⇒ Object
Constructor Details
#initialize ⇒ GuardServer
8 9 10 11 12 13 14 |
# File 'lib/recot/commands/guard_server.rb', line 8 def initialize path = File.('../../../../', __FILE__) @guardfile = "#{path}/Guardfile" # setup guard ui options Guard::UI.[:level] = :error Guard::UI.[:template] = "guard error!! > :message" end |
Instance Method Details
#run ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/recot/commands/guard_server.rb', line 16 def run @thread = start_guard Thread.new do loop do sleep 1 @thread.wakeup end end end |
#start_guard ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/recot/commands/guard_server.rb', line 26 def start_guard Thread.new do Guard.start( guardfile: @guardfile, no_interactions: true) end end |