rubocop-performance 1.11.2 → 1.11.3

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: a26b6360b5df05f3a7a8dfe957e5ecad0922105024a2e49dae8c39a566f10d88
4
- data.tar.gz: 7591fd4d805f4d6dad68b83c8fbffff8e563bfa27bd58030efa48f332c392b2f
3
+ metadata.gz: 341ace76835db65803b9c7ef7d54f67dbb053c86c9e31b0a80b80f1514e96c29
4
+ data.tar.gz: 031bda91d5c5d1e66716f218472621c115cf247e364c25596c6fd9f470261aca
5
5
  SHA512:
6
- metadata.gz: c8fb234710212fd000d0d695da71a1b1a36687550cf3738ce987264dad85f015d2f1f1da9b0f511c2147532ff7d6d444b35efb472b399646171bbb35e0ff79ad
7
- data.tar.gz: 8447f79bb69e546ff684ece819b626fbfc68db8f7154b1b839c22167c87dbbf58821f1abe626a2b6d486ccfc81601e0844e416a312703ce0be7bc5552f1160ab
6
+ metadata.gz: 3c324e059ffa5f0f98789d6336a41ab0135bdf1dcc8e3b45df83ac8bf75e7bae53fe1e40fb7ae0039d83567bd226709b47cd9cc09184819d16ce8c558d56d85e
7
+ data.tar.gz: a7c1698db1e6c9c16150f46df944c3f275c38c0f39bca1bc5f0961bdde6a1d14aa9acb9b19823b9f62f352a11120596559fd9cdef6e3343fd8e01bf71b816f96
@@ -23,6 +23,7 @@ module RuboCop
23
23
  # # good
24
24
  # ary.filter_map(&:foo)
25
25
  # ary.map(&:foo).compact!
26
+ # ary.compact.map(&:foo)
26
27
  #
27
28
  class MapCompact < Base
28
29
  include RangeHelp
@@ -66,8 +67,8 @@ module RuboCop
66
67
  chained_method = compact_node.parent
67
68
  compact_method_range = compact_node.loc.selector
68
69
 
69
- if compact_node.multiline? &&
70
- chained_method && !invoke_method_after_map_compact_on_same_line?(compact_node, chained_method)
70
+ if compact_node.multiline? && chained_method&.loc.respond_to?(:selector) &&
71
+ !invoke_method_after_map_compact_on_same_line?(compact_node, chained_method)
71
72
  range_by_whole_lines(compact_method_range, include_final_newline: true)
72
73
  else
73
74
  compact_method_range
@@ -4,7 +4,7 @@ module RuboCop
4
4
  module Performance
5
5
  # This module holds the RuboCop Performance version information.
6
6
  module Version
7
- STRING = '1.11.2'
7
+ STRING = '1.11.3'
8
8
 
9
9
  def self.document_version
10
10
  STRING.match('\d+\.\d+').to_s
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-performance
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.11.2
4
+ version: 1.11.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bozhidar Batsov
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2021-05-05 00:00:00.000000000 Z
13
+ date: 2021-05-06 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rubocop