sentry-raven 0.13.0 → 0.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/raven/base.rb +16 -11
- data/lib/raven/cli.rb +5 -1
- data/lib/raven/client.rb +2 -2
- data/lib/raven/interfaces/stack_trace.rb +12 -2
- data/lib/raven/transports/http.rb +1 -0
- data/lib/raven/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cbd5b9f37fa1ca79dea7e89151503de77596ed98
|
4
|
+
data.tar.gz: aaedca0037e5beb365920db50e7e1b0051f9e7c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c462bfc11f2cde6d33464b16b0ae3986ac62ea34a63d16f2185d4d4f5cbf1c7bf6a18228058f17d1aeefad3aa47827deba61eed49f33a2db786bfff91ff42c8f
|
7
|
+
data.tar.gz: 38266e8ad1642b99d59fcafef2c42814d09e9ebcbd8800e7a4af2040068be367ff3a4907a60df17b8f00173a9631f1d03b9381f31c6dc189e70b64bb8cb7c9f2
|
data/lib/raven/base.rb
CHANGED
@@ -91,14 +91,17 @@ module Raven
|
|
91
91
|
# MyApp.run
|
92
92
|
# end
|
93
93
|
def capture(options = {})
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
94
|
+
if block_given?
|
95
|
+
begin
|
96
|
+
yield
|
97
|
+
rescue Error
|
98
|
+
raise # Don't capture Raven errors
|
99
|
+
rescue Exception => e
|
100
|
+
capture_exception(e, options)
|
101
|
+
raise
|
102
|
+
end
|
103
|
+
else
|
104
|
+
install_at_exit_hook(options)
|
102
105
|
end
|
103
106
|
end
|
104
107
|
|
@@ -215,10 +218,12 @@ module Raven
|
|
215
218
|
|
216
219
|
private
|
217
220
|
|
218
|
-
def install_at_exit_hook
|
221
|
+
def install_at_exit_hook(options)
|
219
222
|
at_exit do
|
220
|
-
|
221
|
-
|
223
|
+
if $ERROR_INFO
|
224
|
+
logger.debug "Caught a post-mortem exception: #{$ERROR_INFO.inspect}"
|
225
|
+
capture_exception($ERROR_INFO, options)
|
226
|
+
end
|
222
227
|
end
|
223
228
|
end
|
224
229
|
end
|
data/lib/raven/cli.rb
CHANGED
@@ -47,7 +47,11 @@ module Raven
|
|
47
47
|
end
|
48
48
|
|
49
49
|
if evt && !(evt.is_a? Thread)
|
50
|
-
|
50
|
+
if evt.is_a? Hash
|
51
|
+
puts "-> event ID: #{evt[:event_id]}"
|
52
|
+
else
|
53
|
+
puts "-> event ID: #{evt.id}"
|
54
|
+
end
|
51
55
|
elsif evt #async configuration
|
52
56
|
puts "-> event ID: #{evt.value.id}"
|
53
57
|
else
|
data/lib/raven/client.rb
CHANGED
@@ -32,7 +32,7 @@ module Raven
|
|
32
32
|
return
|
33
33
|
end
|
34
34
|
|
35
|
-
Raven.logger.debug "Sending event #{event[
|
35
|
+
Raven.logger.debug "Sending event #{event[:event_id]} to Sentry"
|
36
36
|
|
37
37
|
content_type, encoded_data = encode(event)
|
38
38
|
|
@@ -73,7 +73,7 @@ module Raven
|
|
73
73
|
end
|
74
74
|
|
75
75
|
def get_log_message(event)
|
76
|
-
(event && event[
|
76
|
+
(event && event[:message]) || '<no message value>'
|
77
77
|
end
|
78
78
|
|
79
79
|
def transport
|
@@ -36,19 +36,29 @@ module Raven
|
|
36
36
|
def filename
|
37
37
|
return nil if self.abs_path.nil?
|
38
38
|
|
39
|
-
prefix = if
|
39
|
+
prefix = if under_project_root? && in_app
|
40
40
|
project_root
|
41
|
+
elsif under_project_root?
|
42
|
+
longest_load_path || project_root
|
41
43
|
else
|
42
|
-
|
44
|
+
longest_load_path
|
43
45
|
end
|
44
46
|
|
45
47
|
prefix ? self.abs_path[prefix.to_s.chomp(File::SEPARATOR).length+1..-1] : self.abs_path
|
46
48
|
end
|
47
49
|
|
50
|
+
def under_project_root?
|
51
|
+
project_root && abs_path.start_with?(project_root)
|
52
|
+
end
|
53
|
+
|
48
54
|
def project_root
|
49
55
|
@project_root ||= Raven.configuration.project_root && Raven.configuration.project_root.to_s
|
50
56
|
end
|
51
57
|
|
58
|
+
def longest_load_path
|
59
|
+
$LOAD_PATH.select { |s| self.abs_path.start_with?(s.to_s) }.sort_by { |s| s.to_s.length }.last
|
60
|
+
end
|
61
|
+
|
52
62
|
def to_hash(*args)
|
53
63
|
data = super(*args)
|
54
64
|
data[:filename] = self.filename
|
data/lib/raven/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sentry-raven
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.13.
|
4
|
+
version: 0.13.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sentry Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -163,7 +163,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
163
163
|
version: '0'
|
164
164
|
requirements: []
|
165
165
|
rubyforge_project:
|
166
|
-
rubygems_version: 2.
|
166
|
+
rubygems_version: 2.4.5
|
167
167
|
signing_key:
|
168
168
|
specification_version: 4
|
169
169
|
summary: A gem that provides a client interface for the Sentry error logger
|