Sha256: 9d9ebb7fbb9ac9e30a150391aa76c49e8d0d6274e95feb0571d37d298a09fd53
Contents?: true
Size: 521 Bytes
Versions: 35
Compression:
Stored size: 521 Bytes
Contents
class GitCommitSha def self.current new.current end def current sha = development_sha || capistrano_sha || heroku_sha sha.present? && sha[0...6] end private def development_sha Rails.env.development? && `git rev-parse HEAD` end def heroku_sha ENV.fetch("SOURCE_VERSION", "N/A") end def capistrano_sha sha_from_file("REVISION") end def sha_from_file(filename) file = Renalware::Engine.root.join(filename) File.exist?(file) && File.open(file, &:gets) end end
Version data entries
35 entries across 35 versions & 1 rubygems