mirror of
https://github.com/lostisland/faraday.git
synced 2025-10-04 00:02:03 -04:00
Lint: Style/PerlBackrefs
This commit is contained in:
parent
f0bc54fecb
commit
f1f36be663
@ -83,9 +83,3 @@ Style/DocumentDynamicEvalDefinition:
|
||||
- 'lib/faraday/connection.rb'
|
||||
- 'lib/faraday/options.rb'
|
||||
|
||||
# Offense count: 2
|
||||
# Cop supports --auto-correct.
|
||||
Style/PerlBackrefs:
|
||||
Exclude:
|
||||
- 'lib/faraday/encoders/nested_params_encoder.rb'
|
||||
- 'spec/support/fake_safe_buffer.rb'
|
||||
|
@ -102,7 +102,7 @@ module Faraday
|
||||
subkeys = key.scan(SUBKEYS_REGEX)
|
||||
subkeys.each_with_index do |subkey, i|
|
||||
is_array = subkey =~ /[\[\]]+\Z/
|
||||
subkey = $` if is_array
|
||||
subkey = Regexp.last_match.pre_match if is_array
|
||||
last_subkey = i == subkeys.length - 1
|
||||
|
||||
context = prepare_context(context, subkey, is_array, last_subkey)
|
||||
|
@ -8,7 +8,7 @@ FakeSafeBuffer = Struct.new(:string) do
|
||||
|
||||
def gsub(regex)
|
||||
string.gsub(regex) do
|
||||
match, = $&, '' =~ /a/
|
||||
match, = Regexp.last_match(0), '' =~ /a/
|
||||
yield(match)
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user