From ad6fe6f69ba204b587dada6600441c7c6876a0ee Mon Sep 17 00:00:00 2001 From: Michael Kessler Date: Tue, 20 Sep 2011 13:10:16 +0200 Subject: [PATCH] Yardoc for the interactor. --- lib/guard/interactor.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lib/guard/interactor.rb b/lib/guard/interactor.rb index 5c5fd09..1ef94ca 100644 --- a/lib/guard/interactor.rb +++ b/lib/guard/interactor.rb @@ -1,14 +1,29 @@ module Guard + + # The interactor reads user input and triggers + # specific action upon them unless its locked. + # + # Currently the following actions are implemented: + # - stop, quit, exit, s, q, e => Exit Guard + # - reload, r, z => Reload Guard + # - pause, p => Pause Guard + # - Everything else => Run all + # class Interactor attr_reader :locked + # Initialize the interactor in unlocked state. + # def initialize @locked = false end + # Start the interactor in a own thread. + # def start return if ENV["GUARD_ENV"] == 'test' + Thread.new do loop do if (entry = $stdin.gets) && !@locked @@ -28,10 +43,14 @@ module Guard end end + # Lock the interactor. + # def lock @locked = true end + # Unlock the interactor. + # def unlock @locked = false end