Sha256: e92e1d1010ac9a741241edb6f20080c1782f24442fada783fe3d44cce7cbabd4
Contents?: true
Size: 552 Bytes
Versions: 142
Compression:
Stored size: 552 Bytes
Contents
# frozen_string_literal: true 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
142 entries across 142 versions & 1 rubygems