is_this_used 0.1.5 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,62 +1,62 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- is_this_used (0.1.2)
4
+ is_this_used (0.1.5)
5
5
  activerecord (>= 5.2)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- actioncable (6.0.4.4)
11
- actionpack (= 6.0.4.4)
10
+ actioncable (6.0.4.6)
11
+ actionpack (= 6.0.4.6)
12
12
  nio4r (~> 2.0)
13
13
  websocket-driver (>= 0.6.1)
14
- actionmailbox (6.0.4.4)
15
- actionpack (= 6.0.4.4)
16
- activejob (= 6.0.4.4)
17
- activerecord (= 6.0.4.4)
18
- activestorage (= 6.0.4.4)
19
- activesupport (= 6.0.4.4)
14
+ actionmailbox (6.0.4.6)
15
+ actionpack (= 6.0.4.6)
16
+ activejob (= 6.0.4.6)
17
+ activerecord (= 6.0.4.6)
18
+ activestorage (= 6.0.4.6)
19
+ activesupport (= 6.0.4.6)
20
20
  mail (>= 2.7.1)
21
- actionmailer (6.0.4.4)
22
- actionpack (= 6.0.4.4)
23
- actionview (= 6.0.4.4)
24
- activejob (= 6.0.4.4)
21
+ actionmailer (6.0.4.6)
22
+ actionpack (= 6.0.4.6)
23
+ actionview (= 6.0.4.6)
24
+ activejob (= 6.0.4.6)
25
25
  mail (~> 2.5, >= 2.5.4)
26
26
  rails-dom-testing (~> 2.0)
27
- actionpack (6.0.4.4)
28
- actionview (= 6.0.4.4)
29
- activesupport (= 6.0.4.4)
27
+ actionpack (6.0.4.6)
28
+ actionview (= 6.0.4.6)
29
+ activesupport (= 6.0.4.6)
30
30
  rack (~> 2.0, >= 2.0.8)
31
31
  rack-test (>= 0.6.3)
32
32
  rails-dom-testing (~> 2.0)
33
33
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
34
- actiontext (6.0.4.4)
35
- actionpack (= 6.0.4.4)
36
- activerecord (= 6.0.4.4)
37
- activestorage (= 6.0.4.4)
38
- activesupport (= 6.0.4.4)
34
+ actiontext (6.0.4.6)
35
+ actionpack (= 6.0.4.6)
36
+ activerecord (= 6.0.4.6)
37
+ activestorage (= 6.0.4.6)
38
+ activesupport (= 6.0.4.6)
39
39
  nokogiri (>= 1.8.5)
40
- actionview (6.0.4.4)
41
- activesupport (= 6.0.4.4)
40
+ actionview (6.0.4.6)
41
+ activesupport (= 6.0.4.6)
42
42
  builder (~> 3.1)
43
43
  erubi (~> 1.4)
44
44
  rails-dom-testing (~> 2.0)
45
45
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
46
- activejob (6.0.4.4)
47
- activesupport (= 6.0.4.4)
46
+ activejob (6.0.4.6)
47
+ activesupport (= 6.0.4.6)
48
48
  globalid (>= 0.3.6)
49
- activemodel (6.0.4.4)
50
- activesupport (= 6.0.4.4)
51
- activerecord (6.0.4.4)
52
- activemodel (= 6.0.4.4)
53
- activesupport (= 6.0.4.4)
54
- activestorage (6.0.4.4)
55
- actionpack (= 6.0.4.4)
56
- activejob (= 6.0.4.4)
57
- activerecord (= 6.0.4.4)
49
+ activemodel (6.0.4.6)
50
+ activesupport (= 6.0.4.6)
51
+ activerecord (6.0.4.6)
52
+ activemodel (= 6.0.4.6)
53
+ activesupport (= 6.0.4.6)
54
+ activestorage (6.0.4.6)
55
+ actionpack (= 6.0.4.6)
56
+ activejob (= 6.0.4.6)
57
+ activerecord (= 6.0.4.6)
58
58
  marcel (~> 1.0.0)
