Sha256: dec509b6650ddaf47b905e2070ccfbe467e089fa39bd43bbfa33ae0e16dde28b

Contents?: true

Size: 930 Bytes

Versions: 22

Compression:

Stored size: 930 Bytes

Contents

require "logger"

module CodeClimate
  module TestReporter
    @@configuration = nil

    def self.configure
      @@configuration = Configuration.new

      if block_given?
        yield configuration
      end

      configuration
    end

    def self.configuration
      @@configuration || configure
    end

    class Configuration
      attr_accessor :branch, :path_prefix, :gzip_request, :git_dir

      attr_writer :logger, :profile, :timeout

      def initialize
        @gzip_request = true
      end

      def logger
        @logger ||= default_logger
      end

      def profile
        @profile ||= "test_frameworks"
      end

      def skip_token
        @skip_token ||= "nocov"
      end

      def timeout
        @timeout ||= Client::DEFAULT_TIMEOUT
      end

      private

      def default_logger
        log = Logger.new($stderr)
        log.level = Logger::INFO

        log
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 2 rubygems

Version Path
codeclimate-test-reporter-1.0.9 lib/code_climate/test_reporter/configuration.rb
dirwatch-0.0.9 vendor/bundle/ruby/2.5.0/gems/codeclimate-test-reporter-1.0.8/lib/code_climate/test_reporter/configuration.rb
dirwatch-0.0.8 vendor/bundle/ruby/2.5.0/gems/codeclimate-test-reporter-1.0.8/lib/code_climate/test_reporter/configuration.rb
dirwatch-0.0.6 vendor/bundle/ruby/2.3.0/gems/codeclimate-test-reporter-1.0.8/lib/code_climate/test_reporter/configuration.rb
dirwatch-0.0.5 vendor/bundle/ruby/2.3.0/gems/codeclimate-test-reporter-1.0.8/lib/code_climate/test_reporter/configuration.rb
dirwatch-0.0.4 vendor/bundle/ruby/2.3.0/gems/codeclimate-test-reporter-1.0.8/lib/code_climate/test_reporter/configuration.rb
dirwatch-0.0.3 vendor/bundle/ruby/2.3.0/gems/codeclimate-test-reporter-1.0.8/lib/code_climate/test_reporter/configuration.rb
dirwatch-0.0.2 vendor/bundle/ruby/2.3.0/gems/codeclimate-test-reporter-1.0.8/lib/code_climate/test_reporter/configuration.rb
codeclimate-test-reporter-1.0.8 lib/code_climate/test_reporter/configuration.rb
codeclimate-test-reporter-1.0.7 lib/code_climate/test_reporter/configuration.rb
codeclimate-test-reporter-1.0.6 lib/code_climate/test_reporter/configuration.rb
codeclimate-test-reporter-1.0.5 lib/code_climate/test_reporter/configuration.rb
codeclimate-test-reporter-1.0.4 lib/code_climate/test_reporter/configuration.rb
codeclimate-test-reporter-1.0.3 lib/code_climate/test_reporter/configuration.rb
codeclimate-test-reporter-1.0.2 lib/code_climate/test_reporter/configuration.rb
codeclimate-test-reporter-1.0.1 lib/code_climate/test_reporter/configuration.rb
codeclimate-test-reporter-1.0.0 lib/code_climate/test_reporter/configuration.rb
codeclimate-test-reporter-1.0.0.pre.rc2 lib/code_climate/test_reporter/configuration.rb
codeclimate-test-reporter-1.0.0.pre.rc1 lib/code_climate/test_reporter/configuration.rb
codeclimate-test-reporter-0.6.0 lib/code_climate/test_reporter/configuration.rb