Class: SimpleCov::ArrayFilter

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

Instance Attribute Summary

Attributes inherited from Filter

#filter_argument

Instance Method Summary collapse

Methods inherited from Filter

#initialize, #passes?

Constructor Details

This class inherits a constructor from SimpleCov::Filter

Instance Method Details

#matches?(source_files_list) ⇒ Boolean

Returns true if any of the file paths passed in the given array matches the string configured when initializing this Filter with StringFilter.new([‘some/path’, ‘other/path’])

Returns:

  • (Boolean)


48
49
50
51
52
# File 'lib/simplecov/filter.rb', line 48

def matches?(source_files_list)
  filter_argument.any? do |arg|
    source_files_list.filename =~ /#{arg}/
  end
end