leftovers 0.12.0 → 0.12.2

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: 7094671fa508c2a3af0cfdc0b64dfc41346c88a16a9203d901628fe40af66a86
4
- data.tar.gz: 35ae640a73003aaf96a362ca08e3c92b51b46e93184b1c3641a5427a1dce31d4
3
+ metadata.gz: 377b77ca4cf2a1322042a4ea36fc01c3ac28f40be3ddcc52a8f67ce627325bed
4
+ data.tar.gz: 119961a95dacb598e8c8722b2ad2f64eae37eaba1786472322f225e5853c8a95
5
5
  SHA512:
6
- metadata.gz: 4da3eb08e61869a3d5a82c8a0ecdfb7217872299cee46d1ec7ac0234c892c10a0afa5ca3786e23939d893302cf83e2d91e4cb33939c02e4f6b856c51aef22cdc
7
- data.tar.gz: 29f81218dfad69a62ea35032cc4149eff849a363067b67aa9175a568674e473e6a28f2b0eeb5d6de36246917efb911a527163aab45e7382ff0d915a843777b99
6
+ metadata.gz: 06b9c3e26a4c1b21bbb12dda75c0581e5a4c3a0a3415747325838cdd18082beace0c9a968d62edb9d1ea8e503c16ae227218711bed09bfba04b7e200f08bfa99
7
+ data.tar.gz: d3e99478863220169cacf9a4523d80c6123266a9c1cc993a36e46493f53df694a2011de9be1a128ccd2b927e9da27f8923b06b662ab728bcb4ff787f87d71cad
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # v0.12.2
2
+ - fix for structures like activerecord `attribute a_variable_we_cant_get_a_string_out_of` leaving empty definition sets. thanks @gentlemich
3
+
4
+ # v0.12.1
5
+
6
+ - handle anonymous block arguments e.g. `def method(&); other_method(&); end`. thanks @sclarson and @orien and @juanlujoanne
7
+
1
8
  # v0.12.0
2
9
  - improve error handling when a file can't be processed
3
10
  - fail rather than warn when encountering a syntax error in a file being processed
@@ -110,7 +110,7 @@ module Leftovers
110
110
  # grab e.g. :to_s in each(&:to_s)
111
111
  def on_block_pass(node)
112
112
  super
113
- return unless node.first.sym?
113
+ return unless node.first&.sym?
114
114
 
115
115
  @collector.calls << node.first.to_sym
116
116
  end
@@ -13,15 +13,18 @@ module Leftovers
13
13
  freeze
14
14
  end
15
15
 
16
- def process(str, current_node, matched_node, acc)
16
+ def process(str, current_node, matched_node, acc) # rubocop:disable Metrics/MethodLength
17
17
  set = DefinitionNodeSet.new
18
18
 
19
19
  @processors.each do |processor|
20
20
  processor.process(str, current_node, matched_node, set)
21
21
  end
22
22
 
23
- if set.definitions.length == 1
23
+ case set.definitions.length
24
+ when 1
24
25
  acc.add_definition_node set.definitions.first
26
+ when 0
27
+ nil
25
28
  else
26
29
  acc.add_definition_set set
27
30
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Leftovers
4
- VERSION = '0.12.0'
4
+ VERSION = '0.12.2'
5
5
  end
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.12.0
4
+ version: 0.12.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dana Sherson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-02-03 00:00:00.000000000 Z
11
+ date: 2023-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -320,7 +320,6 @@ files:
320
320
  - docs/Custom-Precompilers.md
321
321
  - exe/leftovers
322
322
  - leftovers.gemspec
323
- - lib/.DS_Store
324
323
  - lib/config/actioncable.yml
325
324
  - lib/config/actionmailbox.yml
326
325
  - lib/config/actionmailer.yml
@@ -585,7 +584,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
585
584
  - !ruby/object:Gem::Version
586
585
  version: '0'
587
586
  requirements: []
588
- rubygems_version: 3.4.1
587
+ rubygems_version: 3.3.26
589
588
  signing_key:
590
589
  specification_version: 4
591
590
  summary: Find unused methods and classes/modules
data/lib/.DS_Store DELETED
Binary file