59
- activesupport (6.0.4.4)
59
+ activesupport (6.0.4.6)
60
60
  concurrent-ruby (~> 1.0, >= 1.0.2)
61
61
  i18n (>= 0.7, < 2)
62
62
  minitest (~> 5.1)
@@ -79,9 +79,9 @@ GEM
79
79
  railties (>= 3.0.0)
80
80
  globalid (1.0.0)
81
81
  activesupport (>= 5.0)
82
- i18n (1.8.11)
82
+ i18n (1.10.0)
83
83
  concurrent-ruby (~> 1.0)
84
- loofah (2.13.0)
84
+ loofah (2.14.0)
85
85
  crass (~> 1.0.2)
86
86
  nokogiri (>= 1.5.9)
87
87
  mail (2.7.1)
@@ -89,13 +89,15 @@ GEM
89
89
  marcel (1.0.2)
90
90
  method_source (1.0.0)
91
91
  mini_mime (1.1.2)
92
+ mini_portile2 (2.8.0)
92
93
  minitest (5.15.0)
93
94
  mysql2 (0.5.3)
94
95
  nio4r (2.5.8)
95
- nokogiri (1.13.1-x86_64-darwin)
96
+ nokogiri (1.13.3)
97
+ mini_portile2 (~> 2.8.0)
96
98
  racc (~> 1.4)
97
99
  parallel (1.21.0)
98
- parser (3.1.0.0)
100
+ parser (3.1.1.0)
99
101
  ast (~> 2.4.1)
100
102
  pry (0.13.1)
101
103
  coderay (~> 1.1)
@@ -107,49 +109,49 @@ GEM
107
109
  rack (2.2.3)
108
110
  rack-test (1.1.0)
109
111
  rack (>= 1.0, < 3)
110
- rails (6.0.4.4)
111
- actioncable (= 6.0.4.4)
112
- actionmailbox (= 6.0.4.4)
113
- actionmailer (= 6.0.4.4)
114
- actionpack (= 6.0.4.4)
115
- actiontext (= 6.0.4.4)
116
- actionview (= 6.0.4.4)
117
- activejob (= 6.0.4.4)
118
- activemodel (= 6.0.4.4)
119
- activerecord (= 6.0.4.4)
120
- activestorage (= 6.0.4.4)
121
- activesupport (= 6.0.4.4)
112
+ rails (6.0.4.6)
113
+ actioncable (= 6.0.4.6)
114
+ actionmailbox (= 6.0.4.6)
115
+ actionmailer (= 6.0.4.6)
116
+ actionpack (= 6.0.4.6)
117
+ actiontext (= 6.0.4.6)
118
+ actionview (= 6.0.4.6)
119
+ activejob (= 6.0.4.6)
120
+ activemodel (= 6.0.4.6)
121
+ activerecord (= 6.0.4.6)
122
+ activestorage (= 6.0.4.6)
123
+ activesupport (= 6.0.4.6)
122
124
  bundler (>= 1.3.0)
123
- railties (= 6.0.4.4)
125
+ railties (= 6.0.4.6)
124
126
  sprockets-rails (>= 2.0.0)
125
127
  rails-dom-testing (2.0.3)
126
128
  activesupport (>= 4.2.0)
127
129
  nokogiri (>= 1.6)
128
130
  rails-html-sanitizer (1.4.2)
129
131
  loofah (~> 2.3)
130
- railties (6.0.4.4)
131
- actionpack (= 6.0.4.4)
132
- activesupport (= 6.0.4.4)
132
+ railties (6.0.4.6)
133
+ actionpack (= 6.0.4.6)
134
+ activesupport (= 6.0.4.6)
133
135
  method_source
134
136
  rake (>= 0.8.7)
135
137
  thor (>= 0.20.3, < 2.0)
136
138
  rainbow (3.1.1)
137
139
  rake (10.5.0)
138
- regexp_parser (2.2.0)
140
+ regexp_parser (2.2.1)
139
141
  rexml (3.2.5)
