exceptions 0.0.3 → 0.0.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 69c15fe46279fba52098310638efcf740aea4cf5
4
- data.tar.gz: 4d2e6147476a91ce4e2f79f5571171f9c0664a9a
3
+ metadata.gz: 910c40a341d6a4cf355d397393a963002b2380ce
4
+ data.tar.gz: 1578b3d249ce10de739fd74573f0245c883f2e03
5
5
  SHA512:
6
- metadata.gz: 30fb87b9294da9fc9a2e4eb6823b96eaa46b9f7bccec2411f4e579aa822116846e53760220acbdcbc6db963129636b849cfa022473a755557768e3030999f727
7
- data.tar.gz: 00e834877e5f2bdede316d038697f245f8c54fa164bc3553778a5a499db352b4b9cb01418683bf56576eedfc4580d4b09a996a2af514c86a4f6991dd25fb599f
6
+ metadata.gz: 3ec9af3bcd29975032ebaef2a8233291961bcba951b38be8f4553d0ed26b5a83335f81fc419b31f6a8ae4ccd0346b840e8421b215eefef2a59f87fda5416f0bc
7
+ data.tar.gz: 9fb97cd1f3d7ceae037dae20c7ea85bdbe404858d65f8205ebff620c8da291e2eb09d030a3d6926c1f7afc38d3700bfdd72a2c21fd6a4791d3ec1d1821b7a70a
data/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ env:
3
+ global:
4
+ - secure: "NNSdg0tE/Der65vZj6c8ArOky+m3hgAJUEFiaiNIpbTvmUcg+uP8s6TiQuxw9XNnX9U8ubo7rfNbEfHeZ3zvzR5k6H28dAneuBBDE2odGfabUnioJRj04J+pONCHPJoOJoUsT7h5ylqMif8v1T8pOOyTd+0TB2XsRSjUT2Jmw+Q="
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Exceptions
1
+ # Exceptions [![Build Status](https://travis-ci.org/remind101/exceptions.svg?branch=master)](https://travis-ci.org/remind101/exceptions)
2
2
 
3
3
  Exceptions is a Ruby gem that provides the right amount of abstraction for doing exception
4
4
  tracking in Ruby.
@@ -23,6 +23,17 @@ Or install it yourself as:
23
23
  $ gem install exceptions
24
24
  ```
25
25
 
26
+ ## Configuration
27
+
28
+ Exceptions provides the concept of "backends" that allow you to configure what
29
+ happens when `Exceptions.notify` is called. The following backends are provided:
30
+
31
+ * **Null**: This backend does nothing. Useful in tests.
32
+ * **Raiser**: This backend will simply raise the exception.
33
+ * **Logger**: This backend will log the exception to stdout.
34
+ * **Honeybadger**: This backend will send the exception to honeybadger using the [honeybadger-ruby](https://github.com/honeybadger-io/honeybadger-ruby) gem.
35
+ * **Multi**: A meta backend to compose other backends into a single backend.
36
+
26
37
  ## Usage
27
38
 
28
39
  **Track an exception**
@@ -31,6 +42,23 @@ $ gem install exceptions
31
42
  Exceptions.notify(StandardError.new("Boom"))
32
43
  ```
33
44
 
45
+ **Set context**
46
+
47
+ ```ruby
48
+ Exceptions.context(request_id: 'dc2d304c-6276-4c1f-9f0d-cc910f4487fd')
49
+ ```
50
+
51
+ **Clear context**
52
+
53
+ ```ruby
54
+ Exceptions.clear_context
55
+ ```
56
+
57
+ ## Rack
58
+
59
+ Rack middleware is included which can be used to catch exceptions, shuttle them off somewhere and
60
+ raise the exception again.
61
+
34
62
  ## Contributing
35
63
 
36
64
  1. Fork it
data/Rakefile CHANGED
@@ -1 +1,10 @@
1
+ #!/usr/bin/env rake
1
2
  require "bundler/gem_tasks"
3
+
4
+ task :default => [:spec]
5
+
6
+ require 'rspec/core/rake_task'
7
+ desc "Run specs"
8
+ RSpec::Core::RakeTask.new do |t|
9
+ t.pattern = 'spec/**/*_spec.rb'
10
+ end
@@ -1,3 +1,3 @@
1
1
  module Exceptions
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
data/lib/exceptions.rb CHANGED
@@ -32,6 +32,13 @@ module Exceptions
32
32
  backend.clear_context
33
33
  end
34
34
 
35
+ # Public: Notify a rack exception.
36
+ #
37
+ # Returns a Result object.
38
+ def rack_exception(exception, env)
39
+ backend.rack_exception exception, env
40
+ end
41
+
35
42
  # Public: The configuration object.
36
43
  #
37
44
  # Returns a Configuration instance.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exceptions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric J. Holmes
@@ -75,6 +75,7 @@ extra_rdoc_files: []
75
75
  files:
76
76
  - .gitignore
77
77
  - .rspec
78
+ - .travis.yml
78
79
  - Gemfile
79
80
  - LICENSE.txt
80
81
  - README.md