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 CHANGED
@@ -3,3 +3,4 @@ Huge thanks to the following contributors (by github username). For the most up-
3
3
  kavu
4
4
  mipearson
5
5
  trisweb
6
+ tysontate
@@ -1,3 +1,3 @@
1
1
  module Ratchetio
2
- VERSION = "0.4.10"
2
+ VERSION = "0.4.11"
3
3
  end
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
- frames = exception.backtrace.map { |frame|
139
- # parse the line
140
- match = frame.match(/(.*):(\d+)(?::in `([^']+)')?/)
141
- { :filename => match[1], :lineno => match[2].to_i, :method => match[3] }
142
- }
143
- # reverse so that the order is as ratchet expects
144
- frames.reverse!
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 => {
@@ -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.10
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: 2012-12-20 00:00:00.000000000 Z
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: