rubocop-performance 1.11.0 → 1.11.1

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: f7398f6e66937ee06d17e56c52ebe2858d26fcaf0a91d00d0c90caccbd1722b6
4
- data.tar.gz: ab180bb4e81913bdabd470b04264e91b9687edde72f6f6d126e9918a11f361ca
3
+ metadata.gz: 0fddb9566bda412ba7ab8f26966cca63207064468d2c2da5796a81cd84da1c69
4
+ data.tar.gz: f49da21e50225a0f35fe6959ad3a37a2c26ff73e64df03f5a94025811d380b02
5
5
  SHA512:
6
- metadata.gz: 5ae6caa06f44418aab93a55378a7727e48dde52eaf49c0e70e6e84ed01c62210048dc9c5cbe826bffbc0b7b85a779084517828350f50f76f88759f291385bdef
7
- data.tar.gz: e9a63b027c140d453648376871ab24f5192004971239aa8b06ad5f73b3da917a7b70923d8ac161fc3a10d352a167ac55577136c05f8dfd12a78e4c0c08acfbc3
6
+ metadata.gz: a70fd0b8cf0778f410098e889dc52c828202f0d197a10a9fb4edff36991204cad23cfba361039b9b80952c7f5f814679d7277e2f9c533fe29fd55e708c4d1bb9
7
+ data.tar.gz: a2ce3b7915ed3c3bc208ef020f031646e3350d46397759eb0c5a772e826dc30ad8d72d75c009b385358ef015be4b6af4c7cd1b6f337b6f34c583432bef608a65
@@ -56,7 +56,19 @@ module RuboCop
56
56
  add_offense(range) do |corrector|
57
57
  corrector.replace(map_node.loc.selector, 'filter_map')
58
58
  corrector.remove(compact_loc.dot)
59
- corrector.remove(compact_loc.selector)
59
+ corrector.remove(compact_method_range(node))
60
+ end
61
+ end
62
+
63
+ private
64
+
65
+ def compact_method_range(compact_node)
66
+ compact_method_range = compact_node.loc.selector
67
+
68
+ if compact_node.multiline?
69
+ range_by_whole_lines(compact_method_range, include_final_newline: true)
70
+ else
71
+ compact_method_range
60
72
  end
61
73
  end
62
74
  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.0'
7
+ STRING = '1.11.1'
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.0
4
+ version: 1.11.1
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-04-21 00:00:00.000000000 Z
13
+ date: 2021-05-01 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rubocop