140
- rspec (3.10.0)
141
- rspec-core (~> 3.10.0)
142
- rspec-expectations (~> 3.10.0)
143
- rspec-mocks (~> 3.10.0)
144
- rspec-core (3.10.1)
145
- rspec-support (~> 3.10.0)
146
- rspec-expectations (3.10.2)
142
+ rspec (3.11.0)
143
+ rspec-core (~> 3.11.0)
144
+ rspec-expectations (~> 3.11.0)
145
+ rspec-mocks (~> 3.11.0)
146
+ rspec-core (3.11.0)
147
+ rspec-support (~> 3.11.0)
148
+ rspec-expectations (3.11.0)
147
149
  diff-lcs (>= 1.2.0, < 2.0)
148
- rspec-support (~> 3.10.0)
149
- rspec-mocks (3.10.2)
150
+ rspec-support (~> 3.11.0)
151
+ rspec-mocks (3.11.0)
150
152
  diff-lcs (>= 1.2.0, < 2.0)
151
- rspec-support (~> 3.10.0)
152
- rspec-rails (5.0.2)
153
+ rspec-support (~> 3.11.0)
154
+ rspec-rails (5.0.3)
153
155
  actionpack (>= 5.2)
154
156
  activesupport (>= 5.2)
155
157
  railties (>= 5.2)
@@ -157,7 +159,7 @@ GEM
157
159
  rspec-expectations (~> 3.10)
158
160
  rspec-mocks (~> 3.10)
159
161
  rspec-support (~> 3.10)
160
- rspec-support (3.10.3)
162
+ rspec-support (3.11.0)
161
163
  rubocop (1.22.3)
162
164
  parallel (~> 1.10)
163
165
  parser (>= 3.0.0.0)
@@ -167,8 +169,8 @@ GEM
167
169
  rubocop-ast (>= 1.12.0, < 2.0)
168
170
  ruby-progressbar (~> 1.7)
169
171
  unicode-display_width (>= 1.4.0, < 3.0)
170
- rubocop-ast (1.15.1)
171
- parser (>= 3.0.1.1)
172
+ rubocop-ast (1.16.0)
173
+ parser (>= 3.1.1.0)
172
174
  rubocop-rails (2.12.4)
173
175
  activesupport (>= 4.2.0)
174
176
  rack (>= 1.1)
@@ -178,7 +180,7 @@ GEM
178
180
  rubocop-rspec (2.5.0)
179
181
  rubocop (~> 1.19)
180
182
  ruby-progressbar (1.11.0)
181
- sprockets (4.0.2)
183
+ sprockets (4.0.3)
182
184
  concurrent-ruby (~> 1.0)
183
185
  rack (> 1, < 3)
184
186
  sprockets-rails (3.4.2)
@@ -193,14 +195,14 @@ GEM
193
195
  websocket-driver (0.7.5)
194
196
  websocket-extensions (>= 0.1.0)
195
197
  websocket-extensions (0.1.5)
196
- zeitwerk (2.5.3)
198
+ zeitwerk (2.5.4)
197
199
 
198
200
  PLATFORMS
199
201
  ruby
200
202
 
201
203
  DEPENDENCIES
202
204
  appraisal (~> 2.4.1)
203
- bundler (~> 1.17)
205
+ bundler (~> 2.1)
204
206
  generator_spec (~> 0.9.4)
205
207
  is_this_used!
206
208
  mysql2 (~> 0.5.3)
@@ -215,4 +217,4 @@ DEPENDENCIES
215
217
  rubocop-rspec (~> 2.5.0)
216
218
 
217
219
  BUNDLED WITH
218
- 1.17.2
220
+ 2.1.4
@@ -1,66 +1,66 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- is_this_used (0.1.2)
4
+ is_this_used (0.1.5)
5
5
  activerecord (>= 5.2)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- actioncable (6.1.4.4)
11
- actionpack (= 6.1.4.4)
12
- activesupport (= 6.1.4.4)
10
+ actioncable (6.1.4.6)
11
+ actionpack (= 6.1.4.6)
12
+ activesupport (= 6.1.4.6)
13
13
  nio4r (~> 2.0)
