Skip to content

Commit

Permalink
Merge pull request #70 from Sija/develop
Browse files Browse the repository at this point in the history
v1.7.1
  • Loading branch information
Sija authored Jun 21, 2020
2 parents 3fff872 + 0c5cd5c commit d200756
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
4 changes: 2 additions & 2 deletions shard.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: raven
version: 1.7.0
version: 1.7.1

authors:
- Sijawusz Pur Rahnama <sija@sija.pl>
Expand All @@ -21,6 +21,6 @@ targets:
crash_handler:
main: src/crash_handler.cr

crystal: 0.35.0
crystal: ~> 0.35

license: MIT
4 changes: 2 additions & 2 deletions src/raven.cr
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ module Raven

macro sys_command_compiled(command)
%result = {{ `(#{command.id} || true) 2>/dev/null`.stringify.strip }}
%result unless %result.empty?
%result.presence
end

def self.sys_command(command)
result = `(#{command}) 2>/dev/null`.strip rescue nil
result if !result.nil? && !result.empty? && $?.success?
result.presence if $?.success?
end
end
11 changes: 1 addition & 10 deletions src/raven/configuration.cr
Original file line number Diff line number Diff line change
Expand Up @@ -323,19 +323,10 @@ module Raven
File.directory?("/etc/heroku")
end

private HEROKU_DYNO_METADATA_MESSAGE =
"You are running on Heroku but haven't enabled Dyno Metadata. " \
"For Sentry's release detection to work correctly, please run " \
"`heroku labs:enable runtime-dyno-metadata`"

private def detect_release_from_heroku
return unless running_on_heroku?
return if ENV["CI"]?
if commit = ENV["HEROKU_SLUG_COMMIT"]?
return commit
end
Log.warn { HEROKU_DYNO_METADATA_MESSAGE }
nil
ENV["HEROKU_SLUG_COMMIT"]?
end

private def detect_release_from_capistrano
Expand Down

0 comments on commit d200756

Please sign in to comment.