Class: Covered::Skip
Overview
Excludes coverage for paths matching a pattern.
Instance Attribute Summary collapse
-
#pattern ⇒ Object
readonly
Returns the value of attribute pattern.
Attributes inherited from Wrapper
Instance Method Summary collapse
-
#initialize(output, pattern) ⇒ Skip
constructor
Initialize a skip filter for the given pattern.
-
#match?(path) ⇒ Boolean
This is better as it doesn’t allocate a MatchData instance which is essentially useless:.
- #The pattern to exclude.=(patterntoexclude. = (value)) ⇒ Object
Methods inherited from Filter
Methods inherited from Wrapper
#accept?, #add, #clear, #each, #expand_path, #finish, #mark, #relative_path, #start, #to_h
Methods inherited from Base
#accept?, #add, #clear, #each, #expand_path, #finish, #mark, #relative_path, #start
Constructor Details
#initialize(output, pattern) ⇒ Skip
Initialize a skip filter for the given pattern.
133 134 135 136 137 |
# File 'lib/covered/files.rb', line 133 def initialize(output, pattern) super(output) @pattern = pattern end |
Instance Attribute Details
#pattern ⇒ Object (readonly)
Returns the value of attribute pattern.
140 141 142 |
# File 'lib/covered/files.rb', line 140 def pattern @pattern end |
Instance Method Details
#match?(path) ⇒ Boolean
This is better as it doesn’t allocate a MatchData instance which is essentially useless:
144 145 146 |
# File 'lib/covered/files.rb', line 144 def match? path !@pattern.match?(path) end |
#The pattern to exclude.=(patterntoexclude. = (value)) ⇒ Object
140 |
# File 'lib/covered/files.rb', line 140 attr :pattern |