Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Centralize rstrip calls #918

Merged
merged 1 commit into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/irb/command/backtrace.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/irb/command/break.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/irb/command/catch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/irb/command/continue.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions lib/irb/command/debug.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ def execute(_arg)
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
Expand Down
2 changes: 1 addition & 1 deletion lib/irb/command/delete.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/irb/command/finish.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/irb/command/info.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/irb/command/next.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/irb/command/step.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading