ratchetio 0.4.10 → 0.4.11
Sign up to get free protection for your applications and to get access to all the features.
- data/THANKS +1 -0
- data/lib/ratchetio/version.rb +1 -1
- data/lib/ratchetio.rb +11 -7
- data/spec/ratchetio_spec.rb +11 -0
- metadata +3 -2
data/THANKS
CHANGED
data/lib/ratchetio/version.rb
CHANGED
data/lib/ratchetio.rb
CHANGED
@@ -135,13 +135,17 @@ module Ratchetio
|
|
135
135
|
data[:level] = force_level if force_level
|
136
136
|
|
137
137
|
# parse backtrace
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
138
|
+
if exception.backtrace.respond_to?( :map )
|
139
|
+
frames = exception.backtrace.map { |frame|
|
140
|
+
# parse the line
|
141
|
+
match = frame.match(/(.*):(\d+)(?::in `([^']+)')?/)
|
142
|
+
{ :filename => match[1], :lineno => match[2].to_i, :method => match[3] }
|
143
|
+
}
|
144
|
+
# reverse so that the order is as ratchet expects
|
145
|
+
frames.reverse!
|
146
|
+
else
|
147
|
+
frames = []
|
148
|
+
end
|
145
149
|
|
146
150
|
data[:body] = {
|
147
151
|
:trace => {
|
data/spec/ratchetio_spec.rb
CHANGED
@@ -73,6 +73,17 @@ describe Ratchetio do
|
|
73
73
|
config.exception_level_filters = saved_filters
|
74
74
|
end
|
75
75
|
end
|
76
|
+
|
77
|
+
it 'should report exception objects with no backtrace' do
|
78
|
+
payload = nil
|
79
|
+
Ratchetio.stub(:schedule_payload) do |*args|
|
80
|
+
payload = JSON.parse( args[0] )
|
81
|
+
end
|
82
|
+
Ratchetio.report_exception(StandardError.new("oops"))
|
83
|
+
payload["data"]["body"]["trace"]["frames"].should == []
|
84
|
+
payload["data"]["body"]["trace"]["exception"]["class"].should == "StandardError"
|
85
|
+
payload["data"]["body"]["trace"]["exception"]["message"].should == "oops"
|
86
|
+
end
|
76
87
|
end
|
77
88
|
|
78
89
|
context 'report_message' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ratchetio
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.11
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-01-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -253,3 +253,4 @@ test_files:
|
|
253
253
|
- spec/ratchetio_spec.rb
|
254
254
|
- spec/spec_helper.rb
|
255
255
|
- spec/support/devise.rb
|
256
|
+
has_rdoc:
|