Class: Guard::ZeusClient
- Defined in:
- lib/guard/zeus-client.rb,
lib/guard/zeus-client/runner.rb
Defined Under Namespace
Classes: Runner
Instance Attribute Summary collapse
-
#runner ⇒ Object
Returns the value of attribute runner.
Instance Method Summary collapse
-
#initialize(watchers = [], options = {}) ⇒ ZeusClient
constructor
Initialize a Guard.
-
#run_all ⇒ Object
Called when just ‘enter` is pressed This method should be principally used for long action like running all specs/tests/…
-
#run_on_changes(paths) ⇒ Object
Called on file(s) modifications that the Guard watches.
-
#start ⇒ Object
Call once when Guard starts.
Constructor Details
#initialize(watchers = [], options = {}) ⇒ ZeusClient
Initialize a Guard.
13 14 15 16 17 18 19 20 21 |
# File 'lib/guard/zeus-client.rb', line 13 def initialize(watchers = [], = {}) super @options = { :all_on_start => true }.merge() @runner = Runner.new(@options) end |
Instance Attribute Details
#runner ⇒ Object
Returns the value of attribute runner.
8 9 10 |
# File 'lib/guard/zeus-client.rb', line 8 def runner @runner end |
Instance Method Details
#run_all ⇒ Object
Called when just ‘enter` is pressed This method should be principally used for long action like running all specs/tests/…
33 34 35 36 37 |
# File 'lib/guard/zeus-client.rb', line 33 def run_all unless runner.run_all throw :task_has_failed end end |
#run_on_changes(paths) ⇒ Object
Called on file(s) modifications that the Guard watches.
42 43 44 45 46 |
# File 'lib/guard/zeus-client.rb', line 42 def run_on_changes(paths) unless runner.run(paths) throw :task_has_failed end end |
#start ⇒ Object
Call once when Guard starts. Please override initialize method to init stuff.
25 26 27 28 |
# File 'lib/guard/zeus-client.rb', line 25 def start UI.info 'Guard::ZeusClient is running' run_all if @options[:all_on_start] end |