Forked from davetapley/codeclimate-test-reporter.rb
Created
October 15, 2016 05:18
-
-
Save jclif/3df2c14e9318e4394f09e010961ff5f6 to your computer and use it in GitHub Desktop.
CodeClimate::TestReporter patched to handle the absence of a .git
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'simplecov' | |
require 'codeclimate-test-reporter' | |
module Extensions | |
module Git | |
module ClassMethods | |
def info | |
{ | |
head: head, | |
committed_at: committed_at_or_now, | |
branch: branch_from_git_or_ci, | |
} | |
end | |
def committed_at_or_now | |
committed_at || Time.now.to_i | |
end | |
end | |
end | |
end | |
CodeClimate::TestReporter::Git.singleton_class.prepend Extensions::Git::ClassMethods | |
CodeClimate::TestReporter::Formatter.new.format SimpleCov.result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment