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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 4a142310e36ffb312bd50a257a82260477fc8940
4
- data.tar.gz: ca2b082fddc00a195c72e081eac71512d358b7dd
2
+ SHA256:
3
+ metadata.gz: 14622e99341958cb8876efa74036f9f90eb27c77f10e24e59b3261c62d5c8b31
4
+ data.tar.gz: ea63088375c2c5c1010b267f38bf1b8acbc0e363bdd3cf33d4c6d762e47704bb
5
5
  SHA512:
6
- metadata.gz: '038a0936b7029bd2b73b557fa0a43ce6d4b22dfdb92bb98ca9d1c06dd5084528f74809244944b717dbcc41cecde1cba3b358b707fece9a6d62fa3e88b9a96c57'
7
- data.tar.gz: e2af9e16220b684ca29b79426918aed40c7cdb79ca90f85a72f0a9f7185dab4c21bb15d9cd279c322ccf78ad64f72d2e16462a6fa5abcc0d02e1c5b263781684
6
+ metadata.gz: bf5adecd962fd27a18c223c5852552b52a601230827cd761488ae7d62a8a745f013a62fc57d6ffba2b67c989e9c6cfb9436f76046d5b3159e5ac48d9aeb9f191
7
+ data.tar.gz: e51874283d799826c161c52ce091597c60b1583521d8e63b57341c61064241710611dd41aa7d4adbd7db2ef17a26e5ac0c5adb41920f1b04ca8fd86a9add4153
@@ -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
- ### New Features
8
- * [#28](https://github.com/Shopify/deprecation_toolkit/pull/28): `Configuration.allowed_deprecations now accepts Procs.
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)
@@ -1,13 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- deprecation_toolkit (1.1.0)
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)
@@ -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
- else
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
@@ -9,6 +9,7 @@ module DeprecationToolkit
9
9
 
10
10
  class_attribute :deprecations
11
11
  self.deprecations = []
12
+ delegate :size, to: :deprecations
12
13
 
13
14
  class << self
14
15
  def collect(message)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DeprecationToolkit
4
- VERSION = "1.1.0"
4
+ VERSION = "1.2.0"
5
5
  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.1.0
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-13 00:00:00.000000000 Z
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.14
128
+ rubygems_version: 2.7.6
126
129
  signing_key:
127
130
  specification_version: 4
128
131
  summary: Deprecation Toolkit around ActiveSupport::Deprecation