Sha256: e74787f673314f8031f7b71fede8b41c87707e1737dcb2bd11e3dd045c1b5814

Contents?: true

Size: 931 Bytes

Versions: 9

Compression:

Stored size: 931 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

9 entries across 9 versions & 2 rubygems

Version Path
codeclimate-test-reporter-0.5.0 lib/code_climate/test_reporter/configuration.rb
codeclimate-test-reporter-0.4.8 lib/code_climate/test_reporter/configuration.rb
construi-0.6.0 vendor/bundle/ruby/1.9.1/gems/codeclimate-test-reporter-0.4.6/lib/code_climate/test_reporter/configuration.rb
construi-0.5.0 vendor/bundle/ruby/1.9.1/gems/codeclimate-test-reporter-0.4.6/lib/code_climate/test_reporter/configuration.rb
construi-0.4.0 vendor/bundle/ruby/1.9.1/gems/codeclimate-test-reporter-0.4.6/lib/code_climate/test_reporter/configuration.rb
construi-0.2.0 vendor/bundle/ruby/1.9.1/gems/codeclimate-test-reporter-0.4.6/lib/code_climate/test_reporter/configuration.rb
construi-0.1.0 vendor/bundle/ruby/1.9.1/gems/codeclimate-test-reporter-0.4.6/lib/code_climate/test_reporter/configuration.rb
codeclimate-test-reporter-0.4.7 lib/code_climate/test_reporter/configuration.rb
codeclimate-test-reporter-0.4.6 lib/code_climate/test_reporter/configuration.rb