Class: Covered::Skip

Inherits:
Filter show all
Defined in:
lib/covered/files.rb

Instance Attribute Summary collapse

Attributes inherited from Wrapper

#output

Instance Method Summary collapse

Methods inherited from Filter

#each, #mark

Methods inherited from Wrapper

#disable, #each, #enable, #expand_path, #mark, #relative_path, #to_h

Constructor Details

#initialize(output, pattern, base = "") ⇒ Skip

Returns a new instance of Skip.



112
113
114
115
116
117
# File 'lib/covered/files.rb', line 112

def initialize(output, pattern, base = "")
	super(output)
	
	@pattern = pattern
	@base = self.expand_path(base)
end

Instance Attribute Details

#patternObject (readonly)

Returns the value of attribute pattern.



119
120
121
# File 'lib/covered/files.rb', line 119

def pattern
  @pattern
end

Instance Method Details

#accept?(path) ⇒ Boolean

Returns:

  • (Boolean)


121
122
123
124
125
126
127
# File 'lib/covered/files.rb', line 121

def accept? path
	if @base
		path = relative_path(path)
	end
	
	!(@pattern === path)
end