deprecation_collector 0.3.0 → 0.4.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
2
  SHA256:
3
- metadata.gz: e47433dbbd3b8de0913751e91d7c599ceae4061f33a97e335082f797d3f15a85
4
- data.tar.gz: bfd2daa42a714075654550d8c262c5fed7398109c9a6bb0c6167e3c50e9831fc
3
+ metadata.gz: 7eda71f5ba3b7d7c1aa9a1c622a29e4329b8ab08bccc53d243aabea3a80a70cb
4
+ data.tar.gz: 213fa97a6ceede04c3f37160defb2a6732d84a32f25681a9486a567eae6d7fed
5
5
  SHA512:
6
- metadata.gz: c16f77432e628e0ab52d0753a2083fbba24c9f0b847dba9b93401b6700c88831f6dea334a4ce2f48a85ede6ee3646737075b4aadc419717d024d48a3bc0a82bd
7
- data.tar.gz: '025851292e3ba3b80ef8b7e232bb4900eef50a83948b58f2cc70ef1e15ea1cf6f9bd959f126360690cdbcca5a88c926ea04c25733d2aadfb24ef0078359ab8c5'
6
+ metadata.gz: d4b4cf6feb4d736114f7324a0b34a65e32ee7f3edd610ee5aabb41daa069fd2417a746e927761c28ec22b37a9ceb1f768c2fa92064c11e0d4e4474801dd9f008
7
+ data.tar.gz: 9e6641fc8b17e5d4d2a5d5d7981afecca83feffbc549d88206105a4f752feeb951290fa9dc77f8d24166519df12da917d83f81685eb2d79b6ca87912d09ff599
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ == 0.4.0
2
+ - a bit better ui
3
+ - simple import/export
4
+
5
+ == 0.3.0
6
+ - simple web ui (mountable rack app)
7
+
1
8
  == 0.2.0
2
9
  - ability to add custom deprecation fingerprint (for example - controller+action), use `config.fingerprinter`
3
10
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- deprecation_collector (0.3.0)
4
+ deprecation_collector (0.4.0)
5
5
  redis (>= 3.0)
6
6
 
7
7
  GEM
@@ -230,6 +230,7 @@ DEPENDENCIES
230
230
  deprecation_collector!
231
231
  fakeredis
232
232
  rack
233
+ rack-test
233
234
  rails (~> 6.0.0)
234
235
  rake (~> 13.0)
235
236
  redis (~> 4.8)
@@ -245,4 +246,4 @@ DEPENDENCIES
245
246
  webrick
246
247
 
247
248
  BUNDLED WITH
248
- 2.3.10
249
+ 2.4.12
data/Rakefile CHANGED
@@ -5,9 +5,11 @@ require "rspec/core/rake_task"
5
5
 
6
6
  RSpec::Core::RakeTask.new(:spec)
7
7
 
8
- require "rubocop/rake_task"
9
-
10
- RuboCop::RakeTask.new
8
+ begin
9
+ require "rubocop/rake_task"
10
+ RuboCop::RakeTask.new
11
+ rescue LoadError
12
+ end
11
13
 
12
14
  task default: %i[spec rubocop]
13
15
 
@@ -23,4 +25,5 @@ task :precompile_templates do
23
25
  end
24
26
  end
25
27
 
28
+ Rake::Task[:spec].enhance [:precompile_templates]
26
29
  Rake::Task[:build].enhance [:precompile_templates]
@@ -30,4 +30,5 @@ Gem::Specification.new do |spec|
30
30
 
31
31
  spec.add_dependency "redis", ">= 3.0"
32
32
  spec.add_development_dependency "appraisal"
33
+ spec.add_development_dependency "rack-test"
33
34
  end
@@ -7,6 +7,9 @@ gem "rspec", "~> 3.0"
7
7
  gem "timecop"
8
8
  gem "fakeredis"
9
9
  gem "redis", "~>4.8"
10
+ gem "rack"
11
+ gem "webrick"
12
+ gem "slim"
10
13
  gem "rails", "~>6.0"
11
14
 
12
15
  gemspec path: "../"
@@ -1,66 +1,66 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- deprecation_collector (0.2.0)
4
+ deprecation_collector (0.4.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.1)
11
- actionpack (= 6.1.7.1)
12
- activesupport (= 6.1.7.1)
10
+ actioncable (6.1.7.3)
11
+ actionpack (= 6.1.7.3)
12
+ activesupport (= 6.1.7.3)
13
13
  nio4r (~> 2.0)
14
14
  websocket-driver (>= 0.6.1)
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)
15
+ actionmailbox (6.1.7.3)
16
+ actionpack (= 6.1.7.3)
17
+ activejob (= 6.1.7.3)
18
+ activerecord (= 6.1.7.3)
19
+ activestorage (= 6.1.7.3)
20
+ activesupport (= 6.1.7.3)
21
21
  mail (>= 2.7.1)
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)
22
+ actionmailer (6.1.7.3)
23
+ actionpack (= 6.1.7.3)
24
+ actionview (= 6.1.7.3)
25
+ activejob (= 6.1.7.3)
26
+ activesupport (= 6.1.7.3)
27
27
  mail (~> 2.5, >= 2.5.4)
28
28
  rails-dom-testing (~> 2.0)
29
- actionpack (6.1.7.1)
30
- actionview (= 6.1.7.1)
31
- activesupport (= 6.1.7.1)
29
+ actionpack (6.1.7.3)
30
+ actionview (= 6.1.7.3)
31
+ activesupport (= 6.1.7.3)
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.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)
36
+ actiontext (6.1.7.3)
37
+ actionpack (= 6.1.7.3)
38
+ activerecord (= 6.1.7.3)
39
+ activestorage (= 6.1.7.3)
40
+ activesupport (= 6.1.7.3)
41
41
  nokogiri (>= 1.8.5)
42
- actionview (6.1.7.1)
43
- activesupport (= 6.1.7.1)
42
+ actionview (6.1.7.3)
43
+ activesupport (= 6.1.7.3)
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.1)
49
- activesupport (= 6.1.7.1)
48
+ activejob (6.1.7.3)
49
+ activesupport (= 6.1.7.3)
50
50
  globalid (>= 0.3.6)
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)
51
+ activemodel (6.1.7.3)
52
+ activesupport (= 6.1.7.3)
53
+ activerecord (6.1.7.3)
54
+ activemodel (= 6.1.7.3)
55
+ activesupport (= 6.1.7.3)
56
+ activestorage (6.1.7.3)
57
+ actionpack (= 6.1.7.3)
58
+ activejob (= 6.1.7.3)
59
+ activerecord (= 6.1.7.3)
60
+ activesupport (= 6.1.7.3)
61
61
  marcel (~> 1.0)
62
62
  mini_mime (>= 1.1.0)
63
- activesupport (6.1.7.1)
63
+ activesupport (6.1.7.3)
64
64
  concurrent-ruby (~> 1.0, >= 1.0.2)
65
65
  i18n (>= 1.6, < 2)
66
66
  minitest (>= 5.1)
@@ -71,22 +71,21 @@ GEM
71
71
  rake
72
72
  thor (>= 0.14.0)
73
73
  builder (3.2.4)
74
- concurrent-ruby (1.1.10)
74
+ concurrent-ruby (1.2.2)
75
75
  crass (1.0.6)
76
+ date (3.3.3)
76
77
  diff-lcs (1.5.0)
77
- digest (3.1.1)
78
78
  erubi (1.12.0)
79
- fakeredis (0.8.0)
80
- redis (~> 4.1)
81
- globalid (1.0.0)
79
+ fakeredis (0.9.1)
80
+ redis (~> 4.8)
81
+ globalid (1.1.0)
82
82
  activesupport (>= 5.0)
83
- i18n (1.12.0)
83
+ i18n (1.13.0)
84
84
  concurrent-ruby (~> 1.0)
