Class: SimpleCov::RegexFilter

Inherits:
Filter
  • Object
show all
Defined in:
lib/simplecov/filter.rb,
sig/simplecov.rbs

Instance Attribute Summary

Attributes inherited from Filter

#filter_argument

Instance Method Summary collapse

Methods inherited from Filter

build_filter, class_for_argument, #initialize

Constructor Details

This class inherits a constructor from SimpleCov::Filter

Instance Method Details

#matches?(source_file) ⇒ Boolean

Regexp#match? rather than =~ so the predicate returns a real boolean: =~ would return the match position, which trips rspec-mocks 4's stricter predicate-matcher type check.

Parameters:

Returns:

  • (Boolean)


103
104
105
# File 'lib/simplecov/filter.rb', line 103

def matches?(source_file)
  filter_argument.match?(source_file.project_filename)
end

#path_only?Boolean

Returns:

  • (Boolean)


107
108
109
# File 'lib/simplecov/filter.rb', line 107

def path_only?
  true
end