escalate 0.1.0.pre.2 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -1
- data/Gemfile.lock +1 -1
- data/lib/escalate.rb +17 -1
- data/lib/escalate/mixin.rb +1 -17
- data/lib/escalate/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca403c35fe8123ebf15d068d392789e5de418f71
|
4
|
+
data.tar.gz: df6eb4d755258ce4e6d3617ca88075266e591acc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aae531b8f6fc1f8bb4e52a2cbf1ff613fd74f19298ca18aca77936f6e44b741c9ce42b02817bcfb755379d95c6e577342b1a17af0a387e66a00348baf96a3703
|
7
|
+
data.tar.gz: 2d4c26aad91e60c1c2b192b66d6f332db6a858b7f06588788f5b166d41912a8daa27cac39d166ac3cea7e770417037062add542bf36f4429a8c0cc8f0ad74a7b
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
-
## [0.1.0] -
|
7
|
+
## [0.1.0] - 2021-02-03
|
8
|
+
### Added
|
9
|
+
- Added `Escalate.mixin` interface for mixing in `Escalate` with your module for easy escalation of rescued exceptions
|
10
|
+
- Added `escalate` method for escalating rescued exceptions with default behavior of logging to `STDERR`
|
11
|
+
- Added `Escalate.on_escalate` for registering escalation callbacks like `Honeybadger` or `Sentry`
|
8
12
|
|
9
13
|
[0.1.0]: https://github.com/Invoca/escalate/releases/tag/v0.1.0
|
data/Gemfile.lock
CHANGED
data/lib/escalate.rb
CHANGED
@@ -57,9 +57,25 @@ module Escalate
|
|
57
57
|
|
58
58
|
Module.new do
|
59
59
|
def self.included(base)
|
60
|
-
base.extend
|
60
|
+
base.extend self
|
61
61
|
base.escalate_logger_block = Thread.current[:escalate_logger_block] || -> { base.try(:logger) }
|
62
62
|
end
|
63
|
+
|
64
|
+
attr_accessor :escalate_logger_block
|
65
|
+
|
66
|
+
def escalate(exception, message, **context)
|
67
|
+
Escalate.escalate(exception, message, escalate_logger, **context)
|
68
|
+
end
|
69
|
+
|
70
|
+
private
|
71
|
+
|
72
|
+
def escalate_logger
|
73
|
+
escalate_logger_block&.call || default_escalate_logger
|
74
|
+
end
|
75
|
+
|
76
|
+
def default_escalate_logger
|
77
|
+
@default_escalate_logger ||= Logger.new(STDERR)
|
78
|
+
end
|
63
79
|
end
|
64
80
|
end
|
65
81
|
|
data/lib/escalate/mixin.rb
CHANGED
@@ -4,24 +4,8 @@ module Escalate
|
|
4
4
|
module Mixin
|
5
5
|
class << self
|
6
6
|
def included(base)
|
7
|
-
raise 'instead of `include
|
7
|
+
raise 'instead of `include Escalate::Mixin`, you should `include Escalate.mixin`'
|
8
8
|
end
|
9
9
|
end
|
10
|
-
|
11
|
-
attr_accessor :escalate_logger_block
|
12
|
-
|
13
|
-
def escalate(exception, message, **context)
|
14
|
-
Escalate.escalate(exception, message, escalate_logger, **context)
|
15
|
-
end
|
16
|
-
|
17
|
-
private
|
18
|
-
|
19
|
-
def escalate_logger
|
20
|
-
escalate_logger_block.try(:call) || default_escalate_logger
|
21
|
-
end
|
22
|
-
|
23
|
-
def default_escalate_logger
|
24
|
-
@default_escalate_logger ||= Logger.new(STDERR)
|
25
|
-
end
|
26
10
|
end
|
27
11
|
end
|
data/lib/escalate/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: escalate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Invoca Development
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-02-
|
12
|
+
date: 2021-02-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -67,9 +67,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
67
67
|
version: 2.4.0
|
68
68
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
69
69
|
requirements:
|
70
|
-
- - "
|
70
|
+
- - ">="
|
71
71
|
- !ruby/object:Gem::Version
|
72
|
-
version:
|
72
|
+
version: '0'
|
73
73
|
requirements: []
|
74
74
|
rubyforge_project:
|
75
75
|
rubygems_version: 2.6.13
|