deprecation_toolkit 2.2.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 562db3c54971f9c7513f6777b6b351325772a467f3a12b9467aee8ae09faea7b
4
- data.tar.gz: 5d8bfeb8af3b883747c4b72a168e7504080f9e87260b65a67f9ecabe99071016
3
+ metadata.gz: 1d780d3c9ef2ad886d0d267a6a3d7e6e5b335cdfef2bb47ea462f285e975e703
4
+ data.tar.gz: 51eb2e75cee43f91cfa3834baa9640b7c487b1e2b4d6ed8a62c714df84fe4c5c
5
5
  SHA512:
6
- metadata.gz: 4a801c1cd12e35a705b89ecb7e3f2863be8ef488f29efb8537f7a858d86f68355cd571f22e4b16cd8b50b3c08b7b63e6ac187a12e9bcda184f268b41695b2a14
7
- data.tar.gz: 940e38840d651bd4cb2432b8d99c0cbdd78257fc8a5cce2175c60fbd40c0bca45a4ad66e6201e3699fdaaf4b6867c7c02257762dec942e1a3b1e29fd89bef9b0
6
+ metadata.gz: 2bdc3a73e47cd1341ff4cf34285d73ae5872b27a41343ae34fe447c502c979e1fb7c45dbde21eb4f590590770d2351c4c187b8a80a8310e27fb468874434bd80
7
+ data.tar.gz: 31c99027dc40530906abeb3dfded92f5672e25710ad0d7fcf32965a22c063b36bcb2ffbdb53af5f995b9b46ff5dd0d9a03211af2482997af3557cf773d0490e8
data/README.md CHANGED
@@ -57,16 +57,16 @@ This gem provides 4 behaviors, the default one being `DeprecationToolkit::Behavi
57
57
  DeprecationToolkit::Configuration.behavior = DeprecationToolkit::Behaviors::Record
58
58
  ```
59
59
 
60
- You can also create your own behavior class and perform the logic you want. Your behavior needs to respond to `.trigger`.
60
+ You can also create your own behavior object and perform the logic you want. Your behavior needs to respond to `trigger`.
61
61
 
62
62
  ```ruby
63
63
  class StatsdBehavior
64
- def self.trigger(test, deprecations, recorded_deprecations)
64
+ def trigger(test, deprecations, recorded_deprecations)
65
65
  # Could send some statsd event for example
66
66
  end
67
67
  end
68
68
 
69
- DeprecationToolkit::Configuration.behavior = StatsdBehavior
69
+ DeprecationToolkit::Configuration.behavior = StatsdBehavior.new
70
70
  ```
71
71
 
72
72
  #### DeprecationToolkit::Behaviors::CIRecordHelper
@@ -75,7 +75,7 @@ This is a special type of behaviour meant to help you record deprecations if you
75
75
  Imagine if you have thousands of tests and need to record deprecations for each on your machine, this is going to take ages.
76
76
  Recording deprecations on CI with the regular `Record` behavior isn't possible because of the way CI parallelize test in multiple container (Multiple tests from the same file runs in parallel in diferrent machines, the deprecation files that get created are then splitted. Regrouping them is a nightmare.)
77
77
 
78
- This behaviour will output a JSON representation of your deprecations. Your CI should have a way to download the log generated from the test run. Download it on your locale machine. Finally run the rake task `FILEPATH=<path_to_downloaded_log> deprecation_toolkit:record_from_ci_output`.
78
+ This behavior will output a JSON representation of your deprecations. Your CI should have a way to download the log generated from the test run. Download it on your locale machine. Finally run the rake task `FILEPATH=<path_to_downloaded_log> deprecation_toolkit:record_from_ci_output`.
79
79
  This task will parse your CI log and grab the output generated by the DeprecationToolkit and will finally convert everything back to YML files.
80
80
 
81
81
  ### 🔨 `#DeprecationToolkit::Configuration#allowed_deprecations`
@@ -170,6 +170,25 @@ It's possible to record deprecations while running your specs by adding an ENV['
170
170
  DEPRECATION_BEHAVIOR="record" bundle exec rspec path/to/file_spec.rb
