exception_no 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/CHANGELOG.md +6 -0
- data/lib/exception_no.rb +5 -1
- data/test/exception_no.rb +8 -0
- data/test/prelude.rb +4 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ODJlYTU1M2UyY2RmZjJjMzgyN2E1ZjIwMjcyYmNjNGZmMTFiYzhjMQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NDc5Y2Y2OWI1OWI0YmQ3YTE5YTEzZTgzMGExNTM2M2RlMGYwMDY5NA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OGNiMTBlNmU3OTFiYjM5Mjg5OTQ5ZDMyNzczZWM4MjhmMGFiNTljNzQzMzgz
|
10
|
+
YzA2OGQwY2Y0ZDUzMTIxNTQzYzgxZjhkN2YyOGQyMDNiNzNkN2Y0YTZlYWQy
|
11
|
+
MDBkNzJjZDE1MjA4ZDJhMTYwMTE4ODExZDA4YjE5NjliMzdhMzU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NTdhNTUwYmZmNDg1ZTFlZTVlMmFkZGNiZDEyYzM2MWIwZmRhY2Y0Y2YyOWFk
|
14
|
+
NGY2MTYwNmFjNTFkMDk0NTdjYTQ3NzQ0MmEzYzc4YjczZDc2MzgyNzYwY2Iw
|
15
|
+
MjlmMDZmZjI5ZmE5MjRkZWU3N2NiZTQyOTEzNzQwMDE3NTlmOTU=
|
data/CHANGELOG.md
CHANGED
data/lib/exception_no.rb
CHANGED
@@ -2,13 +2,15 @@ require "net/smtp"
|
|
2
2
|
require "erb"
|
3
3
|
|
4
4
|
class ExceptionNo
|
5
|
-
VERSION = "0.0.
|
5
|
+
VERSION = "0.0.3"
|
6
6
|
|
7
7
|
attr_accessor :backtrace_filter
|
8
|
+
attr_accessor :deliver
|
8
9
|
|
9
10
|
def initialize(config = {})
|
10
11
|
@config = config
|
11
12
|
@template = ERB.new(TEMPLATE)
|
13
|
+
@deliver = true
|
12
14
|
|
13
15
|
@backtrace_filter = -> line { true }
|
14
16
|
end
|
@@ -22,6 +24,8 @@ class ExceptionNo
|
|
22
24
|
end
|
23
25
|
|
24
26
|
def notify(exception, options = {})
|
27
|
+
return unless @deliver
|
28
|
+
|
25
29
|
begin
|
26
30
|
_notify(exception, options)
|
27
31
|
rescue => notification_error
|
data/test/exception_no.rb
CHANGED
@@ -63,5 +63,13 @@ test "allows to filter the backtrace" do |notifier|
|
|
63
63
|
assert !body.include?(Gem.path.first)
|
64
64
|
end
|
65
65
|
|
66
|
+
test "disable delivery" do |notifier|
|
67
|
+
notifier.deliver = false
|
68
|
+
|
69
|
+
notifier.notify(ArgumentError.new)
|
70
|
+
|
71
|
+
assert_equal $smtp.outbox.size, 0
|
72
|
+
end
|
73
|
+
|
66
74
|
$smtp.stop
|
67
75
|
$smtp.join
|
data/test/prelude.rb
CHANGED