85
- io-wait (0.3.0)
86
- loofah (2.19.1)
85
+ loofah (2.20.0)
87
86
  crass (~> 1.0.2)
88
87
  nokogiri (>= 1.5.9)
89
- mail (2.8.0.1)
88
+ mail (2.8.1)
90
89
  mini_mime (>= 0.1.1)
91
90
  net-imap
92
91
  net-pop
@@ -94,70 +93,69 @@ GEM
94
93
  marcel (1.0.2)
95
94
  method_source (1.0.0)
96
95
  mini_mime (1.1.2)
97
- minitest (5.15.0)
98
- net-imap (0.2.2)
99
- digest
96
+ minitest (5.18.0)
97
+ net-imap (0.3.4)
98
+ date
100
99
  net-protocol
101
- strscan
102
100
  net-pop (0.1.2)
103
101
  net-protocol
104
- net-protocol (0.1.2)
105
- io-wait
102
+ net-protocol (0.2.1)
106
103
  timeout
107
- net-smtp (0.3.0)
108
- digest
104
+ net-smtp (0.3.3)
109
105
  net-protocol
110
- timeout
111
- nio4r (2.5.8)
112
- nokogiri (1.12.5-x86_64-darwin)
106
+ nio4r (2.5.9)
107
+ nokogiri (1.14.3-x86_64-darwin)
113
108
  racc (~> 1.4)
114
- nokogiri (1.12.5-x86_64-linux)
109
+ nokogiri (1.14.3-x86_64-linux)
115
110
  racc (~> 1.4)
116
111
  racc (1.6.2)
117
- rack (2.2.6.1)
118
- rack-test (2.0.2)
112
+ rack (2.2.7)
113
+ rack-test (2.1.0)
119
114
  rack (>= 1.3)
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)
115
+ rails (6.1.7.3)
116
+ actioncable (= 6.1.7.3)
117
+ actionmailbox (= 6.1.7.3)
118
+ actionmailer (= 6.1.7.3)
119
+ actionpack (= 6.1.7.3)
120
+ actiontext (= 6.1.7.3)
121
+ actionview (= 6.1.7.3)
122
+ activejob (= 6.1.7.3)
123
+ activemodel (= 6.1.7.3)
124
+ activerecord (= 6.1.7.3)
125
+ activestorage (= 6.1.7.3)
126
+ activesupport (= 6.1.7.3)
132
127
  bundler (>= 1.15.0)
133
- railties (= 6.1.7.1)
128
+ railties (= 6.1.7.3)
134
129
  sprockets-rails (>= 2.0.0)
135
130
  rails-dom-testing (2.0.3)
136
131
  activesupport (>= 4.2.0)
137
132
  nokogiri (>= 1.6)
138
- rails-html-sanitizer (1.4.4)
133
+ rails-html-sanitizer (1.5.0)
139
134
  loofah (~> 2.19, >= 2.19.1)
140
- railties (6.1.7.1)
141
- actionpack (= 6.1.7.1)
142
- activesupport (= 6.1.7.1)
135
+ railties (6.1.7.3)
136
+ actionpack (= 6.1.7.3)
137
+ activesupport (= 6.1.7.3)
143
138
  method_source
144
139
  rake (>= 12.2)
145
140
  thor (~> 1.0)
146
141
  rake (13.0.6)
147
- redis (4.8.0)
142
+ redis (4.8.1)
148
143
  rspec (3.12.0)
149
144
  rspec-core (~> 3.12.0)
150
145
  rspec-expectations (~> 3.12.0)
151
146
  rspec-mocks (~> 3.12.0)
152
- rspec-core (3.12.0)
147
+ rspec-core (3.12.2)
153
148
  rspec-support (~> 3.12.0)
154
- rspec-expectations (3.12.2)
149
+ rspec-expectations (3.12.3)
155
150
  diff-lcs (>= 1.2.0, < 2.0)
156
151
  rspec-support (~> 3.12.0)
157
- rspec-mocks (3.12.3)
152
+ rspec-mocks (3.12.5)
158
153
  diff-lcs (>= 1.2.0, < 2.0)
159
154
  rspec-support (~> 3.12.0)
160
155
  rspec-support (3.12.0)
156
+ slim (5.1.0)
157
+ temple (~> 0.10.0)
158
+ tilt (>= 2.0.6, < 2.2)
161
159
  sprockets (4.2.0)
162
160
  concurrent-ruby (~> 1.0)
163
161
  rack (>= 2.2.4, < 4)
@@ -165,16 +163,18 @@ GEM
165
163
  actionpack (>= 5.2)
166
164
  activesupport (>= 5.2)
167
165
  sprockets (>= 3.0.0)
168
- strscan (3.0.5)
166
+ temple (0.10.0)
169
167
  thor (1.2.1)
168
+ tilt (2.1.0)
170
169
  timecop (0.9.6)
171
- timeout (0.3.1)
172
- tzinfo (2.0.5)
170
+ timeout (0.3.2)
171
+ tzinfo (2.0.6)
173
172
  concurrent-ruby (~> 1.0)
173
+ webrick (1.8.1)
174
174
  websocket-driver (0.7.5)
175
175
  websocket-extensions (>= 0.1.0)
176
176
  websocket-extensions (0.1.5)
177
- zeitwerk (2.6.6)
177
+ zeitwerk (2.6.7)
178
178
 
179
179
  PLATFORMS
180
180
  x86_64-darwin-21
@@ -184,11 +184,15 @@ DEPENDENCIES
184
184
  appraisal
185
185
  deprecation_collector!
186
186
  fakeredis
187
+ rack
188
+ rack-test
187
189
  rails (~> 6.0)
188
190
  rake (~> 13.0)
189
191
  redis (~> 4.8)
190
192
  rspec (~> 3.0)
193
+ slim
191
194
  timecop
195
+ webrick
192
196
 
193
197
  BUNDLED WITH
194
198
  2.3.10
@@ -7,6 +7,9 @@ gem "rspec", "~> 3.0"
7
7
  gem "timecop"
8
8
  gem "fakeredis"
9
9
  gem "redis", "~>4.8"
10
+ gem "rack"
11
+ gem "webrick"
12
+ gem "slim"
10
13
  gem "rails", "~>7.0"
11
14
 
12
15
  gemspec path: "../"
@@ -1,73 +1,73 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- deprecation_collector (0.2.0)
4
+ deprecation_collector (0.4.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.1)
11
- actionpack (= 7.0.4.1)
12
- activesupport (= 7.0.4.1)
10
+ actioncable (7.0.4.3)
11
+ actionpack (= 7.0.4.3)
12
+ activesupport (= 7.0.4.3)
13
13
  nio4r (~> 2.0)
14
14
  websocket-driver (>= 0.6.1)
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)
15
+ actionmailbox (7.0.4.3)
16
+ actionpack (= 7.0.4.3)
17
+ activejob (= 7.0.4.3)
18
+ activerecord (= 7.0.4.3)
19
+ activestorage (= 7.0.4.3)
20
+ activesupport (= 7.0.4.3)
21
21
  mail (>= 2.7.1)
22
22
  net-imap
23
23
  net-pop
24
24
  net-smtp
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)
25
+ actionmailer (7.0.4.3)
26
+ actionpack (= 7.0.4.3)
27
+ actionview (= 7.0.4.3)
28
+ activejob (= 7.0.4.3)
29
+ activesupport (= 7.0.4.3)
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.1)
36
- actionview (= 7.0.4.1)
37
- activesupport (= 7.0.4.1)
35
+ actionpack (7.0.4.3)
36
+ actionview (= 7.0.4.3)
37
+ activesupport (= 7.0.4.3)
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.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)
42
+ actiontext (7.0.4.3)
43
+ actionpack (= 7.0.4.3)
44
+ activerecord (= 7.0.4.3)
45
+ activestorage (= 7.0.4.3)
46
+ activesupport (= 7.0.4.3)
47
47
  globalid (>= 0.6.0)
