From 87d607df7bff4666cf4fff9596551d96eb52f321 Mon Sep 17 00:00:00 2001 From: Koichi Sasada Date: Wed, 18 Dec 2024 06:07:57 +0900 Subject: [PATCH] allow `puts` without argument pointed out at https://github.com/ruby/debug/issues/1123 --- lib/debug/server_cdp.rb | 2 +- lib/debug/server_dap.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/debug/server_cdp.rb b/lib/debug/server_cdp.rb index 3826f1242..9adb09795 100644 --- a/lib/debug/server_cdp.rb +++ b/lib/debug/server_cdp.rb @@ -688,7 +688,7 @@ def sock skip: false yield $stderr end - def puts result='' + def puts result = "" # STDERR.puts "puts: #{result}" # send_event 'output', category: 'stderr', output: "PUTS!!: " + result.to_s end diff --git a/lib/debug/server_dap.rb b/lib/debug/server_dap.rb index 87c22ca45..7502182a4 100644 --- a/lib/debug/server_dap.rb +++ b/lib/debug/server_dap.rb @@ -501,7 +501,7 @@ def respond req, res send_response(req, **res) end - def puts result + def puts result = "" # STDERR.puts "puts: #{result}" send_event 'output', category: 'console', output: "#{result&.chomp}\n" end