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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a3e33eb654953f4c511b2207a89df47f6db4865c
4
- data.tar.gz: 4b245b1e402c24a933eae6ba6ac6eb9be362e5f1
3
+ metadata.gz: ca403c35fe8123ebf15d068d392789e5de418f71
4
+ data.tar.gz: df6eb4d755258ce4e6d3617ca88075266e591acc
5
5
  SHA512:
6
- metadata.gz: 28a1ecb9c22129c0b68c62ac6c5bd00eb5b41580bae1763dfdc9e0d9e732dfd22b7acc37ec84f353d4a3f7f35c18334ae92a78a5677c5e9e6453c4ccfb074767
7
- data.tar.gz: dc2271ab38903b2c8f874adc0b21f26c3851a759f5ed1db34482d447573d3d8f13d8b8d1b5565b9106b73bde766dee65260aeb6c645d402b9326371536d3dce0
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] - Unreleased
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- escalate (0.1.0.pre.2)
4
+ escalate (0.1.0)
5
5
  activesupport
6
6
 
7
7
  GEM
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 Escalate::Mixin
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
 
@@ -4,24 +4,8 @@ module Escalate
4
4
  module Mixin
5
5
  class << self
6
6
  def included(base)
7
- raise 'instead of `include Escalator::Mixin`, you should `include Escalator.mixin`'
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Escalate
4
- VERSION = "0.1.0.pre.2"
4
+ VERSION = "0.1.0"
5
5
  end
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.pre.2
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-02 00:00:00.000000000 Z
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: 1.3.1
72
+ version: '0'
73
73
  requirements: []
74
74
  rubyforge_project:
75
75
  rubygems_version: 2.6.13