Class: Guard::FastSpec::Inspector
- Inherits:
-
Object
- Object
- Guard::FastSpec::Inspector
- Defined in:
- lib/guard/fast_spec/inspector.rb
Instance Method Summary collapse
- #clean(paths) ⇒ Object
- #excluded ⇒ Object
- #excluded=(pattern) ⇒ Object
-
#initialize(options = {}) ⇒ Inspector
constructor
A new instance of Inspector.
- #spec_paths ⇒ Object
- #spec_paths=(paths) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Inspector
Returns a new instance of Inspector.
5 6 7 8 |
# File 'lib/guard/fast_spec/inspector.rb', line 5 def initialize( = {}) self.excluded = [:exclude] self.spec_paths = [:spec_paths] end |
Instance Method Details
#clean(paths) ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/guard/fast_spec/inspector.rb', line 26 def clean(paths) paths.uniq! paths.compact! clear_spec_files_list_after do paths = paths.select { |path| should_run_spec_file?(path) } end paths.reject { |p| included_in_other_path?(p, paths) } end |
#excluded ⇒ Object
10 11 12 |
# File 'lib/guard/fast_spec/inspector.rb', line 10 def excluded @excluded || [] end |
#excluded=(pattern) ⇒ Object
14 15 16 |
# File 'lib/guard/fast_spec/inspector.rb', line 14 def excluded=(pattern) @excluded = Dir[pattern.to_s] end |
#spec_paths ⇒ Object
18 19 20 |
# File 'lib/guard/fast_spec/inspector.rb', line 18 def spec_paths @spec_paths || [] end |
#spec_paths=(paths) ⇒ Object
22 23 24 |
# File 'lib/guard/fast_spec/inspector.rb', line 22 def spec_paths=(paths) @spec_paths = Array(paths) end |