Module: Guard::CoffeeScript::Inspector

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

Overview

The inspector verifies of the changed paths are valid for Guard::CoffeeScript.

Class Method Summary (collapse)

Class Method Details

+ (Array<String>) clean(paths, options = {})

Clean the changed paths and return only valid CoffeeScript files.

Options Hash (options):

  • :missing_ok (String)

    don't remove missing files from list



18
19
20
21
22
# File 'lib/guard/coffeescript/inspector.rb', line 18

def clean(paths, options = {})
  paths.uniq!
  paths.compact!
  paths.select { |p| coffee_file?(p, options) }
end

+ (Boolean) coffee_file?(path, options) (private)

Tests if the file is valid.

Options Hash (options):

  • :missing_ok (String)

    don't remove missing files from list



33
34
35
# File 'lib/guard/coffeescript/inspector.rb', line 33

def coffee_file?(path, options)
  path =~ /\.(?:coffee|coffee\.md|litcoffee)$/ && (options[:missing_ok] || File.exists?(path))
end