14
14
  websocket-driver (>= 0.6.1)
15
- actionmailbox (6.1.4.4)
16
- actionpack (= 6.1.4.4)
17
- activejob (= 6.1.4.4)
18
- activerecord (= 6.1.4.4)
19
- activestorage (= 6.1.4.4)
20
- activesupport (= 6.1.4.4)
15
+ actionmailbox (6.1.4.6)
16
+ actionpack (= 6.1.4.6)
17
+ activejob (= 6.1.4.6)
18
+ activerecord (= 6.1.4.6)
19
+ activestorage (= 6.1.4.6)
20
+ activesupport (= 6.1.4.6)
21
21
  mail (>= 2.7.1)
22
- actionmailer (6.1.4.4)
23
- actionpack (= 6.1.4.4)
24
- actionview (= 6.1.4.4)
25
- activejob (= 6.1.4.4)
26
- activesupport (= 6.1.4.4)
22
+ actionmailer (6.1.4.6)
23
+ actionpack (= 6.1.4.6)
24
+ actionview (= 6.1.4.6)
25
+ activejob (= 6.1.4.6)
26
+ activesupport (= 6.1.4.6)
27
27
  mail (~> 2.5, >= 2.5.4)
28
28
  rails-dom-testing (~> 2.0)
29
- actionpack (6.1.4.4)
30
- actionview (= 6.1.4.4)
31
- activesupport (= 6.1.4.4)
29
+ actionpack (6.1.4.6)
30
+ actionview (= 6.1.4.6)
31
+ activesupport (= 6.1.4.6)
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.4.4)
37
- actionpack (= 6.1.4.4)
38
- activerecord (= 6.1.4.4)
39
- activestorage (= 6.1.4.4)
40
- activesupport (= 6.1.4.4)
36
+ actiontext (6.1.4.6)
37
+ actionpack (= 6.1.4.6)
38
+ activerecord (= 6.1.4.6)
39
+ activestorage (= 6.1.4.6)
40
+ activesupport (= 6.1.4.6)
41
41
  nokogiri (>= 1.8.5)
42
- actionview (6.1.4.4)
43
- activesupport (= 6.1.4.4)
42
+ actionview (6.1.4.6)
43
+ activesupport (= 6.1.4.6)
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.4.4)
49
- activesupport (= 6.1.4.4)
48
+ activejob (6.1.4.6)
49
+ activesupport (= 6.1.4.6)
50
50
  globalid (>= 0.3.6)
51
- activemodel (6.1.4.4)
52
- activesupport (= 6.1.4.4)
53
- activerecord (6.1.4.4)
54
- activemodel (= 6.1.4.4)
55
- activesupport (= 6.1.4.4)
56
- activestorage (6.1.4.4)
57
- actionpack (= 6.1.4.4)
58
- activejob (= 6.1.4.4)
59
- activerecord (= 6.1.4.4)
60
- activesupport (= 6.1.4.4)
51
+ activemodel (6.1.4.6)
52
+ activesupport (= 6.1.4.6)
53
+ activerecord (6.1.4.6)
54
+ activemodel (= 6.1.4.6)
55
+ activesupport (= 6.1.4.6)
56
+ activestorage (6.1.4.6)
57
+ actionpack (= 6.1.4.6)
58
+ activejob (= 6.1.4.6)
59
+ activerecord (= 6.1.4.6)
60
+ activesupport (= 6.1.4.6)
61
61
  marcel (~> 1.0.0)
62
62
  mini_mime (>= 1.1.0)
63
- activesupport (6.1.4.4)
63
+ activesupport (6.1.4.6)
64
64
  concurrent-ruby (~> 1.0, >= 1.0.2)
65
65
  i18n (>= 1.6, < 2)
66
66
  minitest (>= 5.1)
@@ -83,9 +83,9 @@ GEM
83
83
  railties (>= 3.0.0)
84
84
  globalid (1.0.0)
85
85
  activesupport (>= 5.0)
86
- i18n (1.8.11)
86
+ i18n (1.10.0)
87
87
  concurrent-ruby (~> 1.0)
