leftovers 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/exe/leftovers +1 -1
- data/leftovers.gemspec +1 -1
- data/lib/config/rails.yml +53 -9
- data/lib/config/sidekiq.yml +13 -0
- data/lib/leftovers.rb +2 -2
- data/lib/leftovers/cli.rb +1 -1
- data/lib/leftovers/file_collector.rb +4 -2
- data/lib/leftovers/parser.rb +1 -1
- data/lib/leftovers/rake_task.rb +1 -1
- data/lib/leftovers/transform_rule.rb +1 -1
- data/lib/leftovers/version.rb +1 -1
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 52698685d049f76cfbe3034d85b9de65aec3c06b44434119a6581b399778a648
|
4
|
+
data.tar.gz: daa5a40d80c7a180eb81a4dd59bc841788da04db541cfc93f2ae02577b1fd251
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98ab99b3d471cdf3d42cf2c2e4940fc985313d68ce6a1ffe7b2f2909b0bcd95c1019a5fccdb306177a8283c0837baf068942a9f390fc38ccdeed9f5ecf8019f7
|
7
|
+
data.tar.gz: 1dcea67041a8afec49b80ff6b168d18fa28fcba7c6bbd546d0f004f76152f12116d9538cc0920e32721228a8a41233ad8788678d77fd55279f79b000e744ac55
|
data/CHANGELOG.md
CHANGED
data/exe/leftovers
CHANGED
data/leftovers.gemspec
CHANGED
@@ -33,7 +33,7 @@ Gem::Specification.new do |spec|
|
|
33
33
|
spec.add_development_dependency 'bundler', '~> 2.0'
|
34
34
|
spec.add_development_dependency 'haml'
|
35
35
|
spec.add_development_dependency 'pry', '~> 0.1'
|
36
|
-
spec.add_development_dependency 'rake', '
|
36
|
+
spec.add_development_dependency 'rake', '>= 13'
|
37
37
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
38
38
|
spec.add_development_dependency 'rubocop', '~> 0.74'
|
39
39
|
spec.add_development_dependency 'rubocop-performance', '~> 1.4'
|
data/lib/config/rails.yml
CHANGED
@@ -20,6 +20,7 @@ rules:
|
|
20
20
|
- ssl_configured? # ApplicationController
|
21
21
|
- APP_PATH
|
22
22
|
- APP_ROOT
|
23
|
+
- default_url_options # called by url_for
|
23
24
|
- skip: true
|
24
25
|
names:
|
25
26
|
has_suffix: Helper
|
@@ -190,38 +191,81 @@ rules:
|
|
190
191
|
- has_many
|
191
192
|
- has_and_belongs_to_many
|
192
193
|
calls:
|
193
|
-
argument: 1
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
194
|
+
- argument: 1
|
195
|
+
camelize: true
|
196
|
+
singularize: true
|
197
|
+
unless:
|
198
|
+
has_argument: class_name
|
199
|
+
defines:
|
200
|
+
- argument: 1
|
201
|
+
linked_transforms:
|
202
|
+
- original
|
203
|
+
- add_suffix: '='
|
204
|
+
- singularize: true
|
205
|
+
add_suffix: _ids
|
206
|
+
- singularize: true
|
207
|
+
add_suffix: _ids=
|
198
208
|
- name:
|
199
209
|
- has_many
|
200
210
|
- has_one
|
201
211
|
- has_and_belongs_to_many
|
202
212
|
calls:
|
203
|
-
argument:
|
213
|
+
argument:
|
214
|
+
- as
|
215
|
+
- name:
|
216
|
+
- has_one
|
217
|
+
- has_many
|
218
|
+
calls:
|
219
|
+
- argument:
|
220
|
+
- source_type
|
221
|
+
- source
|
222
|
+
- through
|
204
223
|
- name:
|
205
224
|
- has_one
|
206
|
-
- has_many
|
207
225
|
- belongs_to
|
208
|
-
- has_and_belongs_to_many
|
209
226
|
defines:
|
210
227
|
- argument: 1
|
211
228
|
linked_transforms:
|
212
229
|
- original
|
213
230
|
- add_suffix: '='
|
231
|
+
- add_prefix: build_
|
232
|
+
- add_prefix: create_
|
233
|
+
- add_prefix: create_
|
234
|
+
add_suffix: '!'
|
235
|
+
- add_prefix: reload
|
236
|
+
- name: belongs_to
|
237
|
+
calls:
|
238
|
+
argument: 1
|
239
|
+
unless:
|
240
|
+
has_argument:
|
241
|
+
keyword: optional
|
242
|
+
value: true
|
243
|
+
|
244
|
+
- name:
|
245
|
+
- has_one
|
246
|
+
- has_many
|
247
|
+
- belongs_to
|
248
|
+
- has_and_belongs_to_many
|
214
249
|
calls:
|
215
250
|
- argument:
|
216
|
-
- through
|
217
251
|
- class_name
|
218
252
|
- inverse_of
|
253
|
+
- argument: touch
|
254
|
+
add_suffix: '='
|
219
255
|
- argument: 1
|
220
256
|
if:
|
221
257
|
has_argument: dependent
|
222
258
|
- argument: 1
|
223
259
|
if:
|
224
260
|
has_argument: inverse_of
|
261
|
+
- argument: 1
|
262
|
+
if:
|
263
|
+
has_argument: touch
|
264
|
+
- argument: 1
|
265
|
+
if:
|
266
|
+
has_argument:
|
267
|
+
keyword: validate
|
268
|
+
value: true
|
225
269
|
- name:
|
226
270
|
- rescue_from
|
227
271
|
calls:
|
data/lib/leftovers.rb
CHANGED
data/lib/leftovers/cli.rb
CHANGED
@@ -35,8 +35,8 @@ module Leftovers
|
|
35
35
|
ast, comments = Leftovers::Parser.parse_with_comments(@ruby, @file)
|
36
36
|
process_comments(comments)
|
37
37
|
process(ast)
|
38
|
-
rescue Parser::SyntaxError => e
|
39
|
-
Leftovers.warn "
|
38
|
+
rescue ::Parser::SyntaxError => e
|
39
|
+
Leftovers.warn "\e[31m#{filename}:#{e.diagnostic.location.line}:#{e.diagnostic.location.column} SyntaxError: #{e.message}\e[0m" # rubocop:disable Layout/LineLength
|
40
40
|
end
|
41
41
|
|
42
42
|
METHOD_NAME_RE = /[[:alpha:]_][[:alnum:]_]*\b[\?!=]?/.freeze
|
@@ -212,6 +212,8 @@ module Leftovers
|
|
212
212
|
node.test = test?(node.loc)
|
213
213
|
definitions.concat(rule.definitions(node))
|
214
214
|
end
|
215
|
+
rescue StandardError => e
|
216
|
+
raise e.class, "#{e.message}\nwhen processing #{node} at #{filename}:#{node.loc.line}:#{node.loc.column}", e.backtrace # rubocop:disable Layout/LineLength
|
215
217
|
end
|
216
218
|
end
|
217
219
|
end
|
data/lib/leftovers/parser.rb
CHANGED
data/lib/leftovers/rake_task.rb
CHANGED
data/lib/leftovers/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: leftovers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dana Sherson
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-04-
|
11
|
+
date: 2020-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -70,16 +70,16 @@ dependencies:
|
|
70
70
|
name: rake
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '13'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '13'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rspec
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -227,6 +227,7 @@ files:
|
|
227
227
|
- lib/config/rspec.yml
|
228
228
|
- lib/config/ruby.yml
|
229
229
|
- lib/config/selenium.yml
|
230
|
+
- lib/config/sidekiq.yml
|
230
231
|
- lib/config/simplecov.yml
|
231
232
|
- lib/config/will_paginate.yml
|
232
233
|
- lib/leftovers.rb
|