exceptional 2.0.16 → 2.0.17

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.
data/lib/exceptional.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  $:.unshift File.dirname(__FILE__)
2
2
 
3
+ require 'exceptional/monkeypatches'
3
4
  require 'exceptional/catcher'
4
5
  require 'exceptional/startup'
5
6
  require 'exceptional/log_factory'
@@ -0,0 +1,5 @@
1
+ class Regexp
2
+ def to_json(options = {})
3
+ "\"#{self.to_s}\""
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  module Exceptional
2
- VERSION = '2.0.16'
2
+ VERSION = '2.0.17'
3
3
  end
@@ -121,7 +121,7 @@ describe Exceptional::ControllerExceptionData, 'with request/controller/params'
121
121
  it "handles session objects with various interfaces" do
122
122
  class SessionWithInstanceVariables
123
123
  def initialize
124
- @data = {'a' => '1'}
124
+ @data = {'a' => '1', 'b' => /hello there Im a regex/i}
125
125
  @session_id = '123'
126
126
  end
127
127
  end
@@ -130,10 +130,10 @@ describe Exceptional::ControllerExceptionData, 'with request/controller/params'
130
130
  session = SessionWithInstanceVariables.new
131
131
  request.stub!(:session).and_return(session)
132
132
  request.stub!(:session_options).and_return({})
133
- Exceptional::ControllerExceptionData.sanitize_session(request).should == {'session_id' => '123', 'data' => {'a' => '1'}}
134
- session = mock('session', :session_id => '123', :instance_variable_get => {'a' => '1'})
133
+ Exceptional::ControllerExceptionData.sanitize_session(request).should == {'session_id' => '123', 'data' => {'a' => '1', 'b' => "(?i-mx:hello there Im a regex)"}}
134
+ session = mock('session', :session_id => '123', :instance_variable_get => {'a' => '1', 'b' => /another(.+) regex/mx})
135
135
  request.stub!(:session).and_return(session)
136
- Exceptional::ControllerExceptionData.sanitize_session(request).should == {'session_id' => '123', 'data' => {'a' => '1'}}
136
+ Exceptional::ControllerExceptionData.sanitize_session(request).should == {'session_id' => '123', 'data' => {'a' => '1', 'b' => "(?mx-i:another(.+) regex)"}}
137
137
  session = mock('session', :session_id => nil, :to_hash => {:session_id => '123', 'a' => '1'})
138
138
  request.stub!(:session).and_return(session)
139
139
  Exceptional::ControllerExceptionData.sanitize_session(request).should == {'session_id' => '123', 'data' => {'a' => '1'}}
@@ -0,0 +1,8 @@
1
+ require File.dirname(__FILE__) + '/../spec_helper'
2
+ require File.join(File.dirname(__FILE__), '../..', 'lib', 'exceptional', 'monkeypatches')
3
+
4
+ describe Regexp do
5
+ it "should output a correctly formatted string" do
6
+ /hello/.to_json.should == "\"(?-mix:hello)\""
7
+ end
8
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exceptional
3
3
  version: !ruby/object:Gem::Version
4
- hash: 47
4
+ hash: 45
5
5
  prerelease: false
6
6
  segments:
7
7
  - 2
8
8
  - 0
9
- - 16
10
- version: 2.0.16
9
+ - 17
10
+ version: 2.0.17
11
11
  platform: ruby
12
12
  authors:
13
13
  - Contrast
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-07-12 00:00:00 +01:00
18
+ date: 2010-07-27 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -40,6 +40,7 @@ files:
40
40
  - lib/exceptional/integration/sinatra.rb
41
41
  - lib/exceptional/integration/tester.rb
42
42
  - lib/exceptional/log_factory.rb
43
+ - lib/exceptional/monkeypatches.rb
43
44
  - lib/exceptional/rack_exception_data.rb
44
45
  - lib/exceptional/remote.rb
45
46
  - lib/exceptional/startup.rb
@@ -50,6 +51,7 @@ files:
50
51
  - spec/exceptional/catcher_spec.rb
51
52
  - spec/exceptional/config_spec.rb
52
53
  - spec/exceptional/exception_data_spec.rb
54
+ - spec/exceptional/monkeypatches_spec.rb
53
55
  - spec/exceptional/rack_exception_data_spec.rb
54
56
  - spec/exceptional/remote_spec.rb
55
57
  - spec/exceptional/startup_spec.rb