171
171
  ```
172
172
 
173
+ ## Usage without Rails
174
+
175
+ Without Rails, you'll need to make sure your `ActiveSupport::Deprecation` instances use the [`:notify` behavior](https://api.rubyonrails.org/classes/ActiveSupport/Deprecation/Behavior.html#method-i-behavior-3D) and the `attach_to` is the underscored version of the deprecator's `gem_name` (this is how the `:notify` behavior works):
176
+
177
+ ```ruby
178
+ # defined in the gem:
179
+ MyGem.deprecator = ActiveSupport::Deprecation.new("2.0", "MyGem::Something")
180
+
181
+ # in the test helper:
182
+ MyGem.deprecator.behavior = :notify
183
+
184
+ DeprecationToolkit::Configuration.configure do |config|
185
+ config.attach_to = MyGem.deprecator.gem_name.underscore.tr("/", "_")
186
+ # or more simply
187
+ # config.attach_to = "my_gem_something"
188
+ config.behavior = :notify
189
+ end
190
+ ```
191
+
173
192
  ## License
174
193
 
175
194
  Deprecation Toolkit is licensed under the [MIT license](LICENSE.txt).
@@ -4,12 +4,13 @@ require "json"
4
4
 
5
5
  module DeprecationToolkit
6
6
  module Behaviors
7
- class CIRecordHelper
7
+ module CIRecordHelper
8
+ extend self
8
9
  extend ReadWriteHelper
9
10
 
10
11
  HEADER = "[DeprecationToolkit]"
11
12
 
12
- def self.trigger(test, current_deprecations, _recorded_deprecations)
13
+ def trigger(test, current_deprecations, _recorded_deprecations)
13
14
  filename = recorded_deprecations_path(test)
14
15
 
15
16
  to_output = {
@@ -2,8 +2,10 @@
2
2
 
3
3
  module DeprecationToolkit
4
4
  module Behaviors
5
- class Disabled
6
- def self.trigger(*)
5
+ module Disabled
6
+ extend self
7
+
8
+ def trigger(*)
7
9
  end
8
10
  end
9
11
  end
@@ -2,8 +2,10 @@
2
2
 
3
3
  module DeprecationToolkit
4
4
  module Behaviors
5
- class Raise
6
- def self.trigger(_test, current_deprecations, recorded_deprecations)
5
+ module Raise
6
+ extend self
7
+
8
+ def trigger(_test, current_deprecations, recorded_deprecations)
7
9
  error_class = if current_deprecations.size > recorded_deprecations.size
8
10
  DeprecationIntroduced
9
11
  elsif current_deprecations.size < recorded_deprecations.size
@@ -32,7 +34,9 @@ module DeprecationToolkit
32
34
  You have introduced new deprecations in the codebase. Fix or record them in order to discard this error.
33
35
  #{record_message}
34
36
 
37
+ ******* The following deprecations were added: *******
35
38
  #{introduced_deprecations.join("\n")}
39
+ ******************************************************
36
40
  EOM
37
41
 
38
42
  super(message)
@@ -55,7 +59,9 @@ module DeprecationToolkit
55
59
  The recorded deprecations needs to be updated to reflect your changes.
56
60
  #{record_message}
57
61
 
62
+ ****** The following deprecations were removed: ******
58
63
  #{removed_deprecations.join("\n")}
64
+ ******************************************************
59
65
  EOM
60
66
 
61
67
  super(message)
@@ -2,10 +2,11 @@
2
2
 
3
3
  module DeprecationToolkit
4
4
  module Behaviors
5
- class Record
5
+ module Record
6
+ extend self
6
7
  extend ReadWriteHelper
7
8
 
8
- def self.trigger(test, collector, _)
9
+ def trigger(test, collector, _)
9
10
  deprecation_file = recorded_deprecations_path(test)
10
11
 
11
12
  write(deprecation_file, test_name(test) => collector.deprecations_without_stacktrace)
@@ -65,11 +65,7 @@ module DeprecationToolkit
65
65
  private
66
66
 
67
67
  def active_support_deprecation_sub_params
68
- if ActiveSupport.gem_version.to_s < "5.0"
69
- [/\W\s\(called from .*\)$/, ""]
70
- else
71
- [/ \(called from .*\)$/, ""]
72
- end
68
+ [/ \(called from .*\)$/, ""]
73
69
  end
74
70
 
75
71
  def gem_deprecate_sub_params
@@ -1,24 +1,41 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "active_support/configurable"
4
-
5
3
  module DeprecationToolkit
6
- class Configuration
7
- include ActiveSupport::Configurable
8
-
9
- config_accessor(:allowed_deprecations) { [] }
10
- config_accessor(:attach_to) { [:rails] }
11
- config_accessor(:behavior) { Behaviors::Raise }
12
- config_accessor(:deprecation_path) { "test/deprecations" }
13
- config_accessor(:test_runner) { :minitest }
14
- config_accessor(:warnings_treated_as_deprecation) { [] }
15
- config_accessor(:deprecation_file_path_format) do
16
- proc do |test|
17
- if DeprecationToolkit::Configuration.test_runner == :rspec
18
- test.example_group.file_path.sub(%r{^./spec/}, "").sub(/_spec.rb$/, "")
19
- else
20
- test.class.name.underscore
21
- end
4
+ module Configuration
5
+ @allowed_deprecations = []
6
+ singleton_class.attr_accessor(:allowed_deprecations)
7
+
8
+ @attach_to = [:rails]
9
+ singleton_class.attr_accessor(:attach_to)
10
+
11
+ @behavior = Behaviors::Raise
12
+ singleton_class.attr_accessor(:behavior)
13
+
14
+ @deprecation_path = "test/deprecations"
15
+ singleton_class.attr_accessor(:deprecation_path)
16
+
17
+ @test_runner = :minitest
18
+ singleton_class.attr_accessor(:test_runner)
19
+
20
+ @warnings_treated_as_deprecation = []
21
+ singleton_class.attr_accessor(:warnings_treated_as_deprecation)
22
+
23
+ @deprecation_file_path_format = proc do |test|
24
+ if DeprecationToolkit::Configuration.test_runner == :rspec
25
+ test.example_group.file_path.sub(%r{^./spec/}, "").sub(/_spec.rb$/, "")
26
+ else
27
+ test.class.name.underscore
28
+ end
29
+ end
30
+ singleton_class.attr_accessor(:deprecation_file_path_format)
31
+
32
+ class << self
33
+ def configure
34
+ yield self
35
+ end
36
+
37
+ def config
38
+ self
22
39
  end
23
40
  end
24
41
  end
@@ -4,8 +4,56 @@ require "active_support/subscriber"
4
4
 
5
5
  module DeprecationToolkit
6
6
  class DeprecationSubscriber < ActiveSupport::Subscriber
7
- def self.already_attached?
8
- notifier != nil
7
+ class << self
8
+ def attach_to(gem_name, subscriber = new, notifier = ActiveSupport::Notifications, inherit_all: false)
9
+ return if already_attached_to?(gem_name)
10
+
11
+ super(gem_name, subscriber, notifier, inherit_all: inherit_all)
12
+ end
13
+
14
+ def detach_from(gem_name, notifier = ActiveSupport::Notifications)
15
+ @namespace = gem_name
16
+ @subscriber = find_attached_subscriber(gem_name)
17
+ @notifier = notifier
18
+
19
+ return unless subscriber
20
+
21
+ subscribers.delete(subscriber)
22
+
23
+ # Remove event subscribers of all existing methods on the class.
24
+ fetch_public_methods(subscriber, true).each do |event|
25
+ remove_event_subscriber(event)
26
+ end
27
+
28
+ @notifier = nil unless any_subscribers_attached?
29
+ end
30
+
31
+ private
32
+
33
+ def already_attached_to?(gem_name)
34
+ subscribers.any? do |subscriber|
35
+ attached_subscriber?(subscriber, gem_name)
36
+ end
37
+ end
38
+
39
+ def any_subscribers_attached?
40
+ subscribers.any? do |subscriber|
41
+ subscriber.is_a?(self)
42
+ end
43
+ end
44
+
45
+ def find_attached_subscriber(gem_name)
46
+ subscribers.find do |attached_subscriber|
47
+ attached_subscriber?(attached_subscriber, gem_name)
48
+ end
49
+ end
50
+
51
+ def attached_subscriber?(subscriber, gem_name)
52
+ subscriber.is_a?(self) &&
53
+ subscriber.patterns.keys.any? do |pattern|
54
+ pattern.end_with?(".#{gem_name}")
55
+ end
56
+ end
9
57
  end
10
58
 
11
59
  def deprecation(event)
@@ -17,10 +65,13 @@ module DeprecationToolkit
17
65
  private
18
66
 
19
67
  def deprecation_allowed?(payload)
20
- allowed_deprecations, procs = Configuration.allowed_deprecations.partition { |el| el.is_a?(Regexp) }
21
-
22
- allowed_deprecations.any? { |regex| regex =~ payload[:message] } ||
23
- procs.any? { |proc| proc.call(payload[:message], payload[:callstack]) }
68
+ Configuration.allowed_deprecations.any? do |rule|
69
+ if rule.is_a?(Regexp)
70
+ rule.match?(payload[:message])
71
+ else
72
+ rule.call(payload[:message], payload[:callstack])
73
+ end
74
+ end
24
75
  end
25
76
  end
26
77
  end
@@ -15,32 +15,29 @@ module DeprecationToolkit
15
15
  end
16
16
 
17
17
  def write(deprecation_file, deprecations_to_record)
18
- create_deprecation_file(deprecation_file) unless deprecation_file.exist?
18
+ original_deprecations = deprecation_file.exist? ? YAML.load_file(deprecation_file) : {}
19
+ updated_deprecations = original_deprecations.dup
19
20
 
20
- content = YAML.load_file(deprecation_file)
21
-
22
- deprecations_to_record.each do |test, deprecations|
23
- if deprecations.any?
24
- content[test] = deprecations
21
+ deprecations_to_record.each do |test, deprecation_to_record|
22
+ if deprecation_to_record.any?
23
+ updated_deprecations[test] = deprecation_to_record
25
24
  else
26
- content.delete(test)
25
+ updated_deprecations.delete(test)
27
26
  end
28
27
  end
29
28
 
30
- if content.any?
31
- deprecation_file.write(YAML.dump(content))
32
- else
29
+ if updated_deprecations.any?
30
+ if updated_deprecations != original_deprecations
31
+ deprecation_file.dirname.mkpath
32
+ deprecation_file.write(YAML.dump(updated_deprecations.sort.to_h))
33
+ end
34
+ elsif deprecation_file.exist?
33
35
  deprecation_file.delete
34
36
  end
35
37
  end
36
38
 
37
39
  private
38
40
 
39
- def create_deprecation_file(deprecation_file)
40
- deprecation_file.dirname.mkpath
41
- deprecation_file.write(YAML.dump({}))
42
- end
43
-
44
41
  def recorded_deprecations_path(test)
45
42
  deprecation_folder = if Configuration.deprecation_path.is_a?(Proc)
46
43
  Configuration.deprecation_path.call(test_location(test))
@@ -2,7 +2,9 @@
2
2
 
3
3
  module DeprecationToolkit
4
4
  module TestTriggerer
5
- def self.trigger_deprecation_toolkit_behavior(test)
5
+ extend self
6
+
7
+ def trigger_deprecation_toolkit_behavior(test)
6
8
  current_deprecations = DeprecationToolkit::Collector.new(DeprecationToolkit::Collector.deprecations)
7
9
  recorded_deprecations = DeprecationToolkit::Collector.load(test)
8
10
  if !recorded_deprecations.flaky? && current_deprecations != recorded_deprecations
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DeprecationToolkit
4
- VERSION = "2.2.0"
4
+ VERSION = "2.3.0"
5
5
  end
@@ -48,11 +48,13 @@ module DeprecationToolkit
48
48
  end
49
49
  end
50
50
  end
51
- end
52
51
 
53
- module DeprecationToolkit
54
52
  module WarningPatch
55
53
  def warn(str, *)
54
+ if Configuration.warnings_treated_as_deprecation.empty?
55
+ return super
56
+ end
57
+
56
58
  str = DeprecationToolkit::Warning.handle_multipart(str)
57
59
  return unless str
58
60
 
@@ -64,5 +66,6 @@ module DeprecationToolkit
64
66
  end
65
67
  ruby2_keywords :warn
66
68
  end
69
+
70
+ ::Warning.singleton_class.prepend(WarningPatch)
67
71
  end
68
- Warning.singleton_class.prepend(DeprecationToolkit::WarningPatch)
@@ -16,6 +16,9 @@ module DeprecationToolkit
16
16
  autoload :Raise, "deprecation_toolkit/behaviors/raise"
17
17
  autoload :Record, "deprecation_toolkit/behaviors/record"
18
18
  autoload :CIRecordHelper, "deprecation_toolkit/behaviors/ci_record_helper"
19
+ autoload :DeprecationIntroduced, "deprecation_toolkit/behaviors/raise"
20
+ autoload :DeprecationRemoved, "deprecation_toolkit/behaviors/raise"
21
+ autoload :DeprecationMismatch, "deprecation_toolkit/behaviors/raise"
19
22
  end
20
23
 
21
24
  class << self
@@ -32,8 +35,6 @@ module DeprecationToolkit
32
35
  end
33
36
 
34
37
  def attach_subscriber
35
- return if DeprecationSubscriber.already_attached?
36
-
37
38
  Configuration.attach_to.each do |gem_name|
38
39
  DeprecationSubscriber.attach_to(gem_name)
39
40
  end
@@ -44,7 +45,7 @@ module DeprecationToolkit
44
45
  def each_deprecator(&block)
45
46
  if defined?(Rails.application) && Rails.application.respond_to?(:deprecators)
46
47
  Rails.application.deprecators.each(&block)
47
- else
48
+ elsif ActiveSupport::Deprecation.respond_to?(:behavior)
48
49
  block.call(ActiveSupport::Deprecation)
49
50
  end
50
51
  end
@@ -14,6 +14,10 @@ module Minitest
14
14
 
15
15
  require "deprecation_toolkit"
16
16
 
17
+ setup_deprecation_toolkit(options)
18
+ end
19
+
20
+ def setup_deprecation_toolkit(options)
17
21
  if options[:record_deprecations]
18
22
  DeprecationToolkit::Configuration.behavior = DeprecationToolkit::Behaviors::Record
19
23
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deprecation_toolkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-02-05 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: activesupport
@@ -16,32 +15,22 @@ dependencies:
16
15
  requirements:
17
16
  - - ">="
18
17
  - !ruby/object:Gem::Version
19
- version: '6.1'
18
+ version: '7.0'
20
19
  type: :runtime
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
23
  - - ">="
25
24
  - !ruby/object:Gem::Version
26
- version: '6.1'
27
- description:
25
+ version: '7.0'
28
26
  email:
29
27
  - rails@shopify.com
30
28
  executables: []
31
29
  extensions: []
32
30
  extra_rdoc_files: []
33
31
  files:
34
- - ".gitignore"
35
- - ".rspec"
36
- - ".rubocop.yml"
37
- - CHANGELOG.md
38
- - Gemfile
39
- - Gemfile.lock
40
32
  - LICENSE.txt
41
33
  - README.md
42
- - RELEASE.md
43
- - Rakefile
44
- - deprecation_toolkit.gemspec
45
34
  - lib/deprecation_toolkit.rb
46
35
  - lib/deprecation_toolkit/behaviors/ci_record_helper.rb
47
36
  - lib/deprecation_toolkit/behaviors/disabled.rb
@@ -59,16 +48,14 @@ files:
59
48
  - lib/deprecation_toolkit/warning.rb
60
49
  - lib/minitest/deprecation_toolkit_plugin.rb
61
50
  - lib/tasks/ci_recorder.rake
62
- - shipit.rubygems.yml
63
51
  homepage: https://github.com/shopify/deprecation_toolkit
64
52
  licenses:
65
53
  - MIT
66
54
  metadata:
67
55
  homepage_uri: https://github.com/shopify/deprecation_toolkit
68
- source_code_uri: https://github.com/shopify/deprecation_toolkit
56
+ source_code_uri: https://github.com/Shopify/deprecation_toolkit/tree/v2.3.0
69
57
  changelog_uri: https://github.com/Shopify/deprecation_toolkit/blob/main/CHANGELOG.md
70
58
  allowed_push_host: https://rubygems.org
71
- post_install_message:
72
59
  rdoc_options: []
73
60
  require_paths:
74
61
  - lib
@@ -76,15 +63,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
76
63
  requirements:
77
64
  - - ">="
78
65
  - !ruby/object:Gem::Version
79
- version: '2.7'
66
+ version: 3.2.0
80
67
  required_rubygems_version: !ruby/object:Gem::Requirement
81
68
  requirements:
82
69
  - - ">="
83
70
  - !ruby/object:Gem::Version
84
71
  version: '0'
85
72
  requirements: []
86
- rubygems_version: 3.5.5
87
- signing_key:
73
+ rubygems_version: 3.7.2
88
74
  specification_version: 4
89
75
  summary: Deprecation Toolkit around ActiveSupport::Deprecation
90
76
  test_files: []
data/.gitignore DELETED
@@ -1,10 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
9
- /.byebug_history
10
- gemfiles/*.lock
data/.rspec DELETED
@@ -1,4 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
4
-
data/.rubocop.yml DELETED
@@ -1,16 +0,0 @@
1
- inherit_gem:
2
- rubocop-shopify: rubocop.yml
3
-
4
- AllCops:
5
- TargetRubyVersion: 2.6
6
- SuggestExtensions: false
7
- Exclude:
8
- - gemfiles/vendor/**/*
9
-
10
- Style/MethodCallWithArgsParentheses:
11
- Exclude:
12
- - Gemfile
13
- - gemfiles/*
14
-
15
- Style/CaseEquality:
16
- Enabled: false
data/CHANGELOG.md DELETED
@@ -1,85 +0,0 @@
1
- # Change log
2
-
3
- ## main (unreleased)
4
-
5
- ## 2.2.0 (2024-02-05)
6
-
7
- * Restore Rails 6.1 compatibility.
8
- * Accept anything that responds to `===` in `Configuration.warnings_treated_as_deprecation`.
9
-
10
- ## 2.1.0 (2024-01-19)
11
-
12
- * [#99](https://github.com/Shopify/deprecation_toolkit/pull/99): Fix `Warning.warn` hook to accept a category.
13
- * [#95](https://github.com/Shopify/deprecation_toolkit/pull/95): Allow configuration of deprecation file paths and file names.
14
-
15
- ## 2.0.4 (2023-11-20)
16
-
17
- * [#90](https://github.com/Shopify/deprecation_toolkit/pull/90) & [#93](https://github.com/Shopify/deprecation_toolkit/pull/93): Stop using deprecated behavior from Active Support. (@etiennebarrie)
18
- * [#91](https://github.com/Shopify/deprecation_toolkit/pull/91): Require necessary Active Support core extension. (@etiennebarrie)
19
-
20
- ## 2.0.3 (2023-02-10)
21
-
22
- * [#80](https://github.com/Shopify/deprecation_toolkit/pull/80): Filter out stack trace from Gem::Deprecate deprecation messages (@davidstosik)
23
-
24
- ## 2.0.2 (2023-02-08)
25
-
26
- * [#78](https://github.com/Shopify/deprecation_toolkit/pull/78): Show deprecations without stacktrace. (@shioyama)
27
-
28
- ## 2.0.1 (2022-11-18)
29
-
30
- * [#74](https://github.com/Shopify/deprecation_toolkit/pull/74): Add support for `Rails.application.deprecators`. (@gmcgibbon)
31
-
32
- ## 2.0.0 (2022-03-16)
33
-
34
- * [#58](https://github.com/Shopify/deprecation_toolkit/pull/58): Drop support for Ruby < 2.6 & Active Support < 5.2. (@sambostock)
35
- * [#58](https://github.com/Shopify/deprecation_toolkit/pull/58): Ensure compatibility with Rails 7. (@sambostock)
36
-
37
- ## 1.5.1 (2020-04-28)
38
-
39
- * [#46](https://github.com/Shopify/deprecation_toolkit/pull/46): Handle another two part Ruby 2.7 keyword argument deprecation warning. (@casperisfine)
40
-
41
- ## 1.5.0 (2020-04-14)
42
-
43
- * [#42](https://github.com/Shopify/deprecation_toolkit/pull/42): Fix Minitest plugin kicking in when it shouldn't. (@Edouard-chin)
44
- * [#45](https://github.com/Shopify/deprecation_toolkit/pull/45): Handle two part Ruby 2.7 keyword argument deprecation warning. (@casperisfine)
45
-
46
- ## 1.4.0 (2019-04-29)
47
-
48
- * [#37](https://github.com/Shopify/deprecation_toolkit/pull/37): Add Rspec support. (@andrewmarkle)
49
-
50
- ## 1.3.0 (2019-02-28)
51
-
52
- * [#38](https://github.com/Shopify/deprecation_toolkit/pull/38): Add a way to mark test as flaky. (@Edouard-chin)
53
- * [#39](https://github.com/Shopify/deprecation_toolkit/pull/39): Introduced a way to help recording massive amount of deprecations. (@Edouard-chin)
54
-
55
- ## 1.2.1 (2019-01-09)
56
-
57
- ### Bug fixes
58
- * [#34](https://github.com/Shopify/deprecation_toolkit/pull/34): Fixes SystemStackError with RubyGems v3 and Ruby 2.5+. (@dylanahsmith)
59
-
60
- ## 1.2.0 (2018-11-28)
61
-
62
- ### New features
63
-
64
- * [#30](https://github.com/Shopify/deprecation_toolkit/pull/30): Introduce a `DeprecationMismatch` error class. (@Edouard-chin)
65
- ### Bug fixes
66
- * [#29](https://github.com/Shopify/deprecation_toolkit/pull/29): Fix issue where the error class triggered was incorrect in some circumstances. (@Edouard-chin)
67
-
68
- ## 1.1.0 (2018-11-13)
69
-
70
- ### New features
71
-
72
- * [#28](https://github.com/Shopify/deprecation_toolkit/pull/28): `Configuration.allowed_deprecations` now accepts Procs.
73
- This is useful if you need to whitelist deprecations based on the caller.
74
-
75
- ## 1.0.3 (2018-10-25)
76
-
77
- ### Bug fixes
78
-
79
- * [#22](https://github.com/Shopify/deprecation_toolkit/pull/22): Fixes `Kernel.warn` not triggering deprecation. (@rmacklin)
80
-
81
- ## 1.0.2 (2018-10-01)
82
-
83
- ### New features
84
-
85
- * [#15](https://github.com/Shopify/deprecation_toolkit/pull/15): Add support for ActiveSupport 4.2. (@andrewmarkle)
data/Gemfile DELETED
@@ -1,17 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source "https://rubygems.org"
4
-
5
- gemspec
6
-
7
- gem "bundler"
8
- gem "minitest"
9
- gem "rake"
10
- gem "rspec"
11
- gem "rubocop-shopify"
12
-
13
- if defined?(@activesupport_gem_requirement) && @activesupport_gem_requirement
14
- # causes Dependabot to ignore the next line
15
- activesupport = "activesupport"
16
- gem activesupport, @activesupport_gem_requirement
17
- end
data/Gemfile.lock DELETED
@@ -1,83 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- deprecation_toolkit (2.2.0)
5
- activesupport (>= 6.1)
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- activesupport (7.1.2)
11
- base64
12
- bigdecimal
13
- concurrent-ruby (~> 1.0, >= 1.0.2)
14
- connection_pool (>= 2.2.5)
15
- drb
16
- i18n (>= 1.6, < 2)
17
- minitest (>= 5.1)
18
- mutex_m
19
- tzinfo (~> 2.0)
20
- ast (2.4.2)
21
- base64 (0.2.0)
22
- bigdecimal (3.1.4)
23
- concurrent-ruby (1.2.2)
24
- connection_pool (2.4.1)
25
- diff-lcs (1.5.0)
26
- drb (2.2.0)
27
- ruby2_keywords
28
- i18n (1.14.1)
29
- concurrent-ruby (~> 1.0)
30
- minitest (5.20.0)
31
- mutex_m (0.2.0)
32
- parallel (1.21.0)
33
- parser (3.1.1.0)
34
- ast (~> 2.4.1)
35
- rainbow (3.1.1)
36
- rake (13.0.6)
37
- regexp_parser (2.2.1)
38
- rexml (3.2.5)
39
- rspec (3.11.0)
40
- rspec-core (~> 3.11.0)
41
- rspec-expectations (~> 3.11.0)
42
- rspec-mocks (~> 3.11.0)
43
- rspec-core (3.11.0)
44
- rspec-support (~> 3.11.0)
45
- rspec-expectations (3.11.0)
46
- diff-lcs (>= 1.2.0, < 2.0)
47
- rspec-support (~> 3.11.0)
48
- rspec-mocks (3.11.0)
49
- diff-lcs (>= 1.2.0, < 2.0)
50
- rspec-support (~> 3.11.0)
51
- rspec-support (3.11.0)
52
- rubocop (1.25.1)
53
- parallel (~> 1.10)
54
- parser (>= 3.1.0.0)
55
- rainbow (>= 2.2.2, < 4.0)
56
- regexp_parser (>= 1.8, < 3.0)
57
- rexml
58
- rubocop-ast (>= 1.15.1, < 2.0)
59
- ruby-progressbar (~> 1.7)
60
- unicode-display_width (>= 1.4.0, < 3.0)
61
- rubocop-ast (1.16.0)
62
- parser (>= 3.1.1.0)
63
- rubocop-shopify (2.5.0)
64
- rubocop (~> 1.25)
65
- ruby-progressbar (1.11.0)
66
- ruby2_keywords (0.0.5)
67
- tzinfo (2.0.6)
68
- concurrent-ruby (~> 1.0)
69
- unicode-display_width (2.1.0)
70
-
71
- PLATFORMS
72
- ruby
73
-
74
- DEPENDENCIES
75
- bundler
76
- deprecation_toolkit!
77
- minitest
78
- rake
79
- rspec
80
- rubocop-shopify
81
-
82
- BUNDLED WITH
83
- 2.4.4
data/RELEASE.md DELETED
@@ -1,21 +0,0 @@
1
- # Contribution to Deprecation Toolkit
2
-
3
- ## Releasing a new version
4
-
5
- 1. Audit PRs and commits merged since the last release, ensuring **all user fancing changes are documented** in `CHANGELOG.md`.
6
- 2. Based on the changes, determine whether to increment the major, minor, or patch version, adhering to [Semantic Versioning][semver].
7
- 3. Update the gem version string accordingly in `lib/deprecation_toolkit/version.rb`.
8
- 4. Run `bundle install` to update the `Gemfile.lock`.
9
- 5. Insert a new heading in `CHANGELOG.md` containing the version identifier and expected release date (e.g. `## 1.2.3 (1999-12-31)`).
10
- 6. Commit changes on a new branch and open a PR.
11
- 7. **Draft** a [new release][github-new-release] on GitHub, but **do not publish it yet**.
12
- 8. Once you have received approval on your PR, merge it into `main`.
13
- 9. Deploy using the [ShipIt][shipit] UI, and **verify** the new version is available on [RubyGems][rubygems].
14
- 10. Publish the drafted release, tagging the deployed commit (should be `HEAD` of the `main` branch) with a tag of the form `vMAJOR.MINOR.PATCH`.
15
-
16
- If something goes wrong during the deploy process, address it and tag whatever commit was successfully deployed as that version.
17
-
18
- [semver]: https://semver.org
19
- [github-new-release]: https://github.com/Shopify/deprecation_toolkit/releases/new
20
- [shipit]: https://shipit.shopify.io/shopify/deprecation_toolkit/rubygems
21
- [rubygems]: https://rubygems.org/gems/deprecation_toolkit/versions
data/Rakefile DELETED
@@ -1,13 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "bundler/gem_tasks"
4
- require "rake/testtask"
5
-
6
- Rake::TestTask.new(:test) do |t|
7
- t.libs << "test"
8
- t.libs << "lib"
9
- t.warning = true
10
- t.test_files = FileList["test/**/*_test.rb"]
11
- end
12
-
13
- task(default: :test)
@@ -1,31 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- lib = File.expand_path("lib", __dir__)
4
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
- require "deprecation_toolkit/version"
6
-
7
- Gem::Specification.new do |spec|
8
- spec.name = "deprecation_toolkit"
9
- spec.version = DeprecationToolkit::VERSION
10
- spec.authors = ["Shopify"]
11
- spec.email = ["rails@shopify.com"]
12
-
13
- spec.summary = "Deprecation Toolkit around ActiveSupport::Deprecation"
14
- spec.homepage = "https://github.com/shopify/deprecation_toolkit"
15
- spec.license = "MIT"
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/main/CHANGELOG.md"
20
-
21
- spec.metadata["allowed_push_host"] = "https://rubygems.org"
22
-
23
- spec.required_ruby_version = ">= 2.7"
24
-
25
- spec.files = %x(git ls-files -z).split("\x0").reject do |f|
26
- f.match(%r{^(test|spec|\.github|gemfiles)/})
27
- end
28
- spec.require_paths = ["lib"]
29
-
30
- spec.add_runtime_dependency("activesupport", ">= 6.1")
31
- end
data/shipit.rubygems.yml DELETED
@@ -1 +0,0 @@
1
- # using the default shipit config