deprecation_toolkit 2.0.1 → 2.0.3

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: c2d0b00fe8e8b87b77af20209fac4531b7d2faebdecc55a8cdbd1b490cd65089
4
- data.tar.gz: 4ed23c378e87023b0303839edaaa99265929c2b4eb5e7c1b56156992c24ba8e7
3
+ metadata.gz: a215b859ad3948057d353332378a89f8ff22199296677f2ecab9f318d24a73b3
4
+ data.tar.gz: 99a5d3368ab2a066a4118ba0330a913223214ba686c5779138cc685610eea4ae
5
5
  SHA512:
6
- metadata.gz: 947cd740128e855612cc94917760cf00160adeda014fb4727153a811ea3e2b4cec4e563c61c02729c4eabdebdbf28307787f727feefa4a76e273c4b534c0fc40
7
- data.tar.gz: e46958cb158e2ede1139cabb445462349ceb8bc4de06b4084d6af1f086aacba390e86c9cba7c07a23d074d899cd669ef775c790263632be66b88990164404cd2
6
+ metadata.gz: a6b2c17228b8091e8d2260fb6aa001153b859fcc029412133552b6fb074cb547735bbd27e1194c36128f390658c4e8b82e76018244388a91a56528f6fad05256
7
+ data.tar.gz: 4199799c0190b92530119d4ad093e359a6b076f35a1ceb039081bbdf6c0b26bd3731cd36fedb6f6025e3bc4bedd7fc38cd43c13e21652b7a3ac898a9a86c3d37
@@ -9,7 +9,7 @@ jobs:
9
9
  strategy:
10
10
  matrix:
11
11
  gemfile: [gemfiles/activesupport_5.2.gemfile, gemfiles/activesupport_6.0.gemfile, gemfiles/activesupport_6.1.gemfile, gemfiles/activesupport_7.0.gemfile, gemfiles/activesupport_edge.gemfile]
12
- ruby: ["2.6", "2.7", "3.0", "3.1"]
12
+ ruby: ["2.7", "3.0", "3.1", "3.2"]
13
13
  exclude:
14
14
  # Active Support requires Ruby >= 2.7 as of 7.0
15
15
  - gemfile: "gemfiles/activesupport_7.0.gemfile"
@@ -43,7 +43,7 @@ jobs:
43
43
 
44
44
  - uses: ruby/setup-ruby@v1
45
45
  with:
46
- ruby-version: "3.1"
46
+ ruby-version: "3.2"
47
47
  bundler-cache: true
48
48
 
49
49
  - name: RuboCop
data/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  ## main (unreleased)
4
4
 
5
+ ## 2.0.3 (2023-02-10)
6
+
7
+ * [#80](https://github.com/Shopify/deprecation_toolkit/pull/80): Filter out stack trace from Gem::Deprecate deprecation messages
8
+
9
+ ## 2.0.2 (2023-02-08)
10
+
11
+ * [#78](https://github.com/Shopify/deprecation_toolkit/pull/78): Show deprecations without stacktrace. (@shioyama)
12
+
5
13
  ## 2.0.1 (2022-11-18)
6
14
 
7
15
  * [#74](https://github.com/Shopify/deprecation_toolkit/pull/74): Add support for `Rails.application.deprecators`. (@gmcgibbon)
data/Gemfile.lock CHANGED
@@ -1,19 +1,19 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- deprecation_toolkit (2.0.1)
4
+ deprecation_toolkit (2.0.3)
5
5
  activesupport (>= 5.2)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- activesupport (7.0.4)
10
+ activesupport (7.0.4.2)
11
11
  concurrent-ruby (~> 1.0, >= 1.0.2)
12
12
  i18n (>= 1.6, < 2)
13
13
  minitest (>= 5.1)
14
14
  tzinfo (~> 2.0)
15
15
  ast (2.4.2)
16
- concurrent-ruby (1.1.10)
16
+ concurrent-ruby (1.2.0)
17
17
  diff-lcs (1.5.0)
18
18
  i18n (1.12.0)
19
19
  concurrent-ruby (~> 1.0)
@@ -52,7 +52,7 @@ GEM
52
52
  rubocop-shopify (2.5.0)
53
53
  rubocop (~> 1.25)
54
54
  ruby-progressbar (1.11.0)
55
- tzinfo (2.0.5)
55
+ tzinfo (2.0.6)
56
56
  concurrent-ruby (~> 1.0)
57
57
  unicode-display_width (2.1.0)
58
58
 
@@ -68,4 +68,4 @@ DEPENDENCIES
68
68
  rubocop-shopify
69
69
 
70
70
  BUNDLED WITH
71
- 2.2.22
71
+ 2.4.4
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.metadata["allowed_push_host"] = "https://rubygems.org"
22
22
 
23
- spec.required_ruby_version = ">= 2.6"
23
+ spec.required_ruby_version = ">= 2.7"
24
24
 
25
25
  spec.files = %x(git ls-files -z).split("\x0").reject do |f|
26
26
  f.match(%r{^(test)/})
@@ -77,9 +77,9 @@ module DeprecationToolkit
77
77
  #{record_message}
78
78
 
79
79
  ===== Expected
80
- #{recorded_deprecations.deprecations.join("\n")}
80
+ #{recorded_deprecations.deprecations_without_stacktrace.join("\n")}
81
81
  ===== Actual
82
- #{current_deprecations.deprecations.join("\n")}
82
+ #{current_deprecations.deprecations_without_stacktrace.join("\n")}
83
83
  EOM
84
84
 
85
85
  super(message)
@@ -35,11 +35,9 @@ module DeprecationToolkit
35
35
 
36
36
  def deprecations_without_stacktrace
37
37
  deprecations.map do |deprecation|
38
- if ActiveSupport.gem_version.to_s < "5.0"
39
- deprecation.sub(/\W\s\(called from .*\)$/, "")
40
- else
41
- deprecation.sub(/ \(called from .*\)$/, "")
42
- end
38
+ deprecation
39
+ .sub(*active_support_deprecation_sub_params)
40
+ .sub(*gem_deprecate_sub_params)
43
41
  end
44
42
  end
45
43
 
@@ -63,5 +61,19 @@ module DeprecationToolkit
63
61
  def flaky?
64
62
  size == 1 && deprecations.first["flaky"] == true
65
63
  end
64
+
65
+ private
66
+
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
73
+ end
74
+
75
+ def gem_deprecate_sub_params
76
+ [/NOTE: (.*is deprecated.*)\n.* called from.*:\d+\.\n/, "\\1"]
77
+ end
66
78
  end
67
79
  end
@@ -58,7 +58,7 @@ module DeprecationToolkit
58
58
  end
59
59
 
60
60
  def test_location(test)
61
- test.method(test_name(test)).source_location[0]
61
+ Kernel.const_source_location(test.class.name)[0]
62
62
  rescue NameError
63
63
  "unknown"
64
64
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DeprecationToolkit
4
- VERSION = "2.0.1"
4
+ VERSION = "2.0.3"
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: 2.0.1
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-18 00:00:00.000000000 Z
11
+ date: 2023-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -92,7 +92,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
92
92
  requirements:
93
93
  - - ">="
94
94
  - !ruby/object:Gem::Version
95
- version: '2.6'
95
+ version: '2.7'
96
96
  required_rubygems_version: !ruby/object:Gem::Requirement
97
97
  requirements:
98
98
  - - ">="