deprecation_toolkit 1.5.1 → 2.0.1
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 +4 -4
- data/.github/workflows/ci.yml +50 -0
- data/.github/workflows/cla.yml +26 -0
- data/.rubocop.yml +3 -3
- data/CHANGELOG.md +21 -1
- data/Gemfile +11 -4
- data/Gemfile.lock +47 -45
- data/README.md +11 -9
- data/RELEASE.md +21 -0
- data/deprecation_toolkit.gemspec +6 -11
- data/gemfiles/activesupport_5.2.gemfile +2 -8
- data/gemfiles/activesupport_6.0.gemfile +2 -8
- data/gemfiles/activesupport_6.1.gemfile +5 -0
- data/gemfiles/activesupport_7.0.gemfile +5 -0
- data/gemfiles/activesupport_edge.gemfile +5 -0
- data/lib/deprecation_toolkit/behaviors/ci_record_helper.rb +2 -2
- data/lib/deprecation_toolkit/collector.rb +1 -1
- data/lib/deprecation_toolkit/deprecation_subscriber.rb +1 -1
- data/lib/deprecation_toolkit/rspec_plugin.rb +1 -1
- data/lib/deprecation_toolkit/version.rb +1 -1
- data/lib/deprecation_toolkit/warning.rb +11 -36
- data/lib/deprecation_toolkit.rb +29 -15
- data/lib/minitest/deprecation_toolkit_plugin.rb +3 -2
- data/lib/tasks/ci_recorder.rake +10 -9
- data/spec/deprecation_toolkit/behaviors/disabled_spec.rb +2 -2
- data/spec/deprecation_toolkit/behaviors/raise_spec.rb +4 -4
- data/spec/deprecation_toolkit/behaviors/record_spec.rb +1 -1
- data/spec/rspec/plugin_env_options_spec.rb +3 -3
- data/spec/rspec/plugin_spec.rb +1 -1
- metadata +13 -65
- data/.rubocop-https---shopify-github-io-ruby-style-guide-rubocop-yml +0 -1017
- data/.travis.yml +0 -18
data/lib/tasks/ci_recorder.rake
CHANGED
@@ -1,20 +1,20 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require
|
6
|
-
require
|
7
|
-
require_relative
|
3
|
+
require "tempfile"
|
4
|
+
require "json"
|
5
|
+
require "active_support/core_ext/hash"
|
6
|
+
require "rake"
|
7
|
+
require_relative "../deprecation_toolkit/read_write_helper"
|
8
8
|
|
9
9
|
class CIRecorder
|
10
10
|
include Rake::DSL
|
11
11
|
include DeprecationToolkit::ReadWriteHelper
|
12
12
|
|
13
13
|
def initialize
|
14
|
-
namespace
|
15
|
-
desc
|
16
|
-
task
|
17
|
-
raw_file = ENV.fetch(
|
14
|
+
namespace(:deprecation_toolkit) do
|
15
|
+
desc("Parse a file generated with the CIOutputHelper and generate deprecations out of it")
|
16
|
+
task(:record_from_ci_output) do
|
17
|
+
raw_file = ENV.fetch("FILEPATH")
|
18
18
|
|
19
19
|
deprecations = extract_deprecations_output(raw_file) do |file|
|
20
20
|
parse_file(file)
|
@@ -32,6 +32,7 @@ class CIRecorder
|
|
32
32
|
shell_command = "cat #{file} | sed -n -e 's/^.* \\[DeprecationToolkit\\] \\(.*\\)/\\1/p' > #{tmp_file.path}"
|
33
33
|
|
34
34
|
raise "Couldn't extract deprecations from output" unless system(shell_command)
|
35
|
+
|
35
36
|
yield(tmp_file)
|
36
37
|
ensure
|
37
38
|
tmp_file.delete
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "spec_helper"
|
4
4
|
|
5
5
|
RSpec.describe(DeprecationToolkit::Behaviors::Raise) do
|
6
6
|
before do
|
@@ -12,7 +12,7 @@ RSpec.describe(DeprecationToolkit::Behaviors::Raise) do
|
|
12
12
|
DeprecationToolkit::Configuration.behavior = @previous_configuration
|
13
13
|
end
|
14
14
|
|
15
|
-
it
|
15
|
+
it ".trigger noop any deprecations" do |example|
|
16
16
|
expect do
|
17
17
|
ActiveSupport::Deprecation.warn("Foo")
|
18
18
|
ActiveSupport::Deprecation.warn("Bar")
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "spec_helper"
|
4
4
|
|
5
5
|
RSpec.describe(DeprecationToolkit::Behaviors::Raise) do
|
6
6
|
before do
|
@@ -29,7 +29,7 @@ RSpec.describe(DeprecationToolkit::Behaviors::Raise) do
|
|
29
29
|
end.to(raise_error(DeprecationToolkit::Behaviors::DeprecationRemoved))
|
30
30
|
end
|
31
31
|
|
32
|
-
it
|
32
|
+
it ".trigger raises a DeprecationRemoved when mismatched and less than expected" do |example|
|
33
33
|
expect do
|
34
34
|
ActiveSupport::Deprecation.warn("C")
|
35
35
|
|
@@ -37,7 +37,7 @@ RSpec.describe(DeprecationToolkit::Behaviors::Raise) do
|
|
37
37
|
end.to(raise_error(DeprecationToolkit::Behaviors::DeprecationRemoved))
|
38
38
|
end
|
39
39
|
|
40
|
-
it
|
40
|
+
it ".trigger raises a DeprecationMismatch when same number of deprecations are triggered with mismatches" do |example|
|
41
41
|
expect do
|
42
42
|
ActiveSupport::Deprecation.warn("A")
|
43
43
|
|
@@ -69,7 +69,7 @@ RSpec.describe(DeprecationToolkit::Behaviors::Raise) do
|
|
69
69
|
end
|
70
70
|
|
71
71
|
it ".trigger does not raise when deprecations are allowed with Procs" do |example|
|
72
|
-
class_eval <<-RUBY,
|
72
|
+
class_eval <<-RUBY, "my_file.rb", 1337
|
73
73
|
def deprecation_caller
|
74
74
|
deprecation_callee
|
75
75
|
end
|
@@ -18,7 +18,7 @@ RSpec.describe(DeprecationToolkit::Behaviors::Record) do
|
|
18
18
|
FileUtils.rm_rf(@deprecation_path)
|
19
19
|
end
|
20
20
|
|
21
|
-
it
|
21
|
+
it ".trigger should record deprecations" do |example|
|
22
22
|
expect_deprecations_recorded("Foo", "Bar", example) do
|
23
23
|
ActiveSupport::Deprecation.warn("Foo")
|
24
24
|
ActiveSupport::Deprecation.warn("Bar")
|
@@ -2,12 +2,12 @@
|
|
2
2
|
|
3
3
|
# This needs to be set before we require `spec_helper` to simulate setting an ENV when running a spec like:
|
4
4
|
# `DEPRECATION_BEHAVIOR="record" bundle exec rspec path/to/spec.rb`
|
5
|
-
ENV[
|
5
|
+
ENV["DEPRECATION_BEHAVIOR"] = "record"
|
6
6
|
|
7
|
-
require
|
7
|
+
require "spec_helper"
|
8
8
|
|
9
9
|
RSpec.describe("DeprecationToolkit::RSpecPlugin ENV options") do
|
10
|
-
it
|
10
|
+
it "should set the behavior to `Record` when ENV variable is set" do
|
11
11
|
expect(DeprecationToolkit::Configuration.behavior).to(eq(DeprecationToolkit::Behaviors::Record))
|
12
12
|
end
|
13
13
|
end
|
data/spec/rspec/plugin_spec.rb
CHANGED
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:
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,70 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '5.2'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: bundler
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '1.16'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '1.16'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rake
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '10.0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '10.0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: minitest
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '5.0'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '5.0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: rspec
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - "~>"
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '3.0'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - "~>"
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '3.0'
|
26
|
+
version: '5.2'
|
83
27
|
description:
|
84
28
|
email:
|
85
29
|
- rails@shopify.com
|
@@ -87,20 +31,24 @@ executables: []
|
|
87
31
|
extensions: []
|
88
32
|
extra_rdoc_files: []
|
89
33
|
files:
|
34
|
+
- ".github/workflows/ci.yml"
|
35
|
+
- ".github/workflows/cla.yml"
|
90
36
|
- ".gitignore"
|
91
37
|
- ".rspec"
|
92
|
-
- ".rubocop-https---shopify-github-io-ruby-style-guide-rubocop-yml"
|
93
38
|
- ".rubocop.yml"
|
94
|
-
- ".travis.yml"
|
95
39
|
- CHANGELOG.md
|
96
40
|
- Gemfile
|
97
41
|
- Gemfile.lock
|
98
42
|
- LICENSE.txt
|
99
43
|
- README.md
|
44
|
+
- RELEASE.md
|
100
45
|
- Rakefile
|
101
46
|
- deprecation_toolkit.gemspec
|
102
47
|
- gemfiles/activesupport_5.2.gemfile
|
103
48
|
- gemfiles/activesupport_6.0.gemfile
|
49
|
+
- gemfiles/activesupport_6.1.gemfile
|
50
|
+
- gemfiles/activesupport_7.0.gemfile
|
51
|
+
- gemfiles/activesupport_edge.gemfile
|
104
52
|
- gemfiles/spec/deprecations/deprecation_toolkit/behaviors/raise.yml
|
105
53
|
- gemfiles/test/deprecations
|
106
54
|
- lib/deprecation_toolkit.rb
|
@@ -134,7 +82,7 @@ licenses:
|
|
134
82
|
metadata:
|
135
83
|
homepage_uri: https://github.com/shopify/deprecation_toolkit
|
136
84
|
source_code_uri: https://github.com/shopify/deprecation_toolkit
|
137
|
-
changelog_uri: https://github.com/Shopify/deprecation_toolkit/blob/
|
85
|
+
changelog_uri: https://github.com/Shopify/deprecation_toolkit/blob/main/CHANGELOG.md
|
138
86
|
allowed_push_host: https://rubygems.org
|
139
87
|
post_install_message:
|
140
88
|
rdoc_options: []
|
@@ -144,14 +92,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
144
92
|
requirements:
|
145
93
|
- - ">="
|
146
94
|
- !ruby/object:Gem::Version
|
147
|
-
version: '2.
|
95
|
+
version: '2.6'
|
148
96
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
149
97
|
requirements:
|
150
98
|
- - ">="
|
151
99
|
- !ruby/object:Gem::Version
|
152
100
|
version: '0'
|
153
101
|
requirements: []
|
154
|
-
rubygems_version: 3.
|
102
|
+
rubygems_version: 3.3.3
|
155
103
|
signing_key:
|
156
104
|
specification_version: 4
|
157
105
|
summary: Deprecation Toolkit around ActiveSupport::Deprecation
|