rubocop-rails 2.34.1 → 2.34.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0d751c9891e698f0916a8e58e8cb6b30c4c267b1c069e7b57e01160bb121b49c
4
- data.tar.gz: 5ae0f4177bd644cc89d683e1a3176eb6434fe69195c043fe5dc057be52ddff0d
3
+ metadata.gz: 0ba3287dd87a87e513f027365ed1e2f726a812b513f92c70e63e1e1792d2ce45
4
+ data.tar.gz: 375105175c67eebfbf7f82469ca3a8b8540779199e2d9542990fc219c6c57412
5
5
  SHA512:
6
- metadata.gz: 44b7345a990e2ccf25ed3c4e4f1de3ae8cfe46bf0ea6841c9d5f43a24e04f881729d9c9ce4cce15dc71430dcb30a6684f16c05a299a5b040b37f1ffd22f9ea4e
7
- data.tar.gz: 3cf9f62438b49c1c3c2c075bebb3f7a21c61ebc53236be6b1498c1d07cc63e3c021c6c266e19b6080345023a1f6f985146b4119358908704573c49d2a9763111
6
+ metadata.gz: bd06a6c9f0cc892c20473c640ae9bc27d2fd02b2e7ccb1c763c6d4ab0008cc9b3699f9ef8d32aadecc4f5d0eb89066a14495852e3b7fabedc4e0702dd3c2b132
7
+ data.tar.gz: 2353dca7cb758e658688f8fed9343a20f16355d5f3a3170d4e3e1472adb03b4466404067966124c55101e586b5e1009efc96ef4b95d0982ab3c9ed0f7fac2d3e
@@ -68,6 +68,7 @@ module RuboCop
68
68
  extend AutoCorrector
69
69
 
70
70
  MSG = 'Use `%<prefer>s` instead of `%<current>s`.'
71
+ INDEX_ACCESS_METHODS = %i[[] []=].freeze
71
72
 
72
73
  def_node_matcher :redundant_receiver_and_other, <<~PATTERN
73
74
  {
@@ -140,7 +141,7 @@ module RuboCop
140
141
  end
141
142
 
142
143
  def ignore_chain_node?(node)
143
- node.method?('[]') || node.method?('[]=') || node.arithmetic_operation? || node.comparison_method?
144
+ index_access_method?(node) || node.assignment? || node.arithmetic_operation? || node.comparison_method?
144
145
  end
145
146
 
146
147
  def message(node, replacement)
@@ -190,6 +191,10 @@ module RuboCop
190
191
  replaced += "(#{chain.arguments.map(&:source).join(', ')})" if chain.arguments?
191
192
  left_sibling ? "(#{replaced})" : replaced
192
193
  end
194
+
195
+ def index_access_method?(node)
196
+ INDEX_ACCESS_METHODS.include?(node.method_name)
197
+ end
193
198
  end
194
199
  end
195
200
  end
@@ -4,7 +4,7 @@ module RuboCop
4
4
  module Rails
5
5
  # This module holds the RuboCop Rails version information.
6
6
  module Version
7
- STRING = '2.34.1'
7
+ STRING = '2.34.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-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.34.1
4
+ version: 2.34.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bozhidar Batsov