denouncer 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -8
- data/lib/denouncer.rb +1 -1
- data/lib/denouncer/version.rb +1 -1
- data/spec/lib/denouncer/denouncer_spec.rb +5 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26ee8ecb82cc1d8c0c3344e38f0cdbb483c8df65
|
4
|
+
data.tar.gz: 64863e1e400e11f35e897e68086bbc3e426dc867
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1a63cdf5f8f53f6885a542f66ddb00c2c288b4b90421ae7d4c132b48d8784927110344b9c22f3444453e057c3d447779cb58e9447850e96589f430b76b4586b
|
7
|
+
data.tar.gz: 52d3545bf61aa5ad1e2a179c3fb5a1931f613c06ba5371b97395c4ca0e73c26824ff2ea9cee04bda77d1c33d2d8aabf03f34271ba188323fe7e3164edd6b3435
|
data/README.md
CHANGED
@@ -89,14 +89,14 @@ The bunny gem is required for the AmqpNotifier. Please add the bunny gem to your
|
|
89
89
|
|
90
90
|
gem 'bunny'
|
91
91
|
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
92
|
+
Configuration variables are:
|
93
|
+
* application_name - the name of your application (required)
|
94
|
+
* server - the amqp server address to use (default: localhost)
|
95
|
+
* port - the port to use for amqp connections (default: 5672)
|
96
|
+
* username - the username for the amqp connection (default: 'guest')
|
97
|
+
* password - the password for the amqp connection (default: 'guest')
|
98
|
+
* vhost - the virtual host to use for the amqp connection (default: '/')
|
99
|
+
* message_queue - the message queue to use (default: "#{application_name}.errors", e.g. "myapp.errors")
|
100
100
|
|
101
101
|
#### AMQP Configuration
|
102
102
|
|
data/lib/denouncer.rb
CHANGED
@@ -39,7 +39,7 @@ module Denouncer
|
|
39
39
|
# @param metadata [Hash]
|
40
40
|
def self.notify(error, metadata = nil)
|
41
41
|
raise "Denouncer is not configured yet. Please run Denouncer.configure(options) to setup denouncer!" if @@notifier.nil?
|
42
|
-
notifier.notify error
|
42
|
+
notifier.notify error, metadata
|
43
43
|
end
|
44
44
|
|
45
45
|
private
|
data/lib/denouncer/version.rb
CHANGED
@@ -7,6 +7,9 @@ describe Denouncer do
|
|
7
7
|
let(:error) do
|
8
8
|
StandardError.new("Test")
|
9
9
|
end
|
10
|
+
let(:metadata) do
|
11
|
+
{ var1: "abc" }
|
12
|
+
end
|
10
13
|
|
11
14
|
before do
|
12
15
|
Denouncer.reset_configuration
|
@@ -141,8 +144,8 @@ describe Denouncer do
|
|
141
144
|
|
142
145
|
it "should call it's notifiers notify method" do
|
143
146
|
notifier = Denouncer.send(:notifier)
|
144
|
-
expect(notifier).to receive(:notify)
|
145
|
-
Denouncer.notify error
|
147
|
+
expect(notifier).to receive(:notify).with(error, metadata)
|
148
|
+
Denouncer.notify error, metadata
|
146
149
|
end
|
147
150
|
end
|
148
151
|
|