88
- loofah (2.13.0)
88
+ loofah (2.14.0)
89
89
  crass (~> 1.0.2)
90
90
  nokogiri (>= 1.5.9)
91
91
  mail (2.7.1)
@@ -93,13 +93,15 @@ GEM
93
93
  marcel (1.0.2)
94
94
  method_source (1.0.0)
95
95
  mini_mime (1.1.2)
96
+ mini_portile2 (2.8.0)
96
97
  minitest (5.15.0)
97
98
  mysql2 (0.5.3)
98
99
  nio4r (2.5.8)
99
- nokogiri (1.13.1-x86_64-darwin)
100
+ nokogiri (1.13.3)
101
+ mini_portile2 (~> 2.8.0)
100
102
  racc (~> 1.4)
101
103
  parallel (1.21.0)
102
- parser (3.1.0.0)
104
+ parser (3.1.1.0)
103
105
  ast (~> 2.4.1)
104
106
  pry (0.13.1)
105
107
  coderay (~> 1.1)
@@ -111,49 +113,49 @@ GEM
111
113
  rack (2.2.3)
112
114
  rack-test (1.1.0)
113
115
  rack (>= 1.0, < 3)
114
- rails (6.1.4.4)
115
- actioncable (= 6.1.4.4)
116
- actionmailbox (= 6.1.4.4)
117
- actionmailer (= 6.1.4.4)
118
- actionpack (= 6.1.4.4)
119
- actiontext (= 6.1.4.4)
120
- actionview (= 6.1.4.4)
121
- activejob (= 6.1.4.4)
122
- activemodel (= 6.1.4.4)
123
- activerecord (= 6.1.4.4)
124
- activestorage (= 6.1.4.4)
125
- activesupport (= 6.1.4.4)
116
+ rails (6.1.4.6)
117
+ actioncable (= 6.1.4.6)
118
+ actionmailbox (= 6.1.4.6)
119
+ actionmailer (= 6.1.4.6)
120
+ actionpack (= 6.1.4.6)
121
+ actiontext (= 6.1.4.6)
122
+ actionview (= 6.1.4.6)
123
+ activejob (= 6.1.4.6)
124
+ activemodel (= 6.1.4.6)
125
+ activerecord (= 6.1.4.6)
126
+ activestorage (= 6.1.4.6)
127
+ activesupport (= 6.1.4.6)
126
128
  bundler (>= 1.15.0)
127
- railties (= 6.1.4.4)
129
+ railties (= 6.1.4.6)
128
130
  sprockets-rails (>= 2.0.0)
129
131
  rails-dom-testing (2.0.3)
130
132
  activesupport (>= 4.2.0)
131
133
  nokogiri (>= 1.6)
132
134
  rails-html-sanitizer (1.4.2)
133
135
  loofah (~> 2.3)
134
- railties (6.1.4.4)
135
- actionpack (= 6.1.4.4)
136
- activesupport (= 6.1.4.4)
136
+ railties (6.1.4.6)
137
+ actionpack (= 6.1.4.6)
138
+ activesupport (= 6.1.4.6)
137
139
  method_source
138
140
  rake (>= 0.13)
139
141
  thor (~> 1.0)
140
142
  rainbow (3.1.1)
141
143
  rake (10.5.0)
142
- regexp_parser (2.2.0)
144
+ regexp_parser (2.2.1)
143
145
  rexml (3.2.5)
144
- rspec (3.10.0)
145
- rspec-core (~> 3.10.0)
146
- rspec-expectations (~> 3.10.0)
147
- rspec-mocks (~> 3.10.0)
148
- rspec-core (3.10.1)
149
- rspec-support (~> 3.10.0)
150
- rspec-expectations (3.10.2)
146
+ rspec (3.11.0)
147
+ rspec-core (~> 3.11.0)
148
+ rspec-expectations (~> 3.11.0)
149
+ rspec-mocks (~> 3.11.0)
150
+ rspec-core (3.11.0)
151
+ rspec-support (~> 3.11.0)
152
+ rspec-expectations (3.11.0)
151
153
  diff-lcs (>= 1.2.0, < 2.0)
