class Covered::Policy
Attributes
reports[R]
Public Class Methods
new()
click to toggle source
Calls superclass method
# File lib/covered/policy.rb, line 39 def initialize super(Files.new) @reports = [] end
Public Instance Methods
cache!()
click to toggle source
# File lib/covered/policy.rb, line 74 def cache! @output = Cache.new(@output) end
call(*args)
click to toggle source
# File lib/covered/policy.rb, line 145 def call(*args) @reports.each do |report| report.call(self, *args) end end
capture()
click to toggle source
# File lib/covered/policy.rb, line 82 def capture @capture ||= Capture.new(@output) end
disable()
click to toggle source
# File lib/covered/policy.rb, line 90 def disable capture.disable end
enable()
click to toggle source
# File lib/covered/policy.rb, line 86 def enable capture.enable end
freeze()
click to toggle source
Calls superclass method
# File lib/covered/policy.rb, line 45 def freeze return self if frozen? capture @reports.freeze super end
include(*args)
click to toggle source
# File lib/covered/policy.rb, line 58 def include(*args) @output = Include.new(@output, *args) end
only(*args)
click to toggle source
# File lib/covered/policy.rb, line 66 def only(*args) @output = Only.new(@output, *args) end
persist!()
click to toggle source
# File lib/covered/policy.rb, line 78 def persist! @output = Persist.new(@output) end
reports!(coverage = ENV['COVERAGE'])
click to toggle source
# File lib/covered/policy.rb, line 128 def reports!(coverage = ENV['COVERAGE']) if coverage names = coverage.split(',') names.each do |name| begin klass = Covered.const_get(name) @reports << klass.new rescue NameError @reports << Autoload.new(name) end end else @reports << Covered::BriefSummary.new end end
root(*args)
click to toggle source
# File lib/covered/policy.rb, line 70 def root(*args) @output = Root.new(@output, *args) end
skip(*args)
click to toggle source
# File lib/covered/policy.rb, line 62 def skip(*args) @output = Skip.new(@output, *args) end
source(*args)
click to toggle source
# File lib/covered/policy.rb, line 54 def source(*args) @output = Source.new(@output, *args) end