Module: Guard::RSpectacle::Inspector

Defined in:
lib/guard/rspectacle/inspector.rb

Overview

The inspector verifies if the changed paths are valid for Guard::RSpectacle.

Class Method Summary collapse

Class Method Details

.clean(paths) ⇒ Array<String>

Clean the changed paths and return only valid RSpec specs.

Parameters:

  • paths (Array<String>)

    the changed paths

Returns:

  • (Array<String>)

    the valid spec files



16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/guard/rspectacle/inspector.rb', line 16

def clean(paths)
  paths.uniq!
  paths.compact!

  if paths.include?('spec')
    paths = ['spec']
  else
    paths = paths.select { |p| rspec_spec?(p) }
  end

  paths
end