deprecation_collector 0.1.0 → 0.2.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: 0b71c1caccaf15b1fac4574aa413071d8e9b14edc88f996f17421fd6b12eb5d3
4
- data.tar.gz: 9312d3017f8c025247a77bbab1af84541cd4f7145f7433d5fe9d728807ae562f
3
+ metadata.gz: 21042fb4a7a9045647774128efd65fd4a27b182b6122738a0407da13af1b8786
4
+ data.tar.gz: eef445a5a47d88e3b7dc55f90ee07f9cfda0539b2a059ce7bc5286773a5d17e3
5
5
  SHA512:
6
- metadata.gz: dab3728079d5caa64c4001afbc22e355e66c2912bc3318983b5d8e147f1b2596f11ddfba532cd3c061319e4da2be00b86b5a8752055c10a0f26e4b3beeef2c83
7
- data.tar.gz: ac0133a1048a0644a2dab5b48ae5ebe97751210edc1da39c28248c8f6a1ee3c00732b09bbc8462a93ac06956fee40f672d5d193ff0be84c5ff57ae51570956ee
6
+ metadata.gz: a0309b7c02fcfe4f458feed01b3f3dd37d8510269c8b5b1296cbc545be250d73bb232bdd6a0d8a41595cadf2e268baefa60b0c0158eb87bb8bb186072560056c
7
+ data.tar.gz: 736342d4de1fef5b3326f1866f01b22e4642792a013853b849ed1ba42a32e68bc93c843f332d83b824e6f7a840b3364dc83acbfaf2f1c34c4e634bbfc21c94ff
data/.rubocop.yml CHANGED
@@ -1,7 +1,13 @@
1
+ require:
2
+ - rubocop-rspec
3
+ - rubocop-rake
4
+ - rubocop-performance
5
+
1
6
  AllCops:
2
7
  # note additional conf in spec/
3
8
  TargetRubyVersion: 2.5
4
9
  NewCops: enable
10
+ SuggestExtensions: false
5
11
  Exclude:
