temescal 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +14 -6
- data/lib/temescal/monitors.rb +10 -0
- data/lib/temescal/version.rb +1 -1
- data/spec/lib/temescal/monitors_spec.rb +8 -0
- data/spec/spec_helper.rb +1 -0
- data/temescal.gemspec +2 -2
- metadata +15 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f37264d3890ff553dbeeaa4da80089a858abc7b
|
4
|
+
data.tar.gz: 67e5f482b6fd8c757e881ca1aec281024462dcc1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b5137c2c6bead9f87c8ef19b173f08658bf9ba0bd567c56bbd17d7f1255cadc241d5c4a02ae9bedf4be041267485564c498eed5326c3244ac888ce7b5c80b83
|
7
|
+
data.tar.gz: a24d94b23ae58d0765a0381105c8cd6036f12f800cee2aaf6a175d7c6bdf33cd619eb00599c7ca9d6964729aa984dc2a9c3d1ad4e153829f8dd2e091c22af18c
|
data/README.md
CHANGED
@@ -27,23 +27,31 @@ end
|
|
27
27
|
By default, Temescal will render a JSON response formatted as such (using StandardError with a message of "Foobar" as an example):
|
28
28
|
```json
|
29
29
|
{
|
30
|
-
meta: {
|
31
|
-
status: 500,
|
32
|
-
error: "StandardError",
|
33
|
-
message: "Foobar"
|
30
|
+
"meta": {
|
31
|
+
"status": 500,
|
32
|
+
"error": "StandardError",
|
33
|
+
"message": "Foobar"
|
34
34
|
}
|
35
35
|
}
|
36
36
|
```
|
37
37
|
Temescal will also log the error for you through STDERR.
|
38
38
|
## Monitors
|
39
|
-
Though Temescal will log an error for you, it won't necessarily be picked up by your monitoring solution of choice in a production environment. Luckily, Temescal provides integration with popular monitoring services.
|
39
|
+
Though Temescal will log an error for you, it won't necessarily be picked up by your monitoring solution of choice in a production environment. Luckily, Temescal provides integration with popular monitoring services.
|
40
|
+
|
41
|
+
The services currently supported are:
|
42
|
+
|
43
|
+
* [Airbrake](https://airbrake.io/)
|
44
|
+
* [Bugsnag](https://bugsnag.com/)
|
45
|
+
* [New Relic](http://newrelic.com/)
|
46
|
+
|
47
|
+
If you use a different monitoring service that you'd like to see supported, feel free to submit an issue. Better yet, pull requests are more than welcome!
|
40
48
|
|
41
49
|
Note that you'll need the gem for your monitor installed and configured for your application in order for Temescal to properly work with it.
|
42
50
|
|
43
51
|
## Configuration
|
44
52
|
Temescal provides several configuration options for you. You can set these options when configuring the middleware for your application.
|
45
53
|
|
46
|
-
`monitors` to set the monitors you'd like to use with Temescal. It takes symbols of monitor names (currently `:airbrake
|
54
|
+
`monitors` to set the monitors you'd like to use with Temescal. It takes symbols of monitor names (currently `:airbrake`, `:bugsnag`, and `:new_relic`).
|
47
55
|
|
48
56
|
`raise_errors` to set whether you'd like to override Temescal and raise all errors without rendering a Temescal response. Set to `true` to enable.
|
49
57
|
|
data/lib/temescal/monitors.rb
CHANGED
@@ -31,5 +31,15 @@ module Temescal
|
|
31
31
|
::NewRelic::Agent.notice_error exception
|
32
32
|
end
|
33
33
|
end
|
34
|
+
|
35
|
+
# Public: Reporting strategy for Bugsnag.
|
36
|
+
class Bugsnag < MonitorsStrategy
|
37
|
+
# Public: Reports an exception to Bugsnag.
|
38
|
+
#
|
39
|
+
# exception - The caught exception.
|
40
|
+
def self.report(exception)
|
41
|
+
::Bugsnag.notify exception
|
42
|
+
end
|
43
|
+
end
|
34
44
|
end
|
35
45
|
end
|
data/lib/temescal/version.rb
CHANGED
@@ -26,4 +26,12 @@ describe Temescal::Monitors do
|
|
26
26
|
Temescal::Monitors::NewRelic.report exception
|
27
27
|
end
|
28
28
|
end
|
29
|
+
|
30
|
+
context 'Bugsnag' do
|
31
|
+
it "should send the exception to Bugsnag when report is called" do
|
32
|
+
expect(Bugsnag).to receive(:notify).with(exception)
|
33
|
+
|
34
|
+
Temescal::Monitors::Bugsnag.report exception
|
35
|
+
end
|
36
|
+
end
|
29
37
|
end
|
data/spec/spec_helper.rb
CHANGED
data/temescal.gemspec
CHANGED
@@ -4,8 +4,8 @@ $:.unshift File.expand_path('../lib', __FILE__)
|
|
4
4
|
require 'temescal/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
-
spec.add_dependency 'rack'
|
8
|
-
spec.add_development_dependency 'bundler'
|
7
|
+
spec.add_dependency 'rack', '~> 1.0'
|
8
|
+
spec.add_development_dependency 'bundler', '~> 1.0'
|
9
9
|
|
10
10
|
spec.authors = ['Todd Bealmear']
|
11
11
|
spec.description = %q{Rack Middleware for gracefully handling exceptions for JSON APIs.}
|
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: temescal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Todd Bealmear
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-02-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
19
|
+
version: '1.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
26
|
+
version: '1.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
33
|
+
version: '1.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
40
|
+
version: '1.0'
|
41
41
|
description: Rack Middleware for gracefully handling exceptions for JSON APIs.
|
42
42
|
email:
|
43
43
|
- todd@t0dd.io
|
@@ -48,19 +48,19 @@ files:
|
|
48
48
|
- LICENSE
|
49
49
|
- README.md
|
50
50
|
- Rakefile
|
51
|
-
- temescal.
|
51
|
+
- lib/temescal.rb
|
52
52
|
- lib/temescal/configuration.rb
|
53
53
|
- lib/temescal/error.rb
|
54
54
|
- lib/temescal/middleware.rb
|
55
55
|
- lib/temescal/monitors.rb
|
56
56
|
- lib/temescal/response.rb
|
57
57
|
- lib/temescal/version.rb
|
58
|
-
- lib/temescal.rb
|
59
58
|
- spec/lib/temescal/configuration_spec.rb
|
60
59
|
- spec/lib/temescal/error_spec.rb
|
61
60
|
- spec/lib/temescal/middleware_spec.rb
|
62
61
|
- spec/lib/temescal/monitors_spec.rb
|
63
62
|
- spec/spec_helper.rb
|
63
|
+
- temescal.gemspec
|
64
64
|
homepage: https://github.com/todd/temescal
|
65
65
|
licenses:
|
66
66
|
- MIT
|
@@ -71,17 +71,17 @@ require_paths:
|
|
71
71
|
- lib
|
72
72
|
required_ruby_version: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
|
-
- -
|
74
|
+
- - ">="
|
75
75
|
- !ruby/object:Gem::Version
|
76
76
|
version: '0'
|
77
77
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
78
78
|
requirements:
|
79
|
-
- -
|
79
|
+
- - ">="
|
80
80
|
- !ruby/object:Gem::Version
|
81
81
|
version: '0'
|
82
82
|
requirements: []
|
83
83
|
rubyforge_project:
|
84
|
-
rubygems_version: 2.0
|
84
|
+
rubygems_version: 2.2.0
|
85
85
|
signing_key:
|
86
86
|
specification_version: 4
|
87
87
|
summary: Rack Middleware for gracefully handling exceptions for JSON APIs.
|