rubocop-performance 1.11.1 → 1.11.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: 0fddb9566bda412ba7ab8f26966cca63207064468d2c2da5796a81cd84da1c69
4
- data.tar.gz: f49da21e50225a0f35fe6959ad3a37a2c26ff73e64df03f5a94025811d380b02
3
+ metadata.gz: a26b6360b5df05f3a7a8dfe957e5ecad0922105024a2e49dae8c39a566f10d88
4
+ data.tar.gz: 7591fd4d805f4d6dad68b83c8fbffff8e563bfa27bd58030efa48f332c392b2f
5
5
  SHA512:
6
- metadata.gz: a70fd0b8cf0778f410098e889dc52c828202f0d197a10a9fb4edff36991204cad23cfba361039b9b80952c7f5f814679d7277e2f9c533fe29fd55e708c4d1bb9
7
- data.tar.gz: a2ce3b7915ed3c3bc208ef020f031646e3350d46397759eb0c5a772e826dc30ad8d72d75c009b385358ef015be4b6af4c7cd1b6f337b6f34c583432bef608a65
6
+ metadata.gz: c8fb234710212fd000d0d695da71a1b1a36687550cf3738ce987264dad85f015d2f1f1da9b0f511c2147532ff7d6d444b35efb472b399646171bbb35e0ff79ad
7
+ data.tar.gz: 8447f79bb69e546ff684ece819b626fbfc68db8f7154b1b839c22167c87dbbf58821f1abe626a2b6d486ccfc81601e0844e416a312703ce0be7bc5552f1160ab
@@ -63,14 +63,20 @@ module RuboCop
63
63
  private
64
64
 
65
65
  def compact_method_range(compact_node)
66
+ chained_method = compact_node.parent
66
67
  compact_method_range = compact_node.loc.selector
67
68
 
68
- if compact_node.multiline?
69
+ if compact_node.multiline? &&
70
+ chained_method && !invoke_method_after_map_compact_on_same_line?(compact_node, chained_method)
69
71
  range_by_whole_lines(compact_method_range, include_final_newline: true)
70
72
  else
71
73
  compact_method_range
72
74
  end
73
75
  end
76
+
77
+ def invoke_method_after_map_compact_on_same_line?(compact_node, chained_method)
78
+ compact_node.loc.selector.line == chained_method.loc.selector.line
79
+ end
74
80
  end
75
81
  end
76
82
  end
@@ -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.1'
7
+ STRING = '1.11.2'
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.1
4
+ version: 1.11.2
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-01 00:00:00.000000000 Z
13
+ date: 2021-05-05 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rubocop