Sha256: 012a77d4fda510f4394e910ad4dd25c7585796f249dc4f796a3c296c923c5a2e
Contents?: true
Size: 817 Bytes
Versions: 10
Compression:
Stored size: 817 Bytes
Contents
module Honeybadger module Util class Revision class << self def detect(root = Dir.pwd) from_heroku || from_capistrano(root) || from_git end private # Requires (currently) alpha platform feature # `heroku labs:enable runtime-dyno-metadata` # # See https://devcenter.heroku.com/articles/dyno-metadata def from_heroku ENV['HEROKU_SLUG_COMMIT'] end def from_capistrano(root) file = File.join(root, 'REVISION') return nil unless File.file?(file) File.read(file).strip rescue nil end def from_git return nil unless File.directory?('.git') `git rev-parse HEAD`.strip rescue nil end end end end end
Version data entries
10 entries across 10 versions & 1 rubygems