48
48
  nokogiri (>= 1.8.5)
49
- actionview (7.0.4.1)
50
- activesupport (= 7.0.4.1)
49
+ actionview (7.0.4.3)
50
+ activesupport (= 7.0.4.3)
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.1)
56
- activesupport (= 7.0.4.1)
55
+ activejob (7.0.4.3)
56
+ activesupport (= 7.0.4.3)
57
57
  globalid (>= 0.3.6)
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)
58
+ activemodel (7.0.4.3)
59
+ activesupport (= 7.0.4.3)
60
+ activerecord (7.0.4.3)
61
+ activemodel (= 7.0.4.3)
62
+ activesupport (= 7.0.4.3)
63
+ activestorage (7.0.4.3)
64
+ actionpack (= 7.0.4.3)
65
+ activejob (= 7.0.4.3)
66
+ activerecord (= 7.0.4.3)
67
+ activesupport (= 7.0.4.3)
68
68
  marcel (~> 1.0)
69
69
  mini_mime (>= 1.1.0)
70
- activesupport (7.0.4.1)
70
+ activesupport (7.0.4.3)
71
71
  concurrent-ruby (~> 1.0, >= 1.0.2)
72
72
  i18n (>= 1.6, < 2)
73
73
  minitest (>= 5.1)
@@ -77,21 +77,21 @@ GEM
77
77
  rake
78
78
  thor (>= 0.14.0)
79
79
  builder (3.2.4)
80
- concurrent-ruby (1.1.10)
80
+ concurrent-ruby (1.2.2)
81
81
  crass (1.0.6)
82
82
  date (3.3.3)
83
83
  diff-lcs (1.5.0)
84
84
  erubi (1.12.0)
85
- fakeredis (0.8.0)
86
- redis (~> 4.1)
87
- globalid (1.0.0)
85
+ fakeredis (0.9.1)
86
+ redis (~> 4.8)
87
+ globalid (1.1.0)
88
88
  activesupport (>= 5.0)
89
- i18n (1.12.0)
89
+ i18n (1.13.0)
90
90
  concurrent-ruby (~> 1.0)
91
- loofah (2.19.1)
91
+ loofah (2.20.0)
92
92
  crass (~> 1.0.2)
93
93
  nokogiri (>= 1.5.9)
94
- mail (2.8.0.1)
94
+ mail (2.8.1)
95
95
  mini_mime (>= 0.1.1)
96
96
  net-imap
97
97
  net-pop
@@ -99,7 +99,7 @@ GEM
99
99
  marcel (1.0.2)
100
100
  method_source (1.0.0)
101
101
  mini_mime (1.1.2)
102
- minitest (5.17.0)
102
+ minitest (5.18.0)
103
103
  net-imap (0.3.4)
104
104
  date
105
105
  net-protocol
@@ -109,65 +109,71 @@ GEM
109
109
  timeout
110
110
  net-smtp (0.3.3)
111
111
  net-protocol
112
- nio4r (2.5.8)
113
- nokogiri (1.14.0-x86_64-darwin)
112
+ nio4r (2.5.9)
113
+ nokogiri (1.14.3-x86_64-darwin)
114
114
  racc (~> 1.4)
115
- nokogiri (1.14.0-x86_64-linux)
115
+ nokogiri (1.14.3-x86_64-linux)
116
116
  racc (~> 1.4)
117
117
  racc (1.6.2)
118
- rack (2.2.6.1)
119
- rack-test (2.0.2)
118
+ rack (2.2.7)
119
+ rack-test (2.1.0)
120
120
  rack (>= 1.3)
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)
121
+ rails (7.0.4.3)
122
+ actioncable (= 7.0.4.3)
123
+ actionmailbox (= 7.0.4.3)
124
+ actionmailer (= 7.0.4.3)
125
+ actionpack (= 7.0.4.3)
126
+ actiontext (= 7.0.4.3)
127
+ actionview (= 7.0.4.3)
128
+ activejob (= 7.0.4.3)
129
+ activemodel (= 7.0.4.3)
130
+ activerecord (= 7.0.4.3)
131
+ activestorage (= 7.0.4.3)
132
+ activesupport (= 7.0.4.3)
133
133
  bundler (>= 1.15.0)
134
- railties (= 7.0.4.1)
134
+ railties (= 7.0.4.3)
135
135
  rails-dom-testing (2.0.3)
136
136
  activesupport (>= 4.2.0)
137
137
  nokogiri (>= 1.6)
138
- rails-html-sanitizer (1.4.4)
138
+ rails-html-sanitizer (1.5.0)
139
139
  loofah (~> 2.19, >= 2.19.1)
140
- railties (7.0.4.1)
141
- actionpack (= 7.0.4.1)
142
- activesupport (= 7.0.4.1)
140
+ railties (7.0.4.3)
141
+ actionpack (= 7.0.4.3)
142
+ activesupport (= 7.0.4.3)
143
143
  method_source
144
144
  rake (>= 12.2)
145
145
  thor (~> 1.0)
146
146
  zeitwerk (~> 2.5)
147
147
  rake (13.0.6)
148
- redis (4.8.0)
148
+ redis (4.8.1)
149
149
  rspec (3.12.0)
150
150
  rspec-core (~> 3.12.0)
151
151
  rspec-expectations (~> 3.12.0)
152
152
  rspec-mocks (~> 3.12.0)
153
- rspec-core (3.12.0)
153
+ rspec-core (3.12.2)
154
154
  rspec-support (~> 3.12.0)
155
- rspec-expectations (3.12.2)
155
+ rspec-expectations (3.12.3)
156
156
  diff-lcs (>= 1.2.0, < 2.0)
157
157
  rspec-support (~> 3.12.0)
158
- rspec-mocks (3.12.3)
158
+ rspec-mocks (3.12.5)
159
159
  diff-lcs (>= 1.2.0, < 2.0)
160
160
  rspec-support (~> 3.12.0)
161
161
  rspec-support (3.12.0)
162
+ slim (5.1.0)
163
+ temple (~> 0.10.0)
164
+ tilt (>= 2.0.6, < 2.2)
165
+ temple (0.10.0)
162
166
  thor (1.2.1)
167
+ tilt (2.1.0)
163
168
  timecop (0.9.6)
164
- timeout (0.3.1)
165
- tzinfo (2.0.5)
169
+ timeout (0.3.2)
170
+ tzinfo (2.0.6)
166
171
  concurrent-ruby (~> 1.0)
172
+ webrick (1.8.1)
167
173
  websocket-driver (0.7.5)
168
174
  websocket-extensions (>= 0.1.0)
169
175
  websocket-extensions (0.1.5)
170
- zeitwerk (2.6.6)
176
+ zeitwerk (2.6.7)
171
177
 
172
178
  PLATFORMS
173
179
  x86_64-darwin-21
@@ -177,11 +183,15 @@ DEPENDENCIES
177
183
  appraisal
178
184
  deprecation_collector!
179
185
  fakeredis
186
+ rack
187
+ rack-test
180
188
  rails (~> 7.0)
181
189
  rake (~> 13.0)
182
190
  redis (~> 4.8)
183
191
  rspec (~> 3.0)
192
+ slim
184
193
  timecop
194
+ webrick
185
195
 
186
196
  BUNDLED WITH
187
197
  2.3.10
@@ -7,5 +7,8 @@ gem "rspec", "~> 3.0"
7
7
  gem "timecop"
8
8
  gem "fakeredis"
9
9
  gem "redis", "~>4.8"
10
+ gem "rack"
11
+ gem "webrick"
12
+ gem "slim"
10
13
 