6
12
  - gemfiles/*
7
13
 
@@ -18,6 +24,9 @@ Layout/LineLength:
18
24
 
19
25
  Metrics/ClassLength: { Max: 230 }
20
26
  Metrics/MethodLength: { Max: 15 }
21
- Metrics/AbcSize: { Max: 20}
27
+ Metrics/AbcSize: { Max: 23 }
22
28
  Metrics/CyclomaticComplexity: { Max: 9 }
23
29
  Metrics/PerceivedComplexity: { Max: 9 }
30
+
31
+ RSpec/ExampleLength: { Enabled: false }
32
+ RSpec/MultipleExpectations: { Enabled: false }
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ == 0.2.0
2
+ - ability to add custom deprecation fingerprint (for example - controller+action), use `config.fingerprinter`
3
+
1
4
  == 0.1.0
2
5
  - kinda-breaking: ruby 2.4 was in fact not supported, so changed requirement to 2.5
3
6
  - prevent recursion when deprecation fires in `context_saver` hook
data/Gemfile CHANGED
@@ -20,6 +20,7 @@ unless defined?(Appraisal)
20
20
  end
21
21
 
22
22
  gem "rails", "~>6.0.0"
23
+ gem 'simplecov'
23
24
  end
24
25
 
25
26
  gem "fakeredis"
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- deprecation_collector (0.1.0)
4
+ deprecation_collector (0.2.0)
5
5
  redis (>= 3.0)
6
6
 
7
7
  GEM
@@ -72,6 +72,7 @@ GEM
72
72
  crass (1.0.6)
73
73
  date (3.3.1)
74
74
  diff-lcs (1.5.0)
75
+ docile (1.4.0)
75
76
  erubi (1.11.0)
76
77
  fakeredis (0.8.0)
77
78
  redis (~> 4.1)
@@ -91,7 +92,7 @@ GEM
91
92
  marcel (1.0.2)
92
93
  method_source (1.0.0)
93
94
  mini_mime (1.1.2)
94
- mini_portile2 (2.8.0)
95
+ mini_portile2 (2.8.1)
95
96
  minitest (5.16.3)
96
97
  net-imap (0.3.2)
97
98
  date
@@ -103,19 +104,19 @@ GEM
103
104
  net-smtp (0.3.3)
104
105
  net-protocol
105
106
  nio4r (2.5.8)
106
- nokogiri (1.13.10)
107
+ nokogiri (1.14.0)
107
108
  mini_portile2 (~> 2.8.0)
108
109
  racc (~> 1.4)
109
- nokogiri (1.13.10-arm64-darwin)
110
+ nokogiri (1.14.0-arm64-darwin)
110
111
  racc (~> 1.4)
111
- nokogiri (1.13.10-x86_64-darwin)
112
+ nokogiri (1.14.0-x86_64-darwin)
112
113
  racc (~> 1.4)
113
- nokogiri (1.13.10-x86_64-linux)
114
+ nokogiri (1.14.0-x86_64-linux)
114
115
  racc (~> 1.4)
115
116
  parallel (1.22.1)
116
117
  parser (3.1.3.0)
117
118
  ast (~> 2.4.1)
118
- racc (1.6.1)
119
+ racc (1.6.2)
119
120
  rack (2.2.4)
120
121
  rack-test (2.0.2)
121
122
  rack (>= 1.3)
@@ -187,6 +188,12 @@ GEM
187
188
  rubocop-rspec (2.16.0)
188
189
  rubocop (~> 1.33)
189
190
  ruby-progressbar (1.11.0)
191
+ simplecov (0.22.0)
192
+ docile (~> 1.1)
193
+ simplecov-html (~> 0.11)
194
+ simplecov_json_formatter (~> 0.1)
195
+ simplecov-html (0.12.3)
196
+ simplecov_json_formatter (0.1.4)
190
197
  sprockets (4.1.1)
191
198
  concurrent-ruby (~> 1.0)
192
199
  rack (> 1, < 3)
@@ -225,6 +232,7 @@ DEPENDENCIES
225
232
  rubocop-rails
226
233
  rubocop-rake
227
234
  rubocop-rspec
235
+ simplecov
228
236
  timecop
229
237
 
230
238
  BUNDLED WITH
data/README.md CHANGED
@@ -37,6 +37,10 @@ Add an initializer with configuration, like
37
37
  # this will only be called for new deprecations, return value must be json-compatible
38
38
  { some: "custom", context: "for example request.id" }
39
39
  end
40
+ instance.fingerprinter do |deprecation|
41
+ # this will be added to fingerprint; this will be ignored for recursive deprecations
42
+ "return_string_here"
43
+ end
40
44
  end
41
45
  end
42
46
  ```
@@ -1,66 +1,66 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- deprecation_collector (0.1.0)
4
+ deprecation_collector (0.2.0)
5
5
  redis (>= 3.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- actioncable (6.1.7)
11
- actionpack (= 6.1.7)
12
- activesupport (= 6.1.7)
10
+ actioncable (6.1.7.1)
11
+ actionpack (= 6.1.7.1)
12
+ activesupport (= 6.1.7.1)
13
13
  nio4r (~> 2.0)
14
14
  websocket-driver (>= 0.6.1)
15
- actionmailbox (6.1.7)
16
- actionpack (= 6.1.7)
17
- activejob (= 6.1.7)
18
- activerecord (= 6.1.7)
19
- activestorage (= 6.1.7)
20
- activesupport (= 6.1.7)
15
+ actionmailbox (6.1.7.1)
16
+ actionpack (= 6.1.7.1)
17
+ activejob (= 6.1.7.1)
18
+ activerecord (= 6.1.7.1)
19
+ activestorage (= 6.1.7.1)
20
+ activesupport (= 6.1.7.1)
21
21
  mail (>= 2.7.1)
22
- actionmailer (6.1.7)
23
- actionpack (= 6.1.7)
24
- actionview (= 6.1.7)
25
- activejob (= 6.1.7)
26
- activesupport (= 6.1.7)
22
+ actionmailer (6.1.7.1)
23
+ actionpack (= 6.1.7.1)
24
+ actionview (= 6.1.7.1)
25
+ activejob (= 6.1.7.1)
26
+ activesupport (= 6.1.7.1)
27
27
  mail (~> 2.5, >= 2.5.4)
28
28
  rails-dom-testing (~> 2.0)
29
- actionpack (6.1.7)
30
- actionview (= 6.1.7)
31
- activesupport (= 6.1.7)
29
+ actionpack (6.1.7.1)
30
+ actionview (= 6.1.7.1)
31
+ activesupport (= 6.1.7.1)
32
32
  rack (~> 2.0, >= 2.0.9)
33
33
  rack-test (>= 0.6.3)
34
34
  rails-dom-testing (~> 2.0)
35
35
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
36
- actiontext (6.1.7)
37
- actionpack (= 6.1.7)
38
- activerecord (= 6.1.7)
39
- activestorage (= 6.1.7)
40
- activesupport (= 6.1.7)
36
+ actiontext (6.1.7.1)
37
+ actionpack (= 6.1.7.1)
38
+ activerecord (= 6.1.7.1)
39
+ activestorage (= 6.1.7.1)
40
+ activesupport (= 6.1.7.1)
41
41
  nokogiri (>= 1.8.5)
42
- actionview (6.1.7)
43
- activesupport (= 6.1.7)
42
+ actionview (6.1.7.1)
43
+ activesupport (= 6.1.7.1)
44
44
  builder (~> 3.1)
45
45
  erubi (~> 1.4)
46
46
  rails-dom-testing (~> 2.0)
47
47
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
48
- activejob (6.1.7)
49
- activesupport (= 6.1.7)
48
+ activejob (6.1.7.1)
49
+ activesupport (= 6.1.7.1)
50
50
  globalid (>= 0.3.6)
51
- activemodel (6.1.7)
52
- activesupport (= 6.1.7)
53
- activerecord (6.1.7)
54
- activemodel (= 6.1.7)
55
- activesupport (= 6.1.7)
56
- activestorage (6.1.7)
57
- actionpack (= 6.1.7)
58
- activejob (= 6.1.7)
59
- activerecord (= 6.1.7)
60
- activesupport (= 6.1.7)
51
+ activemodel (6.1.7.1)
52
+ activesupport (= 6.1.7.1)
53
+ activerecord (6.1.7.1)
54
+ activemodel (= 6.1.7.1)
55
+ activesupport (= 6.1.7.1)
56
+ activestorage (6.1.7.1)
57
+ actionpack (= 6.1.7.1)
58
+ activejob (= 6.1.7.1)
59
+ activerecord (= 6.1.7.1)
60
+ activesupport (= 6.1.7.1)
61
61
  marcel (~> 1.0)
62
62
  mini_mime (>= 1.1.0)
63
- activesupport (6.1.7)
63
+ activesupport (6.1.7.1)
64
64
  concurrent-ruby (~> 1.0, >= 1.0.2)
65
65
  i18n (>= 1.6, < 2)
66
66
  minitest (>= 5.1)
@@ -75,18 +75,18 @@ GEM
75
75
  crass (1.0.6)
76
76
  diff-lcs (1.5.0)
77
77
  digest (3.1.1)
78
- erubi (1.11.0)
78
+ erubi (1.12.0)
79
79
  fakeredis (0.8.0)
80
80
  redis (~> 4.1)
81
81
  globalid (1.0.0)
82
82
  activesupport (>= 5.0)
83
83
  i18n (1.12.0)
84
84
  concurrent-ruby (~> 1.0)
85
- io-wait (0.2.3)
85
+ io-wait (0.3.0)
86
86
  loofah (2.19.1)
87
87
  crass (~> 1.0.2)
88
88
  nokogiri (>= 1.5.9)
89
- mail (2.8.0)
89
+ mail (2.8.0.1)
90
90
  mini_mime (>= 0.1.1)
91
91
  net-imap
92
92
  net-pop
@@ -113,33 +113,33 @@ GEM
113
113
  racc (~> 1.4)
114
114
  nokogiri (1.12.5-x86_64-linux)
115
115
  racc (~> 1.4)
116
- racc (1.6.1)
117
- rack (2.2.4)
116
+ racc (1.6.2)
117
+ rack (2.2.6.1)
118
118
  rack-test (2.0.2)
119
119
  rack (>= 1.3)
120
- rails (6.1.7)
121
- actioncable (= 6.1.7)
122
- actionmailbox (= 6.1.7)
123
- actionmailer (= 6.1.7)
124
- actionpack (= 6.1.7)
125
- actiontext (= 6.1.7)
126
- actionview (= 6.1.7)
127
- activejob (= 6.1.7)
128
- activemodel (= 6.1.7)
129
- activerecord (= 6.1.7)
130
- activestorage (= 6.1.7)
131
- activesupport (= 6.1.7)
120
+ rails (6.1.7.1)
121
+ actioncable (= 6.1.7.1)
122
+ actionmailbox (= 6.1.7.1)
123
+ actionmailer (= 6.1.7.1)
124
+ actionpack (= 6.1.7.1)
125
+ actiontext (= 6.1.7.1)
126
+ actionview (= 6.1.7.1)
127
+ activejob (= 6.1.7.1)
128
+ activemodel (= 6.1.7.1)
129
+ activerecord (= 6.1.7.1)
130
+ activestorage (= 6.1.7.1)
131
+ activesupport (= 6.1.7.1)
132
132
  bundler (>= 1.15.0)
133
- railties (= 6.1.7)
133
+ railties (= 6.1.7.1)
134
134
  sprockets-rails (>= 2.0.0)
135
135
  rails-dom-testing (2.0.3)
136
136
  activesupport (>= 4.2.0)
137
137
  nokogiri (>= 1.6)
138
138
  rails-html-sanitizer (1.4.4)
139
139
  loofah (~> 2.19, >= 2.19.1)
140
- railties (6.1.7)
141
- actionpack (= 6.1.7)
142
- activesupport (= 6.1.7)
140
+ railties (6.1.7.1)
141
+ actionpack (= 6.1.7.1)
142
+ activesupport (= 6.1.7.1)
143
143
  method_source
144
144
  rake (>= 12.2)
145
145
  thor (~> 1.0)
@@ -151,16 +151,16 @@ GEM
151
151
  rspec-mocks (~> 3.12.0)
152
152
  rspec-core (3.12.0)
153
153
  rspec-support (~> 3.12.0)
154
- rspec-expectations (3.12.0)
154
+ rspec-expectations (3.12.2)
155
155
  diff-lcs (>= 1.2.0, < 2.0)
156
156
  rspec-support (~> 3.12.0)
157
- rspec-mocks (3.12.1)
157
+ rspec-mocks (3.12.3)
158
158
  diff-lcs (>= 1.2.0, < 2.0)
159
159
  rspec-support (~> 3.12.0)
160
160
  rspec-support (3.12.0)
161
- sprockets (4.1.1)
161
+ sprockets (4.2.0)
162
162
  concurrent-ruby (~> 1.0)
163
- rack (> 1, < 3)
163
+ rack (>= 2.2.4, < 4)
164
164
  sprockets-rails (3.4.2)
165
165
  actionpack (>= 5.2)
166
166
  activesupport (>= 5.2)
@@ -1,73 +1,73 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- deprecation_collector (0.1.0)
4
+ deprecation_collector (0.2.0)
5
5
  redis (>= 3.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- actioncable (7.0.4)
11
- actionpack (= 7.0.4)
12
- activesupport (= 7.0.4)
10
+ actioncable (7.0.4.1)
11
+ actionpack (= 7.0.4.1)
12
+ activesupport (= 7.0.4.1)
13
13
  nio4r (~> 2.0)
14
14
  websocket-driver (>= 0.6.1)
15
- actionmailbox (7.0.4)
16
- actionpack (= 7.0.4)
17
- activejob (= 7.0.4)
18
- activerecord (= 7.0.4)
19
- activestorage (= 7.0.4)
20
- activesupport (= 7.0.4)
15
+ actionmailbox (7.0.4.1)
16
+ actionpack (= 7.0.4.1)
17
+ activejob (= 7.0.4.1)
18
+ activerecord (= 7.0.4.1)
19
+ activestorage (= 7.0.4.1)
20
+ activesupport (= 7.0.4.1)
21
21
  mail (>= 2.7.1)
22
22
  net-imap
23
23
  net-pop
24
24
  net-smtp
25
- actionmailer (7.0.4)
26
- actionpack (= 7.0.4)
27
- actionview (= 7.0.4)
28
- activejob (= 7.0.4)
29
- activesupport (= 7.0.4)
25
+ actionmailer (7.0.4.1)
26
+ actionpack (= 7.0.4.1)
27
+ actionview (= 7.0.4.1)
28
+ activejob (= 7.0.4.1)
29
+ activesupport (= 7.0.4.1)
30
30
  mail (~> 2.5, >= 2.5.4)
31
31
  net-imap
32
32
  net-pop
33
33
  net-smtp
34
34
  rails-dom-testing (~> 2.0)
35
- actionpack (7.0.4)
36
- actionview (= 7.0.4)
37
- activesupport (= 7.0.4)
35
+ actionpack (7.0.4.1)
36
+ actionview (= 7.0.4.1)
37
+ activesupport (= 7.0.4.1)
38
38
  rack (~> 2.0, >= 2.2.0)
39
39
  rack-test (>= 0.6.3)
40
40
  rails-dom-testing (~> 2.0)
41
41
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
42
- actiontext (7.0.4)
43
- actionpack (= 7.0.4)
44
- activerecord (= 7.0.4)
45
- activestorage (= 7.0.4)
46
- activesupport (= 7.0.4)
42
+ actiontext (7.0.4.1)
43
+ actionpack (= 7.0.4.1)
44
+ activerecord (= 7.0.4.1)
45
+ activestorage (= 7.0.4.1)
46
+ activesupport (= 7.0.4.1)
47
47
  globalid (>= 0.6.0)
48
48
  nokogiri (>= 1.8.5)
49
- actionview (7.0.4)
50
- activesupport (= 7.0.4)
49
+ actionview (7.0.4.1)
50
+ activesupport (= 7.0.4.1)
51
51
  builder (~> 3.1)
52
52
  erubi (~> 1.4)
53
53
  rails-dom-testing (~> 2.0)
54
54
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
55
- activejob (7.0.4)
56
- activesupport (= 7.0.4)
55
+ activejob (7.0.4.1)
56
+ activesupport (= 7.0.4.1)
57
57
  globalid (>= 0.3.6)
58
- activemodel (7.0.4)
59
- activesupport (= 7.0.4)
60
- activerecord (7.0.4)
61
- activemodel (= 7.0.4)
62
- activesupport (= 7.0.4)
63
- activestorage (7.0.4)
64
- actionpack (= 7.0.4)
65
- activejob (= 7.0.4)
66
- activerecord (= 7.0.4)
67
- activesupport (= 7.0.4)
58
+ activemodel (7.0.4.1)
59
+ activesupport (= 7.0.4.1)
60
+ activerecord (7.0.4.1)
61
+ activemodel (= 7.0.4.1)
62
+ activesupport (= 7.0.4.1)
63
+ activestorage (7.0.4.1)
64
+ actionpack (= 7.0.4.1)
65
+ activejob (= 7.0.4.1)
66
+ activerecord (= 7.0.4.1)
67
+ activesupport (= 7.0.4.1)
68
68
  marcel (~> 1.0)
69
69
  mini_mime (>= 1.1.0)
70
- activesupport (7.0.4)
70
+ activesupport (7.0.4.1)
71
71
  concurrent-ruby (~> 1.0, >= 1.0.2)
72
72
  i18n (>= 1.6, < 2)
73
73
  minitest (>= 5.1)
@@ -79,9 +79,9 @@ GEM
79
79
  builder (3.2.4)
80
80
  concurrent-ruby (1.1.10)
81
81
  crass (1.0.6)
82
- date (3.3.1)
82
+ date (3.3.3)
83
83
  diff-lcs (1.5.0)
84
- erubi (1.11.0)
84
+ erubi (1.12.0)
85
85
  fakeredis (0.8.0)
86
86
  redis (~> 4.1)
87
87
  globalid (1.0.0)
@@ -91,7 +91,7 @@ GEM
91
91
  loofah (2.19.1)
92
92
  crass (~> 1.0.2)
93
93
  nokogiri (>= 1.5.9)
94
- mail (2.8.0)
94
+ mail (2.8.0.1)
95
95
  mini_mime (>= 0.1.1)
96
96
  net-imap
97
97
  net-pop
@@ -99,8 +99,8 @@ GEM
99
99
  marcel (1.0.2)
100
100
  method_source (1.0.0)
101
101
  mini_mime (1.1.2)
102
- minitest (5.16.3)
103
- net-imap (0.3.2)
102
+ minitest (5.17.0)
103
+ net-imap (0.3.4)
104
104
  date
105
105
  net-protocol
106
106
  net-pop (0.1.2)
@@ -110,36 +110,36 @@ GEM
110
110
  net-smtp (0.3.3)
111
111
  net-protocol
112
112
  nio4r (2.5.8)
113
- nokogiri (1.13.10-x86_64-darwin)
113
+ nokogiri (1.14.0-x86_64-darwin)
114
114
  racc (~> 1.4)
115
- nokogiri (1.13.10-x86_64-linux)
115
+ nokogiri (1.14.0-x86_64-linux)
116
116
  racc (~> 1.4)
117
- racc (1.6.1)
118
- rack (2.2.4)
117
+ racc (1.6.2)
118
+ rack (2.2.6.1)
119
119
  rack-test (2.0.2)
120
120
  rack (>= 1.3)
121
- rails (7.0.4)
122
- actioncable (= 7.0.4)
123
- actionmailbox (= 7.0.4)
124
- actionmailer (= 7.0.4)
125
- actionpack (= 7.0.4)
126
- actiontext (= 7.0.4)
127
- actionview (= 7.0.4)
128
- activejob (= 7.0.4)
129
- activemodel (= 7.0.4)
130
- activerecord (= 7.0.4)
131
- activestorage (= 7.0.4)
132
- activesupport (= 7.0.4)
121
+ rails (7.0.4.1)
122
+ actioncable (= 7.0.4.1)
123
+ actionmailbox (= 7.0.4.1)
124
+ actionmailer (= 7.0.4.1)
125
+ actionpack (= 7.0.4.1)
126
+ actiontext (= 7.0.4.1)
127
+ actionview (= 7.0.4.1)
128
+ activejob (= 7.0.4.1)
129
+ activemodel (= 7.0.4.1)
130
+ activerecord (= 7.0.4.1)
131
+ activestorage (= 7.0.4.1)
132
+ activesupport (= 7.0.4.1)
133
133
  bundler (>= 1.15.0)
134
- railties (= 7.0.4)
134
+ railties (= 7.0.4.1)
135
135
  rails-dom-testing (2.0.3)
136
136
  activesupport (>= 4.2.0)
137
137
  nokogiri (>= 1.6)
138
138
  rails-html-sanitizer (1.4.4)
139
139
  loofah (~> 2.19, >= 2.19.1)
140
- railties (7.0.4)
141
- actionpack (= 7.0.4)
142
- activesupport (= 7.0.4)
140
+ railties (7.0.4.1)
141
+ actionpack (= 7.0.4.1)
142
+ activesupport (= 7.0.4.1)
143
143
  method_source
144
144
  rake (>= 12.2)
145
145
  thor (~> 1.0)
@@ -152,10 +152,10 @@ GEM
152
152
  rspec-mocks (~> 3.12.0)
153
153
  rspec-core (3.12.0)
154
154
  rspec-support (~> 3.12.0)
155
- rspec-expectations (3.12.0)
155
+ rspec-expectations (3.12.2)
156
156
  diff-lcs (>= 1.2.0, < 2.0)
157
157
  rspec-support (~> 3.12.0)
158
- rspec-mocks (3.12.1)
158
+ rspec-mocks (3.12.3)
159
159
  diff-lcs (>= 1.2.0, < 2.0)
160
160
  rspec-support (~> 3.12.0)
161
161
  rspec-support (3.12.0)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- deprecation_collector (0.1.0)
4
+ deprecation_collector (0.2.0)
5
5
  redis (>= 3.0)
6
6
 
7
7
  GEM
@@ -22,10 +22,10 @@ GEM
22
22
  rspec-mocks (~> 3.12.0)
23
23
  rspec-core (3.12.0)
24
24
  rspec-support (~> 3.12.0)
25
- rspec-expectations (3.12.0)
25
+ rspec-expectations (3.12.2)
26
26
  diff-lcs (>= 1.2.0, < 2.0)
27
27
  rspec-support (~> 3.12.0)
28
- rspec-mocks (3.12.1)
28
+ rspec-mocks (3.12.3)
29
29
  diff-lcs (>= 1.2.0, < 2.0)
30
30
  rspec-support (~> 3.12.0)
31
31
  rspec-support (3.12.0)
@@ -4,7 +4,7 @@ class DeprecationCollector
4
4
  # :nodoc:
5
5
  class Deprecation
6
6
  attr_reader :message, :realm, :gem_traceline, :app_traceline, :occurences, :first_timestamp, :full_backtrace
7
- attr_accessor :context
7
+ attr_accessor :context, :custom_fingerprint
8
8
 
9
9
  CLEANUP_REGEXES = {
10
10
  # rails views generated methods names are unique per-worker
@@ -55,7 +55,8 @@ class DeprecationCollector
55
55
  end
56
56
 
57
57
  def digest_base
58
- "1:#{RUBY_VERSION}:#{defined?(Rails) && Rails.version}:#{message_for_digest}:#{gem_traceline}:#{app_traceline}"
58
+ "1:#{RUBY_VERSION}:#{defined?(Rails) && Rails.version}:#{message_for_digest}:#{gem_traceline}:#{app_traceline}" \
59
+ "#{":#{custom_fingerprint}" if custom_fingerprint}"
59
60
  end
60
61
 
61
62
  def as_json(_options = {})
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class DeprecationCollector
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
@@ -57,7 +57,7 @@ class DeprecationCollector
57
57
  :write_interval, :write_interval_jitter,
58
58
  :app_revision, :app_root,
59
59
  :print_to_stderr, :print_recurring
60
- attr_writer :redis, :context_saver
60
+ attr_writer :redis, :context_saver, :fingerprinter
61
61
 
62
62
  def initialize(mutex: nil)
63
63
  # on cruby hash itself is threadsafe, but we need to prevent races
@@ -88,11 +88,17 @@ class DeprecationCollector
88
88
  end
89
89
 
90
90
  def context_saver(&block)
91
- return @context_saver unless block_given?
91
+ return @context_saver unless block
92
92
 
93
93
  @context_saver = block
94
94
  end
95
95
 
96
+ def fingerprinter(&block)
97
+ return @fingerprinter unless block
98
+
99
+ @fingerprinter = block
100
+ end
101
+
96
102
  def app_root_prefix
97
103
  "#{app_root}/"
98
104
  end
@@ -243,9 +249,10 @@ class DeprecationCollector
243
249
  def store_deprecation(deprecation, allow_context: true)
244
250
  return if deprecation.ignored?
245
251
 
246
- fresh = !@deprecations.key?(deprecation.digest)
247
252
  deprecation.context = context_saver.call if context_saver && allow_context
253
+ deprecation.custom_fingerprint = fingerprinter.call(deprecation) if fingerprinter && allow_context
248
254
 
255
+ fresh = !@deprecations.key?(deprecation.digest)
249
256
  @deprecations_mutex.synchronize do
250
257
  (@deprecations[deprecation.digest] ||= deprecation).touch
251
258
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deprecation_collector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vasily Fedoseyev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-13 00:00:00.000000000 Z
11
+ date: 2023-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis
@@ -90,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
90
90
  - !ruby/object:Gem::Version
91
91
  version: '0'
92
92
  requirements: []
93
- rubygems_version: 3.3.7
93
+ rubygems_version: 3.4.1
94
94
  signing_key:
95
95
  specification_version: 4
96
96
  summary: Collector for ruby/rails deprecations and warnings, suitable for production