[ruby/irb] Centralize rstrip calls
(https://github.com/ruby/irb/pull/918) https://github.com/ruby/irb/commit/97898b6251
This commit is contained in:
parent
d60b2caa95
commit
d75dc39880
@ -8,7 +8,7 @@ module IRB
|
||||
module Command
|
||||
class Backtrace < DebugCommand
|
||||
def execute(arg)
|
||||
execute_debug_command(pre_cmds: "backtrace #{arg}".rstrip)
|
||||
execute_debug_command(pre_cmds: "backtrace #{arg}")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -8,7 +8,7 @@ module IRB
|
||||
module Command
|
||||
class Break < DebugCommand
|
||||
def execute(arg)
|
||||
execute_debug_command(pre_cmds: "break #{arg}".rstrip)
|
||||
execute_debug_command(pre_cmds: "break #{arg}")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -8,7 +8,7 @@ module IRB
|
||||
module Command
|
||||
class Catch < DebugCommand
|
||||
def execute(arg)
|
||||
execute_debug_command(pre_cmds: "catch #{arg}".rstrip)
|
||||
execute_debug_command(pre_cmds: "catch #{arg}")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -8,7 +8,7 @@ module IRB
|
||||
module Command
|
||||
class Continue < DebugCommand
|
||||
def execute(arg)
|
||||
execute_debug_command(do_cmds: "continue #{arg}".rstrip)
|
||||
execute_debug_command(do_cmds: "continue #{arg}")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -18,6 +18,9 @@ module IRB
|
||||
end
|
||||
|
||||
def execute_debug_command(pre_cmds: nil, do_cmds: nil)
|
||||
pre_cmds = pre_cmds&.rstrip
|
||||
do_cmds = do_cmds&.rstrip
|
||||
|
||||
if irb_context.with_debugger
|
||||
# If IRB is already running with a debug session, throw the command and IRB.debug_readline will pass it to the debugger.
|
||||
if cmd = pre_cmds || do_cmds
|
||||
|
@ -8,7 +8,7 @@ module IRB
|
||||
module Command
|
||||
class Delete < DebugCommand
|
||||
def execute(arg)
|
||||
execute_debug_command(pre_cmds: "delete #{arg}".rstrip)
|
||||
execute_debug_command(pre_cmds: "delete #{arg}")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -8,7 +8,7 @@ module IRB
|
||||
module Command
|
||||
class Finish < DebugCommand
|
||||
def execute(arg)
|
||||
execute_debug_command(do_cmds: "finish #{arg}".rstrip)
|
||||
execute_debug_command(do_cmds: "finish #{arg}")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -8,7 +8,7 @@ module IRB
|
||||
module Command
|
||||
class Info < DebugCommand
|
||||
def execute(arg)
|
||||
execute_debug_command(pre_cmds: "info #{arg}".rstrip)
|
||||
execute_debug_command(pre_cmds: "info #{arg}")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -8,7 +8,7 @@ module IRB
|
||||
module Command
|
||||
class Next < DebugCommand
|
||||
def execute(arg)
|
||||
execute_debug_command(do_cmds: "next #{arg}".rstrip)
|
||||
execute_debug_command(do_cmds: "next #{arg}")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -8,7 +8,7 @@ module IRB
|
||||
module Command
|
||||
class Step < DebugCommand
|
||||
def execute(arg)
|
||||
execute_debug_command(do_cmds: "step #{arg}".rstrip)
|
||||
execute_debug_command(do_cmds: "step #{arg}")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user