exceptional 2.0.6 → 2.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/exceptional.gemspec +1 -1
- data/lib/exceptional.rb +1 -1
- data/lib/exceptional/controller_exception_data.rb +2 -2
- data/lib/exceptional/exception_data.rb +1 -1
- data/spec/exceptional/exception_data_spec.rb +18 -13
- data/spec/fixtures/favicon.png +0 -0
- data/spec/rails_integration_spec.rb +1 -1
- metadata +3 -2
data/exceptional.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
Gem::Specification.new do |s|
|
3
3
|
s.name = %q{exceptional}
|
4
|
-
s.version = "2.0.
|
4
|
+
s.version = "2.0.7"
|
5
5
|
s.authors = ["Contrast"]
|
6
6
|
s.summary = %q{ getexceptional.com is a hosted service for tracking errors in your Ruby/Rails/Rack apps }
|
7
7
|
s.description = %q{Exceptional is the Ruby gem for communicating with http://getexceptional.com (hosted error tracking service). Use it to find out about errors that happen in your live app. It captures lots of helpful information to help you fix the errors.}
|
data/lib/exceptional.rb
CHANGED
@@ -23,7 +23,7 @@ module Exceptional
|
|
23
23
|
'request_method' => @request.request_method.to_s,
|
24
24
|
'remote_ip' => @request.remote_ip,
|
25
25
|
'headers' => extract_http_headers(@request.env),
|
26
|
-
'session' =>
|
26
|
+
'session' => self.class.sanitize_session(@request)
|
27
27
|
}
|
28
28
|
}
|
29
29
|
end
|
@@ -56,7 +56,7 @@ module Exceptional
|
|
56
56
|
session_hash['data'] = session.respond_to?(:to_hash) ? session.to_hash : session.instance_variable_get("@data") || {}
|
57
57
|
session_hash['session_id'] ||= session_hash['data'][:session_id]
|
58
58
|
session_hash['data'].delete(:session_id)
|
59
|
-
|
59
|
+
sanitize_hash(session_hash)
|
60
60
|
rescue
|
61
61
|
{}
|
62
62
|
end
|
@@ -79,8 +79,8 @@ describe Exceptional::ControllerExceptionData, 'with request/controller/params'
|
|
79
79
|
@request.stub!(:request_method).and_return(:get)
|
80
80
|
@request.stub!(:remote_ip).and_return('1.2.3.4')
|
81
81
|
@request.stub!(:env).and_return({'SOME_VAR' => 'abc', 'HTTP_CONTENT_TYPE' => 'text/html'})
|
82
|
-
error = Exceptional::FunkyError.new('some message')
|
83
|
-
data = Exceptional::ControllerExceptionData.new(error, @controller, @request)
|
82
|
+
@error = Exceptional::FunkyError.new('some message')
|
83
|
+
data = Exceptional::ControllerExceptionData.new(@error, @controller, @request)
|
84
84
|
@hash = data.to_hash
|
85
85
|
end
|
86
86
|
|
@@ -106,6 +106,13 @@ describe Exceptional::ControllerExceptionData, 'with request/controller/params'
|
|
106
106
|
Exceptional::ControllerExceptionData.sanitize_hash(input).should == {'crazy' => crazy.to_s, :simple => '123', :some_hash => {'1' => '2'}, :array => ['1', '2']}
|
107
107
|
end
|
108
108
|
|
109
|
+
it "ArgumentError bug with file object" do
|
110
|
+
file = File.new(File.expand_path('../../fixtures/favicon.png',__FILE__))
|
111
|
+
@request.stub!(:parameters).and_return({'something' => file })
|
112
|
+
data = Exceptional::ControllerExceptionData.new(@error, @controller, @request)
|
113
|
+
data.to_hash['request']['parameters']['something'].should == file.to_s
|
114
|
+
end
|
115
|
+
|
109
116
|
it "to_strings regex because JSON.parse(/aa/.to_json) doesn't work" do
|
110
117
|
input = {'crazy' => /abc.*/}
|
111
118
|
Exceptional::ExceptionData.sanitize_hash(input).should == {'crazy' => /abc.*/.to_s}
|
@@ -141,25 +148,23 @@ describe Exceptional::ControllerExceptionData, 'with request/controller/params'
|
|
141
148
|
end
|
142
149
|
|
143
150
|
it "creates a uniqueness_hash from backtrace" do
|
144
|
-
|
145
|
-
|
146
|
-
data = Exceptional::ControllerExceptionData.new(
|
151
|
+
exception = Exception.new
|
152
|
+
exception.stub!(:backtrace).and_return(['123'])
|
153
|
+
data = Exceptional::ControllerExceptionData.new(exception)
|
147
154
|
data.uniqueness_hash.should == Digest::MD5.hexdigest('123')
|
148
155
|
end
|
149
156
|
|
150
157
|
it "creates a nil uniqueness_hash if nil backtrace" do
|
151
|
-
|
152
|
-
|
153
|
-
data = Exceptional::ControllerExceptionData.new(
|
158
|
+
exception = Exception.new
|
159
|
+
exception.stub!(:backtrace).and_return(nil)
|
160
|
+
data = Exceptional::ControllerExceptionData.new(exception)
|
154
161
|
data.uniqueness_hash.should == nil
|
155
162
|
end
|
156
163
|
|
157
164
|
it "creates a uniqueness_hash from backtrace" do
|
158
|
-
|
159
|
-
|
160
|
-
data = Exceptional::ControllerExceptionData.new(
|
165
|
+
exception = Exception.new
|
166
|
+
exception.stub!(:backtrace).and_return([])
|
167
|
+
data = Exceptional::ControllerExceptionData.new(exception)
|
161
168
|
data.uniqueness_hash.should == nil
|
162
169
|
end
|
163
|
-
|
164
|
-
|
165
170
|
end
|
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: exceptional
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Contrast
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-01-
|
12
|
+
date: 2010-01-27 00:00:00 +00:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -45,6 +45,7 @@ files:
|
|
45
45
|
- spec/exceptional_rescue_spec.rb
|
46
46
|
- spec/fixtures/exceptional.yml
|
47
47
|
- spec/fixtures/exceptional_old.yml
|
48
|
+
- spec/fixtures/favicon.png
|
48
49
|
- spec/ginger_scenarios.rb
|
49
50
|
- spec/rack_integration_spec.rb
|
50
51
|
- spec/rails_integration_spec.rb
|