Class: Guard::Test::Inspectors::FocusedInspector
- Inherits:
-
BaseInspector
- Object
- BaseInspector
- Guard::Test::Inspectors::FocusedInspector
- Defined in:
- lib/guard/test/inspectors/focused_inspector.rb
Overview
Inspector that focuses on set of paths if any of them is failing. Returns only that set of paths on all future calls to #paths until they all pass
Instance Attribute Summary
Attributes inherited from BaseInspector
Instance Method Summary collapse
- #failed(locations) ⇒ Object
-
#initialize(options = {}) ⇒ FocusedInspector
constructor
A new instance of FocusedInspector.
- #paths(paths) ⇒ Object
- #reload ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ FocusedInspector
Returns a new instance of FocusedInspector.
11 12 13 14 |
# File 'lib/guard/test/inspectors/focused_inspector.rb', line 11 def initialize( = {}) super @focused_locations = [] end |
Instance Method Details
#failed(locations) ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/guard/test/inspectors/focused_inspector.rb', line 24 def failed(locations) if locations.empty? @focused_locations = [] else @focused_locations = locations if @focused_locations.empty? end end |
#paths(paths) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/guard/test/inspectors/focused_inspector.rb', line 16 def paths(paths) if @focused_locations.any? @focused_locations else _clean(paths) end end |
#reload ⇒ Object
32 33 34 |
# File 'lib/guard/test/inspectors/focused_inspector.rb', line 32 def reload @focused_locations = [] end |