exceptional 2.0.10 → 2.0.11

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/init.rb CHANGED
@@ -19,6 +19,7 @@ else
19
19
  Exceptional::Startup.announce
20
20
  end
21
21
  require File.join('exceptional', 'integration', 'rails')
22
+ require File.join('exceptional', 'integration', 'dj')
22
23
  rescue => e
23
24
  STDERR.puts "Problem starting Exceptional Plugin. Your app will run as normal."
24
25
  STDERR.puts e
@@ -0,0 +1,12 @@
1
+ begin
2
+ class Delayed::Job
3
+ def log_exception_with_exceptional(e)
4
+ Exceptional.handle(e, "Delayed::Job #{self.name}")
5
+ log_exception_without_exceptional(e)
6
+ Exceptional.context.clear!
7
+ end
8
+ alias_method_chain :log_exception, :exceptional
9
+ Exceptional.logger.info "DJ integration enabled"
10
+ end
11
+ rescue
12
+ end
@@ -1,3 +1,3 @@
1
1
  module Exceptional
2
- VERSION = '2.0.10'
2
+ VERSION = '2.0.11'
3
3
  end
@@ -0,0 +1,29 @@
1
+ require File.dirname(__FILE__) + '/spec_helper'
2
+
3
+ module Delayed
4
+ class Job
5
+ def log_exception(exception)
6
+ # do nothing for now
7
+ end
8
+ def name
9
+ "My delayed job"
10
+ end
11
+ end
12
+ end
13
+
14
+ require File.join(File.dirname(__FILE__), '..', 'lib', 'exceptional', 'integration', 'dj')
15
+
16
+ describe Delayed::Job do
17
+ before :each do
18
+ @job = Delayed::Job.new
19
+ @exception = StandardError.new
20
+ end
21
+ it "should handle exceptions with Exceptional" do
22
+ Exceptional.should_receive(:handle).with(@exception, "Delayed::Job My delayed job")
23
+ @job.log_exception(@exception)
24
+ end
25
+ it "should clear context" do
26
+ Exceptional.should_receive(:clear!)
27
+ @job.log_exception(@exception)
28
+ end
29
+ end
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.10
4
+ version: 2.0.11
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-02-17 00:00:00 +00:00
12
+ date: 2010-03-05 00:00:00 +00:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -27,6 +27,7 @@ files:
27
27
  - lib/exceptional/config.rb
28
28
  - lib/exceptional/controller_exception_data.rb
29
29
  - lib/exceptional/exception_data.rb
30
+ - lib/exceptional/integration/dj.rb
30
31
  - lib/exceptional/integration/rack.rb
31
32
  - lib/exceptional/integration/rails.rb
32
33
  - lib/exceptional/integration/sinatra.rb
@@ -38,6 +39,7 @@ files:
38
39
  - lib/exceptional/version.rb
39
40
  - lib/exceptional.rb
40
41
  - spec/bin/ginger
42
+ - spec/dj_integration_spec.rb
41
43
  - spec/exceptional/catcher_spec.rb
42
44
  - spec/exceptional/config_spec.rb
43
45
  - spec/exceptional/exception_data_spec.rb