Class: Guard::FastSpec::Inspector

Inherits:
Object
  • Object
show all
Defined in:
lib/guard/fast_spec/inspector.rb

Instance Method Summary collapse

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(options = {})
  self.excluded   = options[:exclude]
  self.spec_paths = options[: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

#excludedObject



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_pathsObject



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