11
14
  gemspec path: "../"
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- deprecation_collector (0.2.0)
4
+ deprecation_collector (0.4.0)
5
5
  redis (>= 3.0)
6
6
 
7
7
  GEM
@@ -12,25 +12,34 @@ GEM
12
12
  rake
13
13
  thor (>= 0.14.0)
14
14
  diff-lcs (1.5.0)
15
- fakeredis (0.8.0)
16
- redis (~> 4.1)
15
+ fakeredis (0.9.1)
16
+ redis (~> 4.8)
17
+ rack (3.0.7)
18
+ rack-test (2.1.0)
19
+ rack (>= 1.3)
17
20
  rake (13.0.6)
18
- redis (4.8.0)
21
+ redis (4.8.1)
19
22
  rspec (3.12.0)
20
23
  rspec-core (~> 3.12.0)
21
24
  rspec-expectations (~> 3.12.0)
22
25
  rspec-mocks (~> 3.12.0)
23
- rspec-core (3.12.0)
26
+ rspec-core (3.12.2)
24
27
  rspec-support (~> 3.12.0)
25
- rspec-expectations (3.12.2)
28
+ rspec-expectations (3.12.3)
26
29
  diff-lcs (>= 1.2.0, < 2.0)
27
30
  rspec-support (~> 3.12.0)
28
- rspec-mocks (3.12.3)
31
+ rspec-mocks (3.12.5)
29
32
  diff-lcs (>= 1.2.0, < 2.0)
30
33
  rspec-support (~> 3.12.0)
31
34
  rspec-support (3.12.0)
35
+ slim (5.1.0)
36
+ temple (~> 0.10.0)
37
+ tilt (>= 2.0.6, < 2.2)
38
+ temple (0.10.0)
32
39
  thor (1.2.1)
40
+ tilt (2.1.0)
33
41
  timecop (0.9.6)
42
+ webrick (1.8.1)
34
43
 
35
44
  PLATFORMS
36
45
  x86_64-darwin-21
@@ -40,10 +49,14 @@ DEPENDENCIES
40
49
  appraisal
41
50
  deprecation_collector!
42
51
  fakeredis
52
+ rack
53
+ rack-test
43
54
  rake (~> 13.0)
44
55
  redis (~> 4.8)
45
56
  rspec (~> 3.0)
57
+ slim
46
58
  timecop
59
+ webrick
47
60
 
48
61
  BUNDLED WITH
49
62
  2.3.10
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class DeprecationCollector
4
- VERSION = "0.3.0"
4
+ VERSION = "0.4.0"
5
5
  end
@@ -10,7 +10,9 @@ class DeprecationCollector
10
10
  extend Web::Router
11
11
  helpers Helpers
12
12
 
13
- def initialize
13
+ attr_reader :web
14
+ def initialize(web)
15
+ @web = web
14
16
  unless defined?(Temple::Utils) || ENV['DEPRECATION_COLLECTOR_RELOAD_WEB_TEMPLATES']
15
17
  # used for escaping in compiled slim templates
16
18
  require_relative 'utils'
@@ -18,11 +20,11 @@ class DeprecationCollector
18
20
  end
19
21
 
20
22
  def call(env)
21
- self.class.call(env)
23
+ self.class.call(env, self)
22
24
  end
23
25
 
24
26
  root do # index
25
- @deprecations = collector_instance.read_each.to_a
27
+ @deprecations = collector_instance.read_each.to_a.compact
26
28
  @deprecations = @deprecations.sort_by { |dep| dep[:message] } unless params[:sort] == '0'
27
29
 
28
30
  if params[:reject]
@@ -37,7 +39,19 @@ class DeprecationCollector
37
39
  end
38
40
 
39
41
  get '/dump.json' do
40
- render json: collector_instance.read_each.to_a
42
+ render json: collector_instance.dump
43
+ end
44
+
45
+ get '/import' do
46
+ return "Import not enabled" unless import_enabled?
47
+
48
+ render slim: "import.html"
49
+ end
50
+
51
+ post '/import' do
52
+ halt 422, "need multipart json file" unless env['CONTENT_TYPE']&.start_with?('multipart/form-data') && params.dig(:file, :tempfile)
53
+ collector_instance.import_dump(File.read(params[:file][:tempfile]))
54
+ redirect_to deprecations_path
41
55
  end
42
56
 
43
57
  get '/:id' do # show
@@ -7,6 +7,10 @@ class DeprecationCollector
7
7
  @collector_instance || DeprecationCollector.instance
8
8
  end
9
9
 
10
+ def import_enabled?
11
+ @web.import_enabled
12
+ end
13
+
10
14
  def root_path
11
15
  # request.base_url ?
12
16
  "#{env["SCRIPT_NAME"]}/"
@@ -32,12 +36,41 @@ class DeprecationCollector
32
36
  "#{root_path}disable"
33
37
  end
34
38
 
39
+ def dump_deprecations_path
40
+ "#{root_path}dump.json"
41
+ end
42
+
43
+ def import_deprecations_path
44
+ "#{root_path}import"
45
+ end
46
+
35
47
  def trigger_kwargs_error_warning(foo: nil); end
36
48
 
37
49
  def trigger_rails_deprecation
38
50
  return unless defined?(ActiveSupport::Deprecation)
39
51
  -> { ActiveSupport::Deprecation.warn("Test deprecation") } []
40
52
  end
53
+
54
+ def current_color_theme
55
+ return 'dark' if params['dark']
56
+ return 'light' if params['light']
57
+ return 'dark' if request.get_header('HTTP_Sec_CH_Prefers_Color_Scheme').to_s.downcase.include?("dark")
58
+ 'auto'
59
+ end
60
+
61
+ def deprecation_tags(deprecation)
62
+ {}.tap do |tags|
63
+ tags[:kwargs] = 'bg-secondary' if deprecation[:message].include?("Using the last argument as keyword parameters is deprecated") ||
64
+ deprecation[:message].include?("Passing the keyword argument as the last hash parameter is deprecated")
65
+
66
+ tags[:test] = 'bg-success' if deprecation[:message].include?("trigger_kwargs_error_warning") ||
67
+ deprecation[:message].include?("trigger_rails_deprecation")
68
+
69
+ tags[deprecation[:realm]] = 'bg-secondary' if deprecation[:realm] && deprecation[:realm] != 'rails'
70
+
71
+ deprecation.dig(:notes, :tags)&.each { |tag| tags[tag] = 'bg-secondary' }
72
+ end
73
+ end
41
74
  end
42
75
  end
43
76
  end
@@ -46,7 +46,7 @@ class DeprecationCollector
46
46
  end
47
47
  end
48
48
 
49
- def call(env)
49
+ def call(env, application=nil)
50
50
  action = match(env)
51
51
  unless action
