Module: Dockly::Util::Git
Instance Method Summary collapse
Instance Method Details
#git_repo ⇒ Object
6 7 8 |
# File 'lib/dockly/util/git.rb', line 6 def git_repo @git_repo ||= Grit::Repo.new('.') end |
#git_sha ⇒ Object
10 11 12 |
# File 'lib/dockly/util/git.rb', line 10 def git_sha @git_sha ||= git_repo.git.show.lines.first.chomp.match(/^commit ([a-f0-9]+)$/)[1][0..6] rescue 'unknown' end |