Class: Covered::Wrapper
Overview
Wraps another coverage output.
Instance Attribute Summary collapse
-
#output ⇒ Object
readonly
Returns the value of attribute output.
- #The wrapped output.(wrappedoutput.) ⇒ Object readonly
Instance Method Summary collapse
-
#accept?(path) ⇒ Boolean
Whether the wrapped output accepts the given path.
-
#add(coverage) ⇒ Object
Add coverage to the wrapped output.
-
#clear ⇒ Object
Clear coverage on the wrapped output.
- #each {|Coverage| ... } ⇒ Object
-
#expand_path(path) ⇒ Object
Expand a path using the wrapped output.
-
#finish ⇒ Object
Finish tracking coverage on the wrapped output.
-
#initialize(output = Base.new) ⇒ Wrapper
constructor
Initialize the wrapper with the given output.
-
#mark(path, lineno, value) ⇒ Object
Mark coverage on the wrapped output.
-
#relative_path(path) ⇒ Object
Convert a path using the wrapped output.
-
#start ⇒ Object
Start tracking coverage on the wrapped output.
-
#to_h ⇒ Object
Convert all coverage data to a hash keyed by path.
Constructor Details
Instance Attribute Details
#output ⇒ Object (readonly)
Returns the value of attribute output.
70 71 72 |
# File 'lib/covered/wrapper.rb', line 70 def output @output end |
#The wrapped output.(wrappedoutput.) ⇒ Object (readonly)
70 |
# File 'lib/covered/wrapper.rb', line 70 attr :output |
Instance Method Details
#accept?(path) ⇒ Boolean
Whether the wrapped output accepts the given path.
90 91 92 |
# File 'lib/covered/wrapper.rb', line 90 def accept?(path) @output.accept?(path) end |
#add(coverage) ⇒ Object
Add coverage to the wrapped output.
104 105 106 |
# File 'lib/covered/wrapper.rb', line 104 def add(coverage) @output.add(coverage) end |
#clear ⇒ Object
Clear coverage on the wrapped output.
78 79 80 |
# File 'lib/covered/wrapper.rb', line 78 def clear @output.clear end |
#each {|Coverage| ... } ⇒ Object
109 110 111 |
# File 'lib/covered/wrapper.rb', line 109 def each(&block) @output.each(&block) end |
#expand_path(path) ⇒ Object
Expand a path using the wrapped output.
123 124 125 |
# File 'lib/covered/wrapper.rb', line 123 def (path) @output.(path) end |
#finish ⇒ Object
Finish tracking coverage on the wrapped output.
83 84 85 |
# File 'lib/covered/wrapper.rb', line 83 def finish @output.finish end |
#mark(path, lineno, value) ⇒ Object
Mark coverage on the wrapped output.
98 99 100 |
# File 'lib/covered/wrapper.rb', line 98 def mark(path, lineno, value) @output.mark(path, lineno, value) end |
#relative_path(path) ⇒ Object
Convert a path using the wrapped output.
116 117 118 |
# File 'lib/covered/wrapper.rb', line 116 def relative_path(path) @output.relative_path(path) end |
#start ⇒ Object
Start tracking coverage on the wrapped output.
73 74 75 |
# File 'lib/covered/wrapper.rb', line 73 def start @output.start end |
#to_h ⇒ Object
Convert all coverage data to a hash keyed by path.
129 130 131 |
# File 'lib/covered/wrapper.rb', line 129 def to_h to_enum(:each).collect{|coverage| [coverage.path, coverage]}.to_h end |