Sha256: 14e1122388e8f1184dc240c0e106be4412babde5dd47ab6a1c865d5ab179ccbd

Contents?: true

Size: 829 Bytes

Versions: 1

Compression:

Stored size: 829 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, :logger, :profile, :path_prefix, :gzip_request, :git_dir

      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

      private

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

        log
      end
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
codeclimate-test-reporter-0.4.5 lib/code_climate/test_reporter/configuration.rb