152
- rspec-support (~> 3.10.0)
153
- rspec-mocks (3.10.2)
154
+ rspec-support (~> 3.11.0)
155
+ rspec-mocks (3.11.0)
154
156
  diff-lcs (>= 1.2.0, < 2.0)
155
- rspec-support (~> 3.10.0)
156
- rspec-rails (5.0.2)
157
+ rspec-support (~> 3.11.0)
158
+ rspec-rails (5.0.3)
157
159
  actionpack (>= 5.2)
158
160
  activesupport (>= 5.2)
159
161
  railties (>= 5.2)
@@ -161,7 +163,7 @@ GEM
161
163
  rspec-expectations (~> 3.10)
162
164
  rspec-mocks (~> 3.10)
163
165
  rspec-support (~> 3.10)
164
- rspec-support (3.10.3)
166
+ rspec-support (3.11.0)
165
167
  rubocop (1.22.3)
166
168
  parallel (~> 1.10)
167
169
  parser (>= 3.0.0.0)
@@ -171,8 +173,8 @@ GEM
171
173
  rubocop-ast (>= 1.12.0, < 2.0)
172
174
  ruby-progressbar (~> 1.7)
173
175
  unicode-display_width (>= 1.4.0, < 3.0)
174
- rubocop-ast (1.15.1)
175
- parser (>= 3.0.1.1)
176
+ rubocop-ast (1.16.0)
177
+ parser (>= 3.1.1.0)
176
178
  rubocop-rails (2.12.4)
177
179
  activesupport (>= 4.2.0)
178
180
  rack (>= 1.1)
@@ -182,7 +184,7 @@ GEM
182
184
  rubocop-rspec (2.5.0)
183
185
  rubocop (~> 1.19)
184
186
  ruby-progressbar (1.11.0)
185
- sprockets (4.0.2)
187
+ sprockets (4.0.3)
186
188
  concurrent-ruby (~> 1.0)
187
189
  rack (> 1, < 3)
188
190
  sprockets-rails (3.4.2)
@@ -196,14 +198,14 @@ GEM
196
198
  websocket-driver (0.7.5)
197
199
  websocket-extensions (>= 0.1.0)
198
200
  websocket-extensions (0.1.5)
199
- zeitwerk (2.5.3)
201
+ zeitwerk (2.5.4)
200
202
 
201
203
  PLATFORMS
202
204
  ruby
203
205
 
204
206
  DEPENDENCIES
205
207
  appraisal (~> 2.4.1)
206
- bundler (~> 1.17)
208
+ bundler (~> 2.1)
207
209
  generator_spec (~> 0.9.4)
208
210
  is_this_used!
209
211
  mysql2 (~> 0.5.3)
@@ -218,4 +220,4 @@ DEPENDENCIES
218
220
  rubocop-rspec (~> 2.5.0)
219
221
 
220
222
  BUNDLED WITH
221
- 1.17.2
223
+ 2.1.4
data/is_this_used.gemspec CHANGED
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.add_dependency 'activerecord', '>= 5.2'
28
28
 
29
29
  spec.add_development_dependency 'appraisal', '~> 2.4.1'
30
- spec.add_development_dependency 'bundler', '~> 1.17'
30
+ spec.add_development_dependency 'bundler', '~> 2.1'
31
31
  spec.add_development_dependency 'generator_spec', '~> 0.9.4'
32
32
  spec.add_development_dependency 'mysql2', '~> 0.5.3'
33
33
  spec.add_development_dependency 'pry-byebug', '~> 3.9'
@@ -12,6 +12,7 @@ module IsThisUsed
12
12
  def create_migration_file
13
13
  create_potential_crufts
14
14
  create_potential_cruft_stacks
15
+ create_potential_cruft_arguments
15
16
  end
16
17
 
17
18
  def self.next_migration_number(dirname)
@@ -28,6 +29,10 @@ module IsThisUsed
28
29
  create_table('potential_cruft_stacks')
29
30
  end
30
31
 
