Class: Codacy::Git
- Inherits:
-
Object
- Object
- Codacy::Git
- Defined in:
- lib/codacy/git.rb
Class Method Summary collapse
Class Method Details
.commit_id ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/codacy/git.rb', line 3 def self.commit_id commit = ENV['TRAVIS_COMMIT'] || ENV['DRONE_COMMIT'] || ENV['GIT_COMMIT'] || ENV['CIRCLE_SHA1'] || ENV['CI_COMMIT_ID'] || ENV['WERCKER_GIT_COMMIT'] || git_commit commit end |
.git(command) ⇒ Object
24 25 26 |
# File 'lib/codacy/git.rb', line 24 def self.git(command) `git --git-dir="#{git_dir}/.git" #{command}` end |
.git_commit ⇒ Object
16 17 18 |
# File 'lib/codacy/git.rb', line 16 def self.git_commit git("log -1 --pretty=format:'%H'") end |
.git_dir ⇒ Object
20 21 22 |
# File 'lib/codacy/git.rb', line 20 def self.git_dir return `git rev-parse --show-toplevel`.strip! end |