graytoad 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/graytoad.gemspec +1 -1
  3. data/lib/graytoad.rb +10 -2
  4. metadata +3 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.4
1
+ 0.0.5
data/graytoad.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{graytoad}
8
- s.version = "0.0.4"
8
+ s.version = "0.0.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Alexey Palazhchenko"]
data/lib/graytoad.rb CHANGED
@@ -16,11 +16,11 @@ class Graytoad
16
16
  g.host = this_host
17
17
 
18
18
  if e.nil?
19
- g.short_message, g.full_message = "#{opts[:error_class]}: #{opts[:error_message]}", caller
19
+ g.short_message, g.full_message = "#{opts[:error_class]}: #{opts[:error_message]}", backtrace_to_message(caller)
20
20
  opts.each_pair { |key, value| g.add_additional(key.to_s, value) }
21
21
  HoptoadNotifier.notify(opts)
22
22
  else
23
- g.short_message, g.full_message = e.message, e.backtrace
23
+ g.short_message, g.full_message = e.message, "Backtrace:\n" + backtrace_to_message(e.backtrace)
24
24
  HoptoadNotifier.notify(e, opts)
25
25
  end
26
26
 
@@ -28,6 +28,14 @@ class Graytoad
28
28
  end
29
29
 
30
30
  private
31
+ def backtrace_to_message(bt)
32
+ if bt.nil?
33
+ "No backtrace."
34
+ else
35
+ "Backtrace:\n" + bt.join("\n")
36
+ end
37
+ end
38
+
31
39
  def detect_this_host
32
40
  require 'socket'
33
41
  self.this_host = Socket.gethostname
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graytoad
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 4
10
- version: 0.0.4
9
+ - 5
10
+ version: 0.0.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Alexey Palazhchenko