Created
July 5, 2016 20:34
-
-
Save davetapley/970061908075bfac46dd2f253d3786a4 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