module CodeClimate
  module TestReporter

    def self.start
      if run?
        require "simplecov"
        ::SimpleCov.add_filter 'vendor'
        ::SimpleCov.formatter = Formatter
        ::SimpleCov.start("test_frameworks")
      else
        puts("Not reporting to Code Climate because ENV['CODECLIMATE_REPO_TOKEN'] is not set.")
      end
    end

    def self.run?
      !!ENV["CODECLIMATE_REPO_TOKEN"]
    end
  end
end

module CodeClimate
  module TestReporter

    def self.start
      if run?
        require "simplecov"
        ::SimpleCov.add_filter 'vendor'
        ::SimpleCov.formatter = Formatter
        ::SimpleCov.start(ENV["CODECLIMATE_SIMPLECOV_PROFILE"] || "test_frameworks")
      else
        puts("Not reporting to Code Climate because ENV['CODECLIMATE_REPO_TOKEN'] is not set.")
      end
    end

    def self.run?
      !!ENV["CODECLIMATE_REPO_TOKEN"]
    end
  end
end

Allow a custom SimpleCov adapter (aka profile)
Allow a custom SimpleCov adapter (aka profile)

This will fix the issue where code coverage is not fully reported for a Rails project or any other Ruby project containing files outside /lib.