denouncer 0.2.4 → 0.2.5

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: b2162c599738f2c3ee05d6627091b4668fa71620
4
- data.tar.gz: a0a4e11e0fd104f0a2b32e033046df85bf3f62fe
3
+ metadata.gz: 18e13628a53f1013de4d104ac8c7f7f7ba322a1d
4
+ data.tar.gz: 6fe0e094e8b9d59dc79026772f34d211a1675417
5
5
  SHA512:
6
- metadata.gz: 0848de89fa137d4ee9e3f3abbb4821b2e785db9514a0e41ce22c5992d0bf7b80abc1d078f22df8afe7d228a71eafa7efeeacddcbefe8e8f6026bd1bba47f2d0a
7
- data.tar.gz: a292c71a87620dfb9914b964e9ebedada093875d9937de28c34b90d1f18d4bb47c00f1e12e2fba884db5bb1aadbf83006a28a2730e5718398e19ddf013f9598d
6
+ metadata.gz: 4756ec7dcc9fd0aef73d5d5a6afcf2a6cf9f9beab0a4f45aa15674afd321779ce6cdf58b657febcaa5ba18d4d2be25a5792aa1fa30ca63e4e8587bd9a0f7347c
7
+ data.tar.gz: 2a7e48863d3be97aadd69d6c88d9798a2ac953b6fc7306f89640a4252cbf5857b5c7cd93d720845722e0b547606179f57452d8dd97264ba7c230db9ea427c44a
@@ -40,14 +40,18 @@ module Denouncer
40
40
  # @param error [StandardError]
41
41
  # @param metadata [Hash]
42
42
  def self.notify(error, metadata = nil)
43
- raise "Denouncer is not configured yet. Please run Denouncer.configure(options) to setup denouncer!" if @@notifier.nil?
44
- # ATTENTION: this ensures that no exceptions are lost when denouncer is not working as expected!!!
45
- # This is worth the downside of denouncer debugging thougths.
46
- begin
47
- notifier.notify error, metadata
48
- rescue => err
49
- puts "An error occured while sending an exception notification via denouncer!"
50
- raise error
43
+ if is_configured?
44
+ # ATTENTION: this ensures that no exceptions are lost when denouncer is not working as expected!!!
45
+ # This is worth the downside of denouncer debugging thougths.
46
+ begin
47
+ notifier.notify error, metadata
48
+ return true
49
+ rescue => err
50
+ puts "An error occured while sending an exception notification via denouncer!"
51
+ raise error
52
+ end
53
+ else
54
+ return false
51
55
  end
52
56
  end
53
57
 
@@ -1,3 +1,3 @@
1
1
  module Denouncer
2
- VERSION = "0.2.4"
2
+ VERSION = "0.2.5"
3
3
  end
@@ -147,11 +147,15 @@ describe Denouncer do
147
147
  expect(notifier).to receive(:notify).with(error, metadata)
148
148
  Denouncer.notify error, metadata
149
149
  end
150
+
151
+ it "should return true" do
152
+ expect(Denouncer.notify error).to be_truthy
153
+ end
150
154
  end
151
155
 
152
156
  context "unconfigured" do
153
- it "should raise an error" do
154
- expect { Denouncer.notify error }.to raise_error
157
+ it "should return false" do
158
+ expect(Denouncer.notify error).to be_falsey
155
159
  end
156
160
  end
157
161
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: denouncer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julian Weber