Skip to content

Commit 97898b6

Browse files
authored
Centralize rstrip calls (#918)
1 parent 8fb776e commit 97898b6

10 files changed

Lines changed: 12 additions & 9 deletions

File tree

‎lib/irb/command/backtrace.rb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module IRB
88
module Command
99
class Backtrace < DebugCommand
1010
def execute(arg)
11-
execute_debug_command(pre_cmds: "backtrace #{arg}".rstrip)
11+
execute_debug_command(pre_cmds: "backtrace #{arg}")
1212
end
1313
end
1414
end

‎lib/irb/command/break.rb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module IRB
88
module Command
99
class Break < DebugCommand
1010
def execute(arg)
11-
execute_debug_command(pre_cmds: "break #{arg}".rstrip)
11+
execute_debug_command(pre_cmds: "break #{arg}")
1212
end
1313
end
1414
end

‎lib/irb/command/catch.rb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module IRB
88
module Command
99
class Catch < DebugCommand
1010
def execute(arg)
11-
execute_debug_command(pre_cmds: "catch #{arg}".rstrip)
11+
execute_debug_command(pre_cmds: "catch #{arg}")
1212
end
1313
end
1414
end

‎lib/irb/command/continue.rb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module IRB
88
module Command
99
class Continue < DebugCommand
1010
def execute(arg)
11-
execute_debug_command(do_cmds: "continue #{arg}".rstrip)
11+
execute_debug_command(do_cmds: "continue #{arg}")
1212
end
1313
end
1414
end

‎lib/irb/command/debug.rb‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ def execute(_arg)
1818
end
1919

2020
def execute_debug_command(pre_cmds: nil, do_cmds: nil)
21+
pre_cmds = pre_cmds&.rstrip
22+
do_cmds = do_cmds&.rstrip
23+
2124
if irb_context.with_debugger
2225
# If IRB is already running with a debug session, throw the command and IRB.debug_readline will pass it to the debugger.
2326
if cmd = pre_cmds || do_cmds

‎lib/irb/command/delete.rb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module IRB
88
module Command
99
class Delete < DebugCommand
1010
def execute(arg)
11-
execute_debug_command(pre_cmds: "delete #{arg}".rstrip)
11+
execute_debug_command(pre_cmds: "delete #{arg}")
1212
end
1313
end
1414
end

‎lib/irb/command/finish.rb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module IRB
88
module Command
99
class Finish < DebugCommand
1010
def execute(arg)
11-
execute_debug_command(do_cmds: "finish #{arg}".rstrip)
11+
execute_debug_command(do_cmds: "finish #{arg}")
1212
end
1313
end
1414
end

‎lib/irb/command/info.rb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module IRB
88
module Command
99
class Info < DebugCommand
1010
def execute(arg)
11-
execute_debug_command(pre_cmds: "info #{arg}".rstrip)
11+
execute_debug_command(pre_cmds: "info #{arg}")
1212
end
1313
end
1414
end

‎lib/irb/command/next.rb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module IRB
88
module Command
99
class Next < DebugCommand
1010
def execute(arg)
11-
execute_debug_command(do_cmds: "next #{arg}".rstrip)
11+
execute_debug_command(do_cmds: "next #{arg}")
1212
end
1313
end
1414
end

‎lib/irb/command/step.rb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module IRB
88
module Command
99
class Step < DebugCommand
1010
def execute(arg)
11-
execute_debug_command(do_cmds: "step #{arg}".rstrip)
11+
execute_debug_command(do_cmds: "step #{arg}")
1212
end
1313
end
1414
end

0 commit comments

Comments
 (0)