Class: SimpleCov::StringFilter
- Inherits:
-
Filter
- Object
- Filter
- SimpleCov::StringFilter
- Defined in:
- lib/simplecov/filter.rb
Overview
Filter that matches when the source file's project path contains the configured string at a path-segment boundary.
Instance Method Summary collapse
-
#matches?(source_file) ⇒ Boolean
Returns true when the given source file's filename matches the string configured when initializing this Filter with StringFilter.new('somestring').
Instance Method Details
#matches?(source_file) ⇒ Boolean
Returns true when the given source file's filename matches the string configured when initializing this Filter with StringFilter.new('somestring'). Matching is path-segment-aware: the argument must appear immediately after a "/" and be followed by "/" or end-of-string, so "lib" matches "/lib/foo.rb" but not "/app/models/library.rb".
56 57 58 |
# File 'lib/simplecov/filter.rb', line 56 def matches?(source_file) source_file.project_filename.match?(segment_pattern) end |