1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

rubocop: fix the Style/MethodCallWithoutArgsParentheses cop

This commit is contained in:
Kyrylo Silin 2019-03-02 11:27:26 +02:00
parent fa50e4a192
commit 343832f4c7
2 changed files with 6 additions and 13 deletions

View file

@ -274,13 +274,6 @@ Style/IfInsideElse:
- 'lib/pry/slop/commands.rb'
- 'lib/pry/slop/option.rb'
# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: IgnoredMethods.
Style/MethodCallWithoutArgsParentheses:
Exclude:
- 'lib/pry/helpers/command_helpers.rb'
# Offense count: 6
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.

View file

@ -137,14 +137,14 @@ class Pry
Range.new(a, b)
end
def set_file_and_dir_locals(file_name, _pry_ = _pry_(), target = target())
return if !target || !file_name
def set_file_and_dir_locals(file_name, pry = _pry_, ctx = target)
return if !ctx || !file_name
_pry_.last_file = File.expand_path(file_name)
_pry_.inject_local("_file_", _pry_.last_file, target)
pry.last_file = File.expand_path(file_name)
pry.inject_local("_file_", pry.last_file, ctx)
_pry_.last_dir = File.dirname(_pry_.last_file)
_pry_.inject_local("_dir_", _pry_.last_dir, target)
pry.last_dir = File.dirname(pry.last_file)
pry.inject_local("_dir_", pry.last_dir, ctx)
end
end
end