CoveredSourceCoveredSkip

class Skip

Excludes coverage for paths matching a pattern.

Definitions

def initialize(output, pattern)

Initialize a skip filter for the given pattern.

Signature

parameter output Covered::Base

The output to wrap.

parameter pattern Regexp

The pattern to exclude.

Implementation

def initialize(output, pattern)
	super(output)
	
	@pattern = pattern
end

attr :pattern

Signature

attribute Regexp

The pattern to exclude.

def match?(path)

This is better as it doesn't allocate a MatchData instance which is essentially useless:

Implementation

def match? path
	!@pattern.match?(path)
end