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 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.6"
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
@@ -14,7 +14,7 @@ require 'exceptional/integration/rack'
14
14
  module Exceptional
15
15
 
16
16
  PROTOCOL_VERSION = 5
17
- VERSION = '2.0.6'
17
+ VERSION = '2.0.7'
18
18
  CLIENT_NAME = 'getexceptional-gem'
19
19
 
20
20
  def self.logger
@@ -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' => Exceptional::ControllerExceptionData.sanitize_session(@request)
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
- ControllerExceptionData.sanitize_hash(session_hash)
59
+ sanitize_hash(session_hash)
60
60
  rescue
61
61
  {}
62
62
  end
@@ -19,7 +19,7 @@ module Exceptional
19
19
  })
20
20
  hash.merge!(extra_stuff)
21
21
  hash.merge!(context_stuff)
22
- hash
22
+ self.class.sanitize_hash(hash)
23
23
  end
24
24
 
25
25
  def extra_stuff
@@ -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
- myException = Exception.new
145
- myException.stub!(:backtrace).and_return(['123'])
146
- data = Exceptional::ControllerExceptionData.new(myException)
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
- myException = Exception.new
152
- myException.stub!(:backtrace).and_return(nil)
153
- data = Exceptional::ControllerExceptionData.new(myException)
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
- myException = Exception.new
159
- myException.stub!(:backtrace).and_return([])
160
- data = Exceptional::ControllerExceptionData.new(myException)
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
@@ -3,7 +3,7 @@ require File.join(File.dirname(__FILE__), '..', 'lib', 'exceptional', 'integrati
3
3
 
4
4
  describe Exceptional, 'version number' do
5
5
  it "be available proramatically" do
6
- Exceptional::VERSION.should == '2.0.6'
6
+ Exceptional::VERSION.should == '2.0.7'
7
7
  end
8
8
  end
9
9
 
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.6
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-26 00:00:00 +00:00
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