Class: CommitLive::Sentry

Inherits:
Object
  • Object
show all
Defined in:
lib/commit-live/sentry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSentry

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

#netrcObject

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.capture_message(the_exception,
    :extra => (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 log_message(message, other_args)
  Raven.capture_message("#{username} - #{message}",
    :extra => (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 (other_args)
  .merge(other_args)
end

#tokenObject



12
13
14
15
# File 'lib/commit-live/sentry.rb', line 12

def token
  netrc.read
  netrc.password
end

#user_infoObject



22
23
24
25
26
27
# File 'lib/commit-live/sentry.rb', line 22

def 
  {
    'username' => username,
    'token' => token
  }
end

#usernameObject



17
18
19
20
# File 'lib/commit-live/sentry.rb', line 17

def username
  netrc.read(machine: 'ga-extra')
  netrc.
end