deprecation_toolkit 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +13 -2
- data/Gemfile.lock +2 -2
- data/deprecation_toolkit.gemspec +4 -0
- data/lib/deprecation_toolkit/behaviors/raise.rb +22 -2
- data/lib/deprecation_toolkit/collector.rb +1 -0
- data/lib/deprecation_toolkit/version.rb +1 -1
- metadata +7 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 14622e99341958cb8876efa74036f9f90eb27c77f10e24e59b3261c62d5c8b31
|
4
|
+
data.tar.gz: ea63088375c2c5c1010b267f38bf1b8acbc0e363bdd3cf33d4c6d762e47704bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf5adecd962fd27a18c223c5852552b52a601230827cd761488ae7d62a8a745f013a62fc57d6ffba2b67c989e9c6cfb9436f76046d5b3159e5ac48d9aeb9f191
|
7
|
+
data.tar.gz: e51874283d799826c161c52ce091597c60b1583521d8e63b57341c61064241710611dd41aa7d4adbd7db2ef17a26e5ac0c5adb41920f1b04ca8fd86a9add4153
|
data/CHANGELOG.md
CHANGED
@@ -1,19 +1,30 @@
|
|
1
1
|
# Change log
|
2
2
|
|
3
3
|
## master (unreleased)
|
4
|
+
|
5
|
+
## 1.2.0 (2018-11-28)
|
6
|
+
|
7
|
+
### New features
|
8
|
+
|
9
|
+
* [#30](https://github.com/Shopify/deprecation_toolkit/pull/30): Introduce a `DeprecationMismatch` error class. (@Edouard-chin)
|
4
10
|
### Bug fixes
|
11
|
+
* [#29](https://github.com/Shopify/deprecation_toolkit/pull/29): Fix issue where the error class triggered was incorrect in some circumstances. (@Edouard-chin)
|
5
12
|
|
6
13
|
## 1.1.0 (2018-11-13)
|
7
|
-
|
8
|
-
|
14
|
+
|
15
|
+
### New features
|
16
|
+
|
17
|
+
* [#28](https://github.com/Shopify/deprecation_toolkit/pull/28): `Configuration.allowed_deprecations` now accepts Procs.
|
9
18
|
This is useful if you need to whitelist deprecations based on the caller.
|
10
19
|
|
11
20
|
## 1.0.3 (2018-10-25)
|
21
|
+
|
12
22
|
### Bug fixes
|
13
23
|
|
14
24
|
* [#22](https://github.com/Shopify/deprecation_toolkit/pull/22): Fixes `Kernel.warn` not triggering deprecation. (@rmacklin)
|
15
25
|
|
16
26
|
## 1.0.2 (2018-10-01)
|
27
|
+
|
17
28
|
### New features
|
18
29
|
|
19
30
|
* [#15](https://github.com/Shopify/deprecation_toolkit/pull/15): Add support for ActiveSupport 4.2. (@andrewmarkle)
|
data/Gemfile.lock
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
deprecation_toolkit (1.
|
4
|
+
deprecation_toolkit (1.2.0)
|
5
5
|
activesupport (>= 4.2)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
activesupport (5.2.1)
|
10
|
+
activesupport (5.2.1.1)
|
11
11
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
12
12
|
i18n (>= 0.7, < 2)
|
13
13
|
minitest (~> 5.1)
|
data/deprecation_toolkit.gemspec
CHANGED
@@ -14,6 +14,10 @@ Gem::Specification.new do |spec|
|
|
14
14
|
spec.homepage = "https://github.com/shopify/deprecation_toolkit"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
17
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
18
|
+
spec.metadata["source_code_uri"] = "https://github.com/shopify/deprecation_toolkit"
|
19
|
+
spec.metadata["changelog_uri"] = "https://github.com/Shopify/deprecation_toolkit/blob/master/CHANGELOG.md"
|
20
|
+
|
17
21
|
spec.required_ruby_version = '>= 2.3'
|
18
22
|
|
19
23
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
@@ -4,10 +4,12 @@ module DeprecationToolkit
|
|
4
4
|
module Behaviors
|
5
5
|
class Raise
|
6
6
|
def self.trigger(_test, current_deprecations, recorded_deprecations)
|
7
|
-
error_class = if current_deprecations > recorded_deprecations
|
7
|
+
error_class = if current_deprecations.size > recorded_deprecations.size
|
8
8
|
DeprecationIntroduced
|
9
|
-
|
9
|
+
elsif current_deprecations.size < recorded_deprecations.size
|
10
10
|
DeprecationRemoved
|
11
|
+
else
|
12
|
+
DeprecationMismatch
|
11
13
|
end
|
12
14
|
|
13
15
|
raise error_class.new(current_deprecations, recorded_deprecations)
|
@@ -46,5 +48,23 @@ module DeprecationToolkit
|
|
46
48
|
super(message)
|
47
49
|
end
|
48
50
|
end
|
51
|
+
|
52
|
+
class DeprecationMismatch < DeprecationException
|
53
|
+
def initialize(current_deprecations, recorded_deprecations)
|
54
|
+
message = <<~EOM
|
55
|
+
The recorded deprecations for this test doesn't match the one that got triggered.
|
56
|
+
Fix or record the new deprecations to discard this error.
|
57
|
+
|
58
|
+
You can re-record deprecations by adding the `--record-deprecations` flag when running your tests.
|
59
|
+
|
60
|
+
===== Expected
|
61
|
+
#{recorded_deprecations.deprecations.join("\n")}
|
62
|
+
===== Actual
|
63
|
+
#{current_deprecations.deprecations.join("\n")}
|
64
|
+
EOM
|
65
|
+
|
66
|
+
super(message)
|
67
|
+
end
|
68
|
+
end
|
49
69
|
end
|
50
70
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deprecation_toolkit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-11-
|
11
|
+
date: 2018-11-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -105,7 +105,10 @@ files:
|
|
105
105
|
homepage: https://github.com/shopify/deprecation_toolkit
|
106
106
|
licenses:
|
107
107
|
- MIT
|
108
|
-
metadata:
|
108
|
+
metadata:
|
109
|
+
homepage_uri: https://github.com/shopify/deprecation_toolkit
|
110
|
+
source_code_uri: https://github.com/shopify/deprecation_toolkit
|
111
|
+
changelog_uri: https://github.com/Shopify/deprecation_toolkit/blob/master/CHANGELOG.md
|
109
112
|
post_install_message:
|
110
113
|
rdoc_options: []
|
111
114
|
require_paths:
|
@@ -122,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
122
125
|
version: '0'
|
123
126
|
requirements: []
|
124
127
|
rubyforge_project:
|
125
|
-
rubygems_version: 2.6
|
128
|
+
rubygems_version: 2.7.6
|
126
129
|
signing_key:
|
127
130
|
specification_version: 4
|
128
131
|
summary: Deprecation Toolkit around ActiveSupport::Deprecation
|