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

rubocop: fix offences of the Lint/UnderscorePrefixedVariableName cop

This commit is contained in:
Kyrylo Silin 2019-03-23 12:18:50 +02:00
parent b895f14a5a
commit 0cbaf6d10d
4 changed files with 9 additions and 13 deletions

View file

@ -18,10 +18,6 @@ Lint/ShadowedException:
Exclude: Exclude:
- 'lib/pry/method.rb' - 'lib/pry/method.rb'
# Offense count: 32
Lint/UnderscorePrefixedVariableName:
Enabled: false
# Offense count: 1 # Offense count: 1
# Configuration parameters: CheckForMethodsWithNoSideEffects. # Configuration parameters: CheckForMethodsWithNoSideEffects.
Lint/Void: Lint/Void:

View file

@ -143,10 +143,10 @@ class Pry
def check_for_juxtaposed_replay(replay_sequence) def check_for_juxtaposed_replay(replay_sequence)
if replay_sequence =~ /\Ahist(?:ory)?\b/ if replay_sequence =~ /\Ahist(?:ory)?\b/
# Create *fresh* instance of Options for parsing of "hist" command. # Create *fresh* instance of Options for parsing of "hist" command.
_slop = slop slop_instance = slop
_slop.parse replay_sequence.split(' ')[1..-1] slop_instance.parse(replay_sequence.split(' ')[1..-1])
if _slop.present?(:r) if slop_instance.present?(:r)
replay_sequence = replay_sequence.split("\n").join('; ') replay_sequence = replay_sequence.split("\n").join('; ')
index = opts[:r] index = opts[:r]
index = index.min if index.min == index.max || index.max.nil? index = index.min if index.min == index.max || index.max.nil?

View file

@ -34,8 +34,8 @@ class Pry
# @param [Pry] pry_instance the Pry instance to make non-interactive. # @param [Pry] pry_instance the Pry instance to make non-interactive.
def non_interactive_mode(pry_instance, content) def non_interactive_mode(pry_instance, content)
pry_instance.print = proc {} pry_instance.print = proc {}
pry_instance.exception_handler = proc do |o, _e, _p_| pry_instance.exception_handler = proc do |o, _e, p|
_p_.run_command "cat --ex" p.run_command "cat --ex"
o.puts "...exception encountered, going interactive!" o.puts "...exception encountered, going interactive!"
interactive_mode(pry_instance) interactive_mode(pry_instance)
end end

View file

@ -437,10 +437,10 @@ describe Pry do
describe "Pry.binding_for" do describe "Pry.binding_for" do
it 'should return TOPLEVEL_BINDING if parameter self is main' do it 'should return TOPLEVEL_BINDING if parameter self is main' do
_main_ = -> { TOPLEVEL_BINDING.eval('self') } main = -> { TOPLEVEL_BINDING.eval('self') }
expect(Pry.binding_for(_main_.call).is_a?(Binding)).to eq true expect(Pry.binding_for(main.call).is_a?(Binding)).to eq true
expect(Pry.binding_for(_main_.call)).to eq TOPLEVEL_BINDING expect(Pry.binding_for(main.call)).to eq TOPLEVEL_BINDING
expect(Pry.binding_for(_main_.call)).to eq Pry.binding_for(_main_.call) expect(Pry.binding_for(main.call)).to eq Pry.binding_for(main.call)
end end
end end
end end