52
52
  return [
@@ -57,7 +57,7 @@ class DeprecationCollector
57
57
  end
58
58
 
59
59
  resp = catch(:halt) do
60
- action.call(env)
60
+ action.call(env, application)
61
61
  ensure
62
62
  end
63
63
 
@@ -116,7 +116,8 @@ class DeprecationCollector
116
116
  @block = block
117
117
  end
118
118
 
119
- def call(env)
119
+ def call(env, application)
120
+ @web = application.web
120
121
  instance_exec(&@block)
121
122
  end
122
123
 
@@ -134,8 +135,8 @@ class DeprecationCollector
134
135
  .merge!(route_params.transform_keys(&:to_s))
135
136
  end
136
137
 
137
- def halt(res)
138
- throw :halt, [res, {"content-type" => "text/plain"}, [res.to_s]]
138
+ def halt(res, content=nil)
139
+ throw :halt, [res, {"content-type" => "text/plain"}, [content || res.to_s]]
139
140
  end
140
141
 
141
142
  def redirect_to(location)
@@ -145,7 +146,10 @@ class DeprecationCollector
145
146
  def render(plain: nil, html: nil, json: nil, erb: nil, slim: nil, status: 200, locals: nil, layout: 'layout.html.slim')
146
147
  raise ArgumentError, "provide exactly one render format" unless [plain, html, json, erb, slim].compact.size == 1
147
148
 
148
- return [status, {"content-type" => "application/json"}, [JSON.generate(json)]] if json
149
+ if json
150
+ json = JSON.generate(json) unless json.is_a?(String)
151
+ return [status, {"content-type" => "application/json"}, [json]]
152
+ end
149
153
  return [status, {"content-type" => "text/plain"}, [plain.to_s]] if plain
150
154
 
151
155
  _define_locals(locals) if locals
@@ -154,7 +158,13 @@ class DeprecationCollector
154
158
  html = render_template(template) if template
155
159
  html = render_template(layout) { html } if layout
156
160
 
157
- return [status, {"content-type" => "text/html"}, [html.to_s]] if html
161
+ color_scheme_headers = {
162
+ 'Accept-CH' => 'Sec-CH-Prefers-Color-Scheme',
163
+ 'Vary' => 'Sec-CH-Prefers-Color-Scheme',
164
+ 'Critical-CH' => 'Sec-CH-Prefers-Color-Scheme'
165
+ }
166
+
167
+ return [status, {"content-type" => "text/html"}.merge(color_scheme_headers), [html.to_s]] if html
158
168
  end
159
169
 
160
170
  VIEW_PATH = "#{__dir__}/views"
@@ -0,0 +1,13 @@
1
+ _buf = ''; _buf << ("<header><h1>Import dump</h1></header><main><form".freeze);
2
+ ;
3
+ ;
4
+ ;
5
+ ; _slim_codeattributes1 = import_deprecations_path; if _slim_codeattributes1; if _slim_codeattributes1 == true; _buf << (" action=\"\"".freeze); else; _buf << (" action=\"".freeze); _buf << ((::Temple::Utils.escape_html((_slim_codeattributes1))).to_s); _buf << ("\"".freeze); end; end; _buf << (" enctype=\"multipart/form-data\" method=\"post\"><div class=\"mb-3\"><label class=\"form-label\" for=\"file\">Choose a JSON file to upload:</label> <input class=\"form-comtrol\" id=\"file\" name=\"file\" type=\"file\" /></div><div class=\"mb-3\"><button class=\"btn btn-primary\" type=\"submit\">Upload</button> <a class=\"btn btn-secondary\"".freeze);
6
+ ;
7
+ ;
8
+ ;
9
+ ;
10
+ ;
11
+ ; _slim_codeattributes2 = dump_deprecations_path; if _slim_codeattributes2; if _slim_codeattributes2 == true; _buf << (" href=\"\"".freeze); else; _buf << (" href=\"".freeze); _buf << ((::Temple::Utils.escape_html((_slim_codeattributes2))).to_s); _buf << ("\"".freeze); end; end; _buf << (">Dump</a> <a class=\"btn btn-secondary\"".freeze);
12
+ ; _slim_codeattributes3 = deprecations_path; if _slim_codeattributes3; if _slim_codeattributes3 == true; _buf << (" href=\"\"".freeze); else; _buf << (" href=\"".freeze); _buf << ((::Temple::Utils.escape_html((_slim_codeattributes3))).to_s); _buf << ("\"".freeze); end; end; _buf << (">Back</a> </div></form></main>".freeze);
13
+ ; _buf
@@ -1,4 +1,4 @@
1
- _buf = ''; _buf << ("<header><h1>Deprecations</h1><a class=\"btn btn-primary\" data-method=\"post\"".freeze);
1
+ _buf = ''; _buf << ("<header class=\"mb-3\"><h1>Deprecations</h1><a class=\"btn btn-primary\" data-method=\"post\"".freeze);
2
2
  ;
3
3
  ;
4
4
  ; _slim_codeattributes1 = deprecation_path(:trigger); if _slim_codeattributes1; if _slim_codeattributes1 == true; _buf << (" href=\"\"".freeze); else; _buf << (" href=\"".freeze); _buf << ((::Temple::Utils.escape_html((_slim_codeattributes1))).to_s); _buf << ("\"".freeze); end; end; _buf << (" rel=\"nofollow\">Trigger a couple</a> <a class=\"btn btn-danger\" data-confirm=\"Sure?\" data-method=\"delete\"".freeze);
@@ -31,61 +31,77 @@ _buf = ''; _buf << ("<header><h1>Deprecations</h1><a class=\"btn btn-primary\" d
31
31
  ;
32
32
  ; _slim_codeattributes6 = deprecation_path(deprecation[:digest]); if _slim_codeattributes6; if _slim_codeattributes6 == true; _buf << (" href=\"\"".freeze); else; _buf << (" href=\"".freeze); _buf << ((::Temple::Utils.escape_html((_slim_codeattributes6))).to_s); _buf << ("\"".freeze); end; end; _buf << (">".freeze); _buf << ((::Temple::Utils.escape_html((deprecation[:count]))).to_s);
33
33
  ; _buf << ("</a><br />".freeze);
34
- ; if deprecation[:message].include?("Using the last argument as keyword parameters is deprecated") || \
35
- deprecation[:message].include?("Passing the keyword argument as the last hash parameter is deprecated");
36
- ; _buf << ("<div class=\"badge bg-secondary\">kwargs</div> ".freeze);
37
- ; end; if deprecation[:message].include?("trigger_kwargs_error_warning") || \
38
- deprecation[:message].include?("trigger_rails_deprecation");
39
- ; _buf << ("<div class=\"badge bg-success\">test</div> ".freeze);
40
- ; end; if deprecation[:realm] && deprecation[:realm] != 'rails';
41
- ; _buf << ("<div class=\"badge bg-secondary\">".freeze); _buf << ((::Temple::Utils.escape_html((deprecation[:realm]))).to_s);
42
- ; _buf << ("</div> ".freeze); end; deprecation.dig(:notes, :tags)&.each do |tag|;
43
- ; _buf << ("<div class=\"badge bg-secondary\">".freeze); _buf << ((::Temple::Utils.escape_html((tag))).to_s);
34
+ ; deprecation_tags(deprecation).each_pair do |tag, cls|;
35
+ ; _buf << ("<div".freeze); _temple_html_attributeremover1 = ''; _temple_html_attributemerger1 = []; _temple_html_attributemerger1[0] = "badge"; _temple_html_attributemerger1[1] = ''; _slim_codeattributes7 = cls; if Array === _slim_codeattributes7; _slim_codeattributes7 = _slim_codeattributes7.flatten; _slim_codeattributes7.map!(&:to_s); _slim_codeattributes7.reject!(&:empty?); _temple_html_attributemerger1[1] << ((::Temple::Utils.escape_html((_slim_codeattributes7.join(" ")))).to_s); else; _temple_html_attributemerger1[1] << ((::Temple::Utils.escape_html((_slim_codeattributes7))).to_s); end; _temple_html_attributemerger1[1]; _temple_html_attributeremover1 << ((_temple_html_attributemerger1.reject(&:empty?).join(" ")).to_s); _temple_html_attributeremover1; if !_temple_html_attributeremover1.empty?; _buf << (" class=\"".freeze); _buf << ((_temple_html_attributeremover1).to_s); _buf << ("\"".freeze); end; _buf << (">".freeze); _buf << ((::Temple::Utils.escape_html((tag))).to_s);
44
36
  ;
45
37
  ; _buf << ("</div> ".freeze); end; _buf << ("</td><td>".freeze);
46
38
  ;
47
39
  ; msg = deprecation[:message]
48
40
  delete_prefixes = Gem.path + [defined?(Rails) && Rails.root.to_s].compact
49
41
  delete_prefixes.each { |path| msg.gsub!(path, '') }
50
- ;
51
- ; _buf << ("<div class=\"card text-dark bg-light\"><pre class=\"pre-scrollable\" style=\"overflow: auto; max-width: 700px; max-height: 200px; font-size: 11px\"><code>".freeze);
52
- ;
53
- ; _buf << ((::Temple::Utils.escape_html((msg.delete_prefix("DEPRECATION WARNING: ")))).to_s);
54
- ; _buf << ("</code></pre></div>".freeze); if deprecation.dig(:notes, :comment);
42
+ msg.delete_prefix! deprecation[:gem_traceline].gsub(/:in .+/, ':') if deprecation[:gem_traceline]
43
+ msg.delete_prefix! deprecation[:app_traceline].gsub(/:in .+/, ':') if deprecation[:app_traceline]
44
+ msg.strip!
45
+ msg.delete_prefix!("DEPRECATION WARNING: ")
46
+ msg.delete_prefix!("warning: ")
47
+ ;
48
+ ; if msg.lines.size > 2;
49
+ ; _buf << ("<pre class=\"pre-scrollable p-1\" style=\"overflow: auto; max-width: 700px; max-height: 200px; font-size: 11px\"><code>".freeze);
50
+ ; _buf << ((::Temple::Utils.escape_html((msg))).to_s);
51
+ ; _buf << ("</code></pre>".freeze); else;
52
+ ; _buf << ("<div class=\"small\">".freeze); _buf << ((::Temple::Utils.escape_html((msg))).to_s);
53
+ ; _buf << ("</div>".freeze); end; if deprecation.dig(:notes, :comment);
55
54
  ; _buf << ((::Temple::Utils.escape_html((deprecation.dig(:notes, :comment)))).to_s);
56
55
  ;
57
56
  ; end; if deprecation.dig(:context, :action);
58
57
  ; _buf << ("<div class=\"small controller\">".freeze); _buf << ((::Temple::Utils.escape_html((deprecation.dig(:context, :action)))).to_s);
59
58
  ; _buf << ("</div>".freeze); elsif deprecation.dig(:context, :params, :controller);
60
59
  ; _buf << ("<div class=\"small controller\">".freeze); _buf << ((::Temple::Utils.escape_html((deprecation.dig(:context, :params).slice(:controller, :action).values.join('#')))).to_s);
61
- ; _buf << ("</div>".freeze); end; _buf << ("</td><td>".freeze);
60
+ ;
61
+ ; _buf << ("</div>".freeze); end; _buf << ("</td><td class=\"small\">".freeze);
62
62
  ; if deprecation[:gem_traceline];
63
- ; _buf << ((::Temple::Utils.escape_html((deprecation[:gem_traceline]))).to_s);
64
- ; _buf << ("<br>".freeze);
65
- ; end; if deprecation[:app_traceline];
63
+ ; _buf << ("<div class=\"gem_location\">".freeze);
64
+ ; location, function = deprecation[:gem_traceline].split(':in `', 2);
65
+ ; full_gemname = location.delete_prefix('/gems/').gsub(%r{/.*}, '');
66
+ ; location_in_gem = location.delete_prefix("/gems/#{full_gemname}/");
67
+ ; _buf << ("<i>".freeze); _buf << ((::Temple::Utils.escape_html((full_gemname))).to_s);
68
+ ; _buf << ("</i> <code class=\"code_location\"".freeze); _slim_codeattributes8 = location_in_gem; if _slim_codeattributes8; if _slim_codeattributes8 == true; _buf << (" data-copy-value=\"\"".freeze); else; _buf << (" data-copy-value=\"".freeze); _buf << ((::Temple::Utils.escape_html((_slim_codeattributes8))).to_s); _buf << ("\"".freeze); end; end; _buf << (">".freeze); _buf << ((::Temple::Utils.escape_html((location_in_gem.delete_prefix('lib/')))).to_s);
69
+ ; _buf << ("</code> <i>".freeze); _buf << ((::Temple::Utils.escape_html((function.delete_suffix("'")))).to_s);
70
+ ; _buf << ("</i></div>".freeze); end; if deprecation[:app_traceline];
71
+ ; _buf << ("<div class=\"app_location\">".freeze);
66
72
  ; location, function = deprecation[:app_traceline].split(':in `', 2);
67
- ; _buf << ("<code class=\"code_location\" style=\"cursor: pointer\">".freeze); _buf << ((::Temple::Utils.escape_html((location))).to_s);
68
- ; _buf << ("</code> ".freeze); _buf << ((::Temple::Utils.escape_html((function.delete_suffix("'")))).to_s);
69
- ; end; _buf << ("</td><td><div class=\"small ruby\">".freeze);
73
+ ; _buf << ("<code class=\"code_location\">".freeze); _buf << ((::Temple::Utils.escape_html((location))).to_s);
74
+ ; _buf << ("</code> <i>".freeze); _buf << ((::Temple::Utils.escape_html((function.delete_suffix("'")))).to_s);
75
+ ; _buf << ("</i></div>".freeze); end; _buf << ("</td><td><div class=\"small ruby\">".freeze);
70
76
  ; _buf << ((::Temple::Utils.escape_html((deprecation[:ruby_version]))).to_s);
71
77
  ; _buf << ("</div><div class=\"small rails\">".freeze); _buf << ((::Temple::Utils.escape_html((deprecation[:rails_version]))).to_s);
72
78
  ;
73
- ; _buf << ("</div><a data-confirm=\"Delete?\" data-method=\"delete\"".freeze); _slim_codeattributes7 = deprecation_path(deprecation[:digest]); if _slim_codeattributes7; if _slim_codeattributes7 == true; _buf << (" href=\"\"".freeze); else; _buf << (" href=\"".freeze); _buf << ((::Temple::Utils.escape_html((_slim_codeattributes7))).to_s); _buf << ("\"".freeze); end; end; _buf << (" rel=\"nofollow\" title=\"Delete\"><i class=\"bi bi-trash\"></i></a></td></tr>".freeze);
79
+ ; _buf << ("</div><a data-confirm=\"Delete?\" data-method=\"delete\"".freeze); _slim_codeattributes9 = deprecation_path(deprecation[:digest]); if _slim_codeattributes9; if _slim_codeattributes9 == true; _buf << (" href=\"\"".freeze); else; _buf << (" href=\"".freeze); _buf << ((::Temple::Utils.escape_html((_slim_codeattributes9))).to_s); _buf << ("\"".freeze); end; end; _buf << (" rel=\"nofollow\" title=\"Delete\"><i class=\"bi bi-trash\"></i></a></td></tr>".freeze);
74
80
  ;
75
81
  ; end; if total.zero?;
76
82
  ; _buf << ("<tr><td".freeze);
77
- ; _slim_codeattributes8 = 4; if _slim_codeattributes8; if _slim_codeattributes8 == true; _buf << (" colspan=\"\"".freeze); else; _buf << (" colspan=\"".freeze); _buf << ((::Temple::Utils.escape_html((_slim_codeattributes8))).to_s); _buf << ("\"".freeze); end; end; _buf << ("><p>Looks like there're no deprecations</p><p>You can try <a data-method=\"post\"".freeze);
83
+ ; _slim_codeattributes10 = 4; if _slim_codeattributes10; if _slim_codeattributes10 == true; _buf << (" colspan=\"\"".freeze); else; _buf << (" colspan=\"".freeze); _buf << ((::Temple::Utils.escape_html((_slim_codeattributes10))).to_s); _buf << ("\"".freeze); end; end; _buf << ("><p>Looks like there're no deprecations (or workers have not yet wrote to redis)</p><p>You can try <a data-method=\"post\"".freeze);
78
84
  ;
79
85
  ;
80
86
  ;
81
- ; _slim_codeattributes9 = deprecation_path(:trigger); if _slim_codeattributes9; if _slim_codeattributes9 == true; _buf << (" href=\"\"".freeze); else; _buf << (" href=\"".freeze); _buf << ((::Temple::Utils.escape_html((_slim_codeattributes9))).to_s); _buf << ("\"".freeze); end; end; _buf << (" rel=\"nofollow\">trigger a couple</a></p></td></tr>".freeze);
87
+ ; _slim_codeattributes11 = deprecation_path(:trigger); if _slim_codeattributes11; if _slim_codeattributes11 == true; _buf << (" href=\"\"".freeze); else; _buf << (" href=\"".freeze); _buf << ((::Temple::Utils.escape_html((_slim_codeattributes11))).to_s); _buf << ("\"".freeze); end; end; _buf << (" rel=\"nofollow\">trigger a couple</a>".freeze);
88
+ ; if import_enabled?;
89
+ ; _buf << (", or <a".freeze);
90
+ ; _slim_codeattributes12 = import_deprecations_path; if _slim_codeattributes12; if _slim_codeattributes12 == true; _buf << (" href=\"\"".freeze); else; _buf << (" href=\"".freeze); _buf << ((::Temple::Utils.escape_html((_slim_codeattributes12))).to_s); _buf << ("\"".freeze); end; end; _buf << (">import</a> ".freeze);
82
91
  ;
83
- ; end; _buf << ("</table></main><footer>".freeze);
92
+ ;
93
+ ; end; _buf << ("</p></td></tr>".freeze); end; _buf << ("</table></main><footer>".freeze);
84
94
  ; if total > 3;
85
95
  ; _buf << ((::Temple::Utils.escape_html((total))).to_s);
86
96
  ; _buf << (" deprecations ".freeze);
97
+ ; end; _buf << ("</footer><style>.code_location {\n cursor: pointer;\n}</style><script>document.querySelectorAll('.code_location').forEach(function(elem){\n elem.addEventListener('click', function () {\n let textToCopy = elem.getAttribute('data-copy-value');\n if(!textToCopy) textToCopy = elem.innerText;\n console.log(\"Copying\", textToCopy)\n navigator.clipboard.writeText(textToCopy);\n }, false);\n});</script>".freeze);
98
+ ;
99
+ ;
100
+ ;
101
+ ;
102
+ ;
103
+ ;
87
104
  ;
88
- ; end; _buf << ("</footer><script>document.querySelectorAll('.code_location').forEach(function(elem){\n elem.addEventListener('click', function () {\n console.log(\"Copying\", elem.innerText)\n navigator.clipboard.writeText(elem.innerText);\n }, false);\n});</script>".freeze);
89
105
  ;
90
106
  ;
91
107
  ;
@@ -1,11 +1,11 @@
1
- _buf = ''; _buf << ("<!DOCTYPE html><html><head><meta charset=\"utf-8\" /><meta content=\"IE=edge;chrome=1\" http-equiv=\"X-UA-Compatible\" /><title>".freeze);
2
- ;
1
+ _buf = ''; _buf << ("<!DOCTYPE html><html".freeze);
2
+ ; _slim_codeattributes1 = current_color_theme; if _slim_codeattributes1; if _slim_codeattributes1 == true; _buf << (" data-bs-theme=\"\"".freeze); else; _buf << (" data-bs-theme=\"".freeze); _buf << ((::Temple::Utils.escape_html((_slim_codeattributes1))).to_s); _buf << ("\"".freeze); end; end; _buf << (" lang=\"en\"><head><meta charset=\"utf-8\" /><meta content=\"IE=edge;chrome=1\" http-equiv=\"X-UA-Compatible\" /><title>".freeze);
3
3
  ;
4
4
  ;
5
5
  ;
6
6
  ;
7
7
  ; _buf << ((::Temple::Utils.escape_html(("Deprecations"))).to_s);
8
- ; _buf << ("</title><meta content=\"\" name=\"description\" /><meta content=\"width=device-width\" name=\"viewport\" /><link href=\"https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css\" rel=\"stylesheet\" /><link href=\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.2/font/bootstrap-icons.css\" rel=\"stylesheet\" /></head><body><div class=\"container-fluid\">".freeze);
8
+ ; _buf << ("</title><meta content=\"Deprecation collector ui\" name=\"description\" /><meta content=\"width=device-width\" name=\"viewport\" /><link crossorigin=\"anonymous\" href=\"https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css\" integrity=\"sha256-Fu5/PVNGJlC70y4mPEjA6nWVdPz2IMaBrXGQCJEsRho= sha384-KK94CHFLLe+nY2dmCWGMq91rCGa5gtU4mk92HdvYe+M/SXH301p5ILy+dN9+nJOZ\" rel=\"stylesheet\" /><link crossorigin=\"anonymous\" href=\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.2/font/bootstrap-icons.css\" integrity=\"sha256-4RctOgogjPAdwGbwq+rxfwAmSpZhWaafcZR9btzUk18= sha384-b6lVK+yci+bfDmaY1u0zE8YYJt0TZxLEAFyYSLHId4xoVvsrQu3INevFKo+Xir8e\" rel=\"stylesheet\" /></head><body><div class=\"container-fluid\">".freeze);
9
9
  ;
10
10
  ;
11
11
  ;
@@ -14,5 +14,78 @@ _buf = ''; _buf << ("<!DOCTYPE html><html><head><meta charset=\"utf-8\" /><meta
14
14
  ;
15
15
  ; _buf << ((yield).to_s);
16
16
  ;
17
- ; _buf << ("</div><script src=\"https://cdn.jsdelivr.net/npm/rails-ujs@5.2.8-1/lib/assets/compiled/rails-ujs.min.js\"></script></body></html>".freeze);
17
+ ; _buf << ("</div><script async=\"\" crossorigin=\"anonymous\" integrity=\"sha256-9Mbe9mGA7d+AJbnz0O6CoLGabCbe6JAYnGshvGIADiE=\" src=\"https://cdn.jsdelivr.net/npm/@rails/ujs@7.0.4-3/lib/assets/compiled/rails-ujs.js\"></script><script async=\"\" crossorigin=\"anonymous\" integrity=\"sha256-QucgBAKNM4KKPJHqTfH8e+JON1G/gmPPqtMmBb+wHpc= sha384-Y4oOpwW3duJdCWv5ly8SCFYWqFDsfob/3GkgExXKV4idmbt98QcxXYs9UoXAB7BZ\" src=\"https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.min.js\"></script><script>(() => {\n 'use strict'\n\n const storedTheme = localStorage.getItem('theme')\n\n const getPreferredTheme = () => {\n if (storedTheme) { return storedTheme }\n let fromServer = document.documentElement.getAttribute('data-bs-theme')\n if(fromServer) { return fromServer }\n return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'\n }\n\n const setTheme = function (theme) {\n if (theme === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches) {\n document.documentElement.setAttribute('data-bs-theme', 'dark')\n } else {\n document.documentElement.setAttribute('data-bs-theme', theme)\n }\n }\n\n setTheme(getPreferredTheme())\n\n const showActiveTheme = (theme, focus = false) => {\n const themeSwitcher = document.querySelector('#bd-theme')\n\n if (!themeSwitcher) {\n return\n }\n\n const themeSwitcherText = document.querySelector('#bd-theme-text')\n const activeThemeIcon = document.querySelector('.theme-icon-active use')\n const btnToActive = document.querySelector(`[data-bs-theme-value=\"${theme}\"]`)\n const svgOfActiveBtn = btnToActive.querySelector('svg use').getAttribute('href')\n\n document.querySelectorAll('[data-bs-theme-value]').forEach(element => {\n element.classList.remove('active')\n element.setAttribute('aria-pressed', 'false')\n })\n\n btnToActive.classList.add('active')\n btnToActive.setAttribute('aria-pressed', 'true')\n activeThemeIcon.setAttribute('href', svgOfActiveBtn)\n const themeSwitcherLabel = `${themeSwitcherText.textContent} (${btnToActive.dataset.bsThemeValue})`\n themeSwitcher.setAttribute('aria-label', themeSwitcherLabel)\n\n if (focus) {\n themeSwitcher.focus()\n }\n }\n\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => {\n if (storedTheme !== 'light' || storedTheme !== 'dark') {\n setTheme(getPreferredTheme())\n }\n })\n\n window.addEventListener('DOMContentLoaded', () => {\n showActiveTheme(getPreferredTheme())\n\n document.querySelectorAll('[data-bs-theme-value]')\n .forEach(toggle => {\n toggle.addEventListener('click', () => {\n const theme = toggle.getAttribute('data-bs-theme-value')\n localStorage.setItem('theme', theme)\n setTheme(theme)\n showActiveTheme(theme, true)\n })\n })\n })\n})()</script></body></html>".freeze);
18
+ ;
19
+ ;
20
+ ;
21
+ ;
22
+ ;
23
+ ;
24
+ ;
25
+ ;
26
+ ;
27
+ ;
28
+ ;
29
+ ;
30
+ ;
31
+ ;
32
+ ;
33
+ ;
34
+ ;
35
+ ;
36
+ ;
37
+ ;
38
+ ;
39
+ ;
40
+ ;
41
+ ;
42
+ ;
43
+ ;
44
+ ;
45
+ ;
46
+ ;
47
+ ;
48
+ ;
49
+ ;
50
+ ;
51
+ ;
52
+ ;
53
+ ;
54
+ ;
55
+ ;
56
+ ;
57
+ ;
58
+ ;
59
+ ;
60
+ ;
61
+ ;
62
+ ;
63
+ ;
64
+ ;
65
+ ;
66
+ ;
67
+ ;
68
+ ;
69
+ ;
70
+ ;
71
+ ;
72
+ ;
73
+ ;
74
+ ;
75
+ ;
76
+ ;
77
+ ;
78
+ ;
79
+ ;
80
+ ;
81
+ ;
82
+ ;
83
+ ;
84
+ ;
85
+ ;
86
+ ;
87
+ ;
88
+ ;
89
+ ;
90
+ ;
18
91
  ; _buf
@@ -1,8 +1,8 @@
1
1
  _buf = ''; _buf << ("<header class=\"mb-3\"><h1>Deprecation</h1><a class=\"btn btn-secondary\"".freeze);
2
2
  ;
3
3
  ;
4
- ; _slim_codeattributes1 = deprecations_path; if _slim_codeattributes1; if _slim_codeattributes1 == true; _buf << (" href=\"\"".freeze); else; _buf << (" href=\"".freeze); _buf << ((::Temple::Utils.escape_html((_slim_codeattributes1))).to_s); _buf << ("\"".freeze); end; end; _buf << (">Back</a><a class=\"btn btn-danger\" data-confirm=\"Delete?\" data-method=\"delete\"".freeze);
5
- ; _slim_codeattributes2 = deprecation_path(@deprecation[:digest]); if _slim_codeattributes2; if _slim_codeattributes2 == true; _buf << (" href=\"\"".freeze); else; _buf << (" href=\"".freeze); _buf << ((::Temple::Utils.escape_html((_slim_codeattributes2))).to_s); _buf << ("\"".freeze); end; end; _buf << (" rel=\"nofollow\" title=\"Delete\"><span class=\"glyphicon glyphicon-trash insalesicon-trash\"></span>Delete</a></header><main><div class=\"card text-dark bg-light p-3\"><pre><code>".freeze);
4
+ ; _slim_codeattributes1 = deprecations_path; if _slim_codeattributes1; if _slim_codeattributes1 == true; _buf << (" href=\"\"".freeze); else; _buf << (" href=\"".freeze); _buf << ((::Temple::Utils.escape_html((_slim_codeattributes1))).to_s); _buf << ("\"".freeze); end; end; _buf << (">Back</a> <a class=\"btn btn-danger\" data-confirm=\"Delete?\" data-method=\"delete\"".freeze);
5
+ ; _slim_codeattributes2 = deprecation_path(@deprecation[:digest]); if _slim_codeattributes2; if _slim_codeattributes2 == true; _buf << (" href=\"\"".freeze); else; _buf << (" href=\"".freeze); _buf << ((::Temple::Utils.escape_html((_slim_codeattributes2))).to_s); _buf << ("\"".freeze); end; end; _buf << (" rel=\"nofollow\" title=\"Delete\"><span class=\"glyphicon glyphicon-trash insalesicon-trash\"></span>Delete</a> </header><main><div class=\"card p-3\"><pre><code>".freeze);
6
6
  ;
7
7
  ;
8
8
  ;
@@ -8,6 +8,12 @@ require_relative 'web/application'
8
8
 
9
9
  class DeprecationCollector
10
10
  class Web
11
+ attr_accessor :import_enabled
12
+
13
+ def initialize(import_enabled: nil)
14
+ @import_enabled = import_enabled
15
+ end
16
+
11
17
  def self.call(env)
12
18
  @app ||= new
13
19
  @app.call(env)
@@ -23,10 +29,11 @@ class DeprecationCollector
23
29
 
24
30
  private
25
31
  def build
32
+ web = self
26
33
  ::Rack::Builder.new do
27
34
  # use Rack::Static etc goes here
28
35
 
29
- run Web::Application.new
36
+ run Web::Application.new(web)
30
37
  end
31
38
  end
32
39
  end
@@ -183,7 +183,19 @@ class DeprecationCollector
183
183
  end
184
184
 
185
185
  def dump
186
- read_each.to_a.to_json
186
+ read_each.to_a.compact.to_json
187
+ end
188
+
189
+ def import_dump(json)
190
+ dump = JSON.parse(json)
191
+ # TODO: some checks
192
+
193
+ digests = dump.map { |dep| dep["digest"] }
194
+ raise 'need digests' unless digests.none?(&:nil?)
195
+
196
+ dump_hash = dump.map { |dep| [dep.delete('digest'), dep] }.to_h
197
+
198
+ @redis.mapped_hmset("deprecations:data", dump_hash.transform_values(&:to_json))
187
199
  end
188
200
 
189
201
  def read_each
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.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vasily Fedoseyev
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-26 00:00:00.000000000 Z
11
+ date: 2023-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rack-test
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  description: Collects and aggregates warnings and deprecations. Optimized for production
42
56
  environment.
43
57
  email:
@@ -72,6 +86,7 @@ files:
72
86
  - lib/deprecation_collector/web/helpers.rb
73
87
  - lib/deprecation_collector/web/router.rb
74
88
  - lib/deprecation_collector/web/utils.rb
89
+ - lib/deprecation_collector/web/views/import.html.template.rb
75
90
  - lib/deprecation_collector/web/views/index.html.template.rb
76
91
  - lib/deprecation_collector/web/views/layout.html.template.rb
77
92
  - lib/deprecation_collector/web/views/show.html.template.rb
@@ -83,7 +98,7 @@ metadata:
83
98
  homepage_uri: https://github.com/Vasfed/deprecation_collector
84
99
  source_code_uri: https://github.com/Vasfed/deprecation_collector
85
100
  changelog_uri: https://github.com/Vasfed/deprecation_collector/blob/main/CHANGELOG.md
86
- post_install_message:
101
+ post_install_message:
87
102
  rdoc_options: []
88
103
  require_paths:
89
104
  - lib
@@ -98,8 +113,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
98
113
  - !ruby/object:Gem::Version
99
114
  version: '0'
100
115
  requirements: []
101
- rubygems_version: 3.4.1
102
- signing_key:
116
+ rubygems_version: 3.1.6
117
+ signing_key:
103
118
  specification_version: 4
104
119
  summary: Collector for ruby/rails deprecations and warnings, suitable for production
105
120
  test_files: []