summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Lo <[email protected]>2024-04-11 01:33:40 +0800
committergit <[email protected]>2024-04-10 17:33:44 +0000
commitd75dc3988059ac2fc6eb06f29508ef935f5e0139 (patch)
tree7084cfb587b993549fb2c4a5e03dd02e0011529d
parentd60b2caa95b01f37d35db9ef8be1d035d14b408d (diff)
[ruby/irb] Centralize rstrip calls
(https://github.com/ruby/irb/pull/918) https://github.com/ruby/irb/commit/97898b6251
-rw-r--r--lib/irb/command/backtrace.rb2
-rw-r--r--lib/irb/command/break.rb2
-rw-r--r--lib/irb/command/catch.rb2
-rw-r--r--lib/irb/command/continue.rb2
-rw-r--r--lib/irb/command/debug.rb3
-rw-r--r--lib/irb/command/delete.rb2
-rw-r--r--lib/irb/command/finish.rb2
-rw-r--r--lib/irb/command/info.rb2
-rw-r--r--lib/irb/command/next.rb2
-rw-r--r--lib/irb/command/step.rb2
10 files changed, 12 insertions, 9 deletions
diff --git a/lib/irb/command/backtrace.rb b/lib/irb/command/backtrace.rb
index 610f9ee22c..687bb075ac 100644
--- a/lib/irb/command/backtrace.rb
+++ b/lib/irb/command/backtrace.rb
@@ -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
diff --git a/lib/irb/command/break.rb b/lib/irb/command/break.rb
index 42ee002ce8..a8f81fe665 100644
--- a/lib/irb/command/break.rb
+++ b/lib/irb/command/break.rb
@@ -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
diff --git a/lib/irb/command/catch.rb b/lib/irb/command/catch.rb
index 655c77d8af..529dcbca5a 100644
--- a/lib/irb/command/catch.rb
+++ b/lib/irb/command/catch.rb
@@ -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
diff --git a/lib/irb/command/continue.rb b/lib/irb/command/continue.rb
index 49e4384eb3..0daa029b15 100644
--- a/lib/irb/command/continue.rb
+++ b/lib/irb/command/continue.rb
@@ -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
diff --git a/lib/irb/command/debug.rb b/lib/irb/command/debug.rb
index aeafe19b5f..f9aca0a672 100644
--- a/lib/irb/command/debug.rb
+++ b/lib/irb/command/debug.rb
@@ -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
diff --git a/lib/irb/command/delete.rb b/lib/irb/command/delete.rb
index 4b45a51e73..2a57a4a3de 100644
--- a/lib/irb/command/delete.rb
+++ b/lib/irb/command/delete.rb
@@ -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
diff --git a/lib/irb/command/finish.rb b/lib/irb/command/finish.rb
index c1d62357f4..3311a0e6e9 100644
--- a/lib/irb/command/finish.rb
+++ b/lib/irb/command/finish.rb
@@ -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
diff --git a/lib/irb/command/info.rb b/lib/irb/command/info.rb
index 897ee2c430..d08ce00a32 100644
--- a/lib/irb/command/info.rb
+++ b/lib/irb/command/info.rb
@@ -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
diff --git a/lib/irb/command/next.rb b/lib/irb/command/next.rb
index 92d28e33ef..3fc6b68d21 100644
--- a/lib/irb/command/next.rb
+++ b/lib/irb/command/next.rb
@@ -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
diff --git a/lib/irb/command/step.rb b/lib/irb/command/step.rb
index 5149813029..29e5e35ac0 100644
--- a/lib/irb/command/step.rb
+++ b/lib/irb/command/step.rb
@@ -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