Module: Guard::Jasmine::Inspector
- Defined in:
- lib/guard/jasmine/inspector.rb
Overview
The inspector verifies if the changed paths are valid for Guard::Jasmine. Please note that request to Inspector.clean paths keeps the current valid files cached until clear is called.
Class Method Summary (collapse)
-
+ (Array<String>) clean(paths, options)
Clean the changed paths and return only valid Jasmine specs in either JavaScript or CoffeeScript.
-
+ (Boolean) jasmine_spec?(path)
private
Tests if the file is valid.
Class Method Details
+ (Array<String>) clean(paths, options)
Clean the changed paths and return only valid Jasmine specs in either JavaScript or CoffeeScript.
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/guard/jasmine/inspector.rb', line 20 def clean(paths, ) paths.uniq! paths.compact! if paths.include?([:spec_dir]) paths = [[:spec_dir]] else paths = paths.select { |p| jasmine_spec?(p) } end paths end |
+ (Boolean) jasmine_spec?(path) (private)
Tests if the file is valid.
40 41 42 |
# File 'lib/guard/jasmine/inspector.rb', line 40 def jasmine_spec?(path) path =~ /_spec\.(js|coffee|js\.coffee)$/ && File.exists?(path) end |