module Coverband
Thanks for all the help SimpleCov github.com/colszowka/simplecov initial version pulled into Coverband
from Simplecov 12/04/2018
An array of SourceFile instances with additional collection helper methods for calculating coverage across them etc.
Thanks for all the help SimpleCov github.com/colszowka/simplecov-html initial version pulled into Coverband
from Simplecov 12/04/2018
NOTE: with Ruby 2.6.0 and beyond we can replace this classifier with ::Coverage.line_stub
ruby-doc.org/stdlib-2.6.1/libdoc/coverage/rdoc/Coverage.html#method-c-line_stub
Thanks for all the help SimpleCov github.com/colszowka/simplecov-html initial version pulled into Coverband
from Simplecov 12/04/2018
Classifies whether lines are relevant for code coverage analysis. Comments & whitespace lines, and :nocov: token blocks, are considered not relevant.
Thanks for all the help SimpleCov github.com/colszowka/simplecov initial version pulled into Coverband
from Simplecov 12/04/2018
A code coverage result, initialized from the Hash stdlib built-in coverage library generates (Coverage.result).
A way to access the various coverage data breakdowns
Thanks for all the help SimpleCov github.com/colszowka/simplecov initial version pulled into Coverband
from Simplecov 12/04/2018
Representation of a source file including it's coverage data, source code, source lines and featuring helpers to interpret that data.
ensure we properly do release candidate versioning; github.com/danmayer/coverband/issues/288 use format “4.2.1.rc.1” ~> 4.2.1.rc to prerelease versions like v4.2.1.rc.2 and v4.2.1.rc.3
Constants
- ALL_TYPES
- CONFIG_FILE
- COVERBAND_ALTERNATE_PATCH
- EAGER_TYPE
- MERGED_TYPE
- RUNTIME_TYPE
- SERVICE_CONFIG
- TYPES
- VERSION
Public Class Methods
# File lib/coverband.rb, line 69 def self.configuration @configuration ||= Configuration.new end
# File lib/coverband.rb, line 39 def self.configure(file = nil) configuration_file = file || ENV["COVERBAND_CONFIG"] if configuration_file.nil? configuration_file = coverband_service? ? SERVICE_CONFIG : CONFIG_FILE end configuration if block_given? yield(configuration) elsif File.exist?(configuration_file) load configuration_file else configuration.logger.debug("using default configuration") end @@configured = true coverage_instance.reset_instance end
# File lib/coverband.rb, line 61 def self.configured? @@configured end
# File lib/coverband.rb, line 57 def self.coverband_service? !!File.exist?(SERVICE_CONFIG) end
# File lib/coverband.rb, line 91 def self.eager_loading_coverage(&block) coverage_instance.eager_loading(&block) end
# File lib/coverband.rb, line 87 def self.eager_loading_coverage! coverage_instance.eager_loading! end
# File lib/coverband.rb, line 65 def self.report_coverage coverage_instance.report_coverage end
# File lib/coverband.rb, line 95 def self.runtime_coverage! coverage_instance.runtime! end
# File lib/coverband.rb, line 73 def self.start Coverband::Collectors::Coverage.instance # TODO: Railtie sets up at_exit after forks, via middleware, perhaps this should be # added if not rails or if rails but not rackserverrunning AtExit.register unless tasks_to_ignore? Background.start if configuration.background_reporting_enabled && !RackServerCheck.running? && !tasks_to_ignore? end
# File lib/coverband.rb, line 81 def self.tasks_to_ignore? (defined?(Rake) && Rake.respond_to?(:application) && (Rake&.application&.top_level_tasks || []).any? { |task| Coverband::Configuration::IGNORE_TASKS.include?(task) }) end
Private Class Methods
# File lib/coverband.rb, line 99 def self.coverage_instance Coverband::Collectors::Coverage.instance end