deprecation_helper 0.1.1 → 0.2.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
  SHA256:
3
- metadata.gz: 7d4be45e781db2774450dcad89f7a56e4a5676c9427ae4efaf750266dce5091f
4
- data.tar.gz: a612eb5d360197fd7f0092f8874003835c015b33031a6323e170b2148e83069d
3
+ metadata.gz: c5c2bd01471e901e6326714d6d1ffcaa70dbc26267de5f6021b99883362fec4c
4
+ data.tar.gz: d0b112c7b6ec7e9eb1145acaf0a25117a15e53804a5d074a7e63450aa20d4a6f
5
5
  SHA512:
6
- metadata.gz: 2eee5bbe8acbe1369e3d272fb6f40abef1f5591f0c4287358dc6341e94cf13f6592ee8d3d4a072598df3b37fe64bef47ea46438bbc3a3617430d265f5ef78cc8
7
- data.tar.gz: b228fdd32d45ab045f5c9d853693a7adac8617d3601e9e0a05432359cda12c9bfad5779d57ea100dde2efa4fd4a04d22e5bbcbe311e4620d0f790c2e53302e64
6
+ metadata.gz: 9e4ecf3d33aea3b9e769dac9b848100710777afd837d33181e1359590839d5da3965c8b58e97985c9be51927d4b495a8e743b99848f2d920a5139c9ef9cb41d1
7
+ data.tar.gz: b85eed3965943d92dfaa367ac08a8e5a2ec85476af53e43f36627a6dbc97d093d4990227439f2a2b0254d7bf68cd1d8825aac92f5d46c3cffd25f3043f7306ff
@@ -10,6 +10,7 @@ require 'deprecation_helper/strategies/base_strategy_interface'
10
10
  require 'deprecation_helper/strategies/error_strategy_interface'
11
11
  require 'deprecation_helper/strategies/raise_error'
12
12
  require 'deprecation_helper/strategies/log_error'
13
+ require 'deprecation_helper/strategies/log_error_and_stacktrace'
13
14
 
14
15
  require 'deprecation_helper/deprecation_exception'
15
16
 
@@ -2,7 +2,6 @@
2
2
 
3
3
  module DeprecationHelper
4
4
  module Strategies
5
- # This strategy does nothing
6
5
  class LogError
7
6
  include BaseStrategyInterface
8
7
 
@@ -0,0 +1,21 @@
1
+ # typed: strict
2
+
3
+ module DeprecationHelper
4
+ module Strategies
5
+ class LogErrorAndStacktrace
6
+ include BaseStrategyInterface
7
+
8
+ extend T::Sig
9
+
10
+ sig { params(logger: T.nilable(Logger)).void }
11
+ def initialize(logger: nil)
12
+ @logger = T.let(logger || Logger.new(STDOUT), Logger)
13
+ end
14
+
15
+ sig { override.params(message: String, backtrace: T::Array[String]).void }
16
+ def apply!(message, backtrace) # rubocop:disable Lint/UnusedMethodArgument
17
+ @logger.warn({ message: message, backtrace: backtrace})
18
+ end
19
+ end
20
+ end
21
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deprecation_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Evanczuk
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-02-25 00:00:00.000000000 Z
11
+ date: 2021-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sorbet-runtime
@@ -69,6 +69,7 @@ files:
69
69
  - lib/deprecation_helper/strategies/base_strategy_interface.rb
70
70
  - lib/deprecation_helper/strategies/error_strategy_interface.rb
71
71
  - lib/deprecation_helper/strategies/log_error.rb
72
+ - lib/deprecation_helper/strategies/log_error_and_stacktrace.rb
72
73
  - lib/deprecation_helper/strategies/raise_error.rb
73
74
  homepage:
74
75
  licenses: []