32
+ def create_potential_cruft_arguments
33
+ create_table('potential_cruft_arguments')
34
+ end
35
+
31
36
  def create_table(table)
32
37
  migration_template(
33
38
  "create_#{table}.rb.erb",
@@ -0,0 +1,12 @@
1
+ # This migration creates the `potential_cruft_arguments` table
2
+ class CreatePotentialCruftArguments < ActiveRecord::Migration<%= migration_version %>
3
+ def change
4
+ create_table :potential_cruft_arguments do |t|
5
+ t.references :potential_cruft, null: false
6
+ t.string :arguments_hash, null: false, index: true
7
+ t.json :arguments, null: false
8
+ t.integer :occurrences, null: false, index: true, default: 0
9
+ t.timestamps
10
+ end
11
+ end
12
+ end
@@ -49,6 +49,25 @@ module IsThisUsed
49
49
  }
50
50
  end
51
51
  end
52
+
53
+ def self.record_arguments(potential_cruft, arguments)
54
+ arguments_hash = Digest::MD5.hexdigest(arguments.to_json)
55
+
56
+ potential_cruft_argument =
57
+ PotentialCruftArgument.find_by(
58
+ potential_cruft: potential_cruft, arguments_hash: arguments_hash
59
+ )
60
+ potential_cruft_argument ||=
61
+ PotentialCruftArgument.new(
62
+ potential_cruft: potential_cruft,
63
+ arguments_hash: arguments_hash,
64
+ arguments: arguments
65
+ )
66
+
67
+ potential_cruft_argument.occurrences += 1
68
+
69
+ potential_cruft_argument.save
70
+ end
52
71
  end
53
72
 
54
73
  def self.included(base)
@@ -56,7 +75,7 @@ module IsThisUsed
56
75
  end
57
76
 
58
77
  module ClassMethods
59
- def is_this_used?(method_name, method_type: nil)
78
+ def is_this_used?(method_name, method_type: nil, track_arguments: false)
60
79
  IsThisUsed::Util::LogSuppressor.suppress_logging do
61
80
  method_type ||= determine_method_type(method_name)
62
81
  target_method = target_method(method_name, method_type)
@@ -71,6 +90,11 @@ module IsThisUsed
71
90
  target_method.owner.define_method target_method.name do |*args|
72
91
  IsThisUsed::Util::LogSuppressor.suppress_logging do
73
92
  CruftTracker::Recorder.record_invocation(potential_cruft)
93
+ if track_arguments
94
+ arguments = track_arguments.instance_of?(Proc) ? track_arguments.call(args) : args
95
+
96
+ CruftTracker::Recorder.record_arguments(potential_cruft, arguments)
97
+ end
74
98
  end
75
99
  if method_type == INSTANCE_METHOD
76
100
  target_method.bind(self).call(*args)
@@ -4,5 +4,7 @@ module IsThisUsed
4
4
  class PotentialCruft < ActiveRecord::Base
5
5
  has_many :potential_cruft_stacks,
6
6
  dependent: :destroy, class_name: 'IsThisUsed::PotentialCruftStack'
7
+ has_many :potential_cruft_arguments,
8
+ dependent: :destroy, class_name: 'IsThisUsed::PotentialCruftArgument'
7
9
  end
8
10
  end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module IsThisUsed
4
+ class PotentialCruftArgument < ActiveRecord::Base
5
+ belongs_to :potential_cruft, class_name: 'IsThisUsed::PotentialCruft'
6
+ end
7
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module IsThisUsed
4
- VERSION = '0.1.5'
4
+ VERSION = '0.1.7'
5
5
  end
data/lib/is_this_used.rb CHANGED
@@ -2,6 +2,7 @@ require 'is_this_used/version'
2
2
  require 'is_this_used/cruft_tracker'
3
3
  require 'is_this_used/models/potential_cruft'
4
4
  require 'is_this_used/models/potential_cruft_stack'
5
+ require 'is_this_used/models/potential_cruft_argument'
5
6
  require 'is_this_used/util/log_suppressor'
6
7
 
7
8
  module IsThisUsed