Sha256: 3e2a372d99421ff864b6a271e21240f776d92bfdda00e2664d9a2431ef97a377

Contents?: true

Size: 1.57 KB

Versions: 1

Compression:

Stored size: 1.57 KB

Contents

require_relative 'coverage_reporter/configuration'
require_relative 'coverage_reporter/client'
require_relative 'coverage_reporter/runner'

module CircleCI
  module CoverageReporter
    # @return [Configuration]
    def self.configuration
      @configuration ||= Configuration.new
    end

    # @return [Client]
    def self.client
      @client ||= Client.new(configuration)
    end

    # Yields the global configuration to a block.
    #
    # @yield [Configuration]
    def self.configure
      yield configuration if block_given?
    end

    # @return [void]
    def self.run
      dump
      Runner.new.run
    end

    # @return [void]
    def self.dump # rubocop:disable AbcSize
      puts <<-EOF
Configuration         | Value
----------------------|----------------------------------------------------------------------------
artifacts_dir         | #{configuration.artifacts_dir.inspect}
base_revision         | #{configuration.base_revision.inspect}
circleci_token        | #{configuration.circleci_token[-4..-1].rjust(40, '*').inspect}
current_build_number  | #{configuration.current_build_number.inspect}
current_revision      | #{configuration.current_revision.inspect}
previous_build_number | #{configuration.previous_build_number.inspect}
reporters             | #{configuration.reporters.inspect}
repository_name       | #{configuration.repository_name.inspect}
user_name             | #{configuration.user_name.inspect}
vcs_token             | #{configuration.vcs_token[-4..-1].rjust(40, '*').inspect}
vcs_type              | #{configuration.vcs_type.inspect}
      EOF
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
circleci-coverage_reporter-0.1.3 lib/circleci/coverage_reporter.rb