Class: CommitLive::Sentry
- Inherits:
-
Object
- Object
- CommitLive::Sentry
- Defined in:
- lib/commit-live/sentry.rb
Instance Attribute Summary collapse
-
#netrc ⇒ Object
Returns the value of attribute netrc.
Instance Method Summary collapse
-
#initialize ⇒ Sentry
constructor
A new instance of Sentry.
- #log_exception(the_exception, other_args) ⇒ Object
- #log_message(message, other_args) ⇒ Object
- #merge_user_info_with_other_args(other_args) ⇒ Object
- #token ⇒ Object
- #user_info ⇒ Object
- #username ⇒ Object
Constructor Details
#initialize ⇒ Sentry
Returns a new instance of Sentry.
8 9 10 |
# File 'lib/commit-live/sentry.rb', line 8 def initialize() @netrc = CommitLive::NetrcInteractor.new() end |
Instance Attribute Details
#netrc ⇒ Object
Returns the value of attribute netrc.
6 7 8 |
# File 'lib/commit-live/sentry.rb', line 6 def netrc @netrc end |
Instance Method Details
#log_exception(the_exception, other_args) ⇒ Object
41 42 43 44 45 46 47 |
# File 'lib/commit-live/sentry.rb', line 41 def log_exception(the_exception, other_args) Raven.(the_exception, :extra => merge_user_info_with_other_args(other_args) ) puts "Something went wrong. Commit.Live Admin has been notified about the issue. Please wait until further instructions." exit 1 end |
#log_message(message, other_args) ⇒ Object
33 34 35 36 37 38 39 |
# File 'lib/commit-live/sentry.rb', line 33 def (, other_args) Raven.("#{username} - #{}", :extra => merge_user_info_with_other_args(other_args) ) puts "Something went wrong. Commit.Live Admin has been notified about the issue. Please wait until further instructions." exit 1 end |
#merge_user_info_with_other_args(other_args) ⇒ Object
29 30 31 |
# File 'lib/commit-live/sentry.rb', line 29 def merge_user_info_with_other_args(other_args) user_info.merge(other_args) end |
#token ⇒ Object
12 13 14 15 |
# File 'lib/commit-live/sentry.rb', line 12 def token netrc.read netrc.password end |
#user_info ⇒ Object
22 23 24 25 26 27 |
# File 'lib/commit-live/sentry.rb', line 22 def user_info { 'username' => username, 'token' => token } end |
#username ⇒ Object
17 18 19 20 |
# File 'lib/commit-live/sentry.rb', line 17 def username netrc.read(machine: 'ga-extra') netrc.login end |