From 3b50df543667f1c4de29b8f437bb9119ee7f4dfa Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter Date: Wed, 18 Dec 2024 18:34:49 -0600 Subject: [PATCH] Warn about removal of Kernel#open support for pipes --- core/src/main/java/org/jruby/RubyKernel.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/src/main/java/org/jruby/RubyKernel.java b/core/src/main/java/org/jruby/RubyKernel.java index 59fa811ee63..1952296dccd 100644 --- a/core/src/main/java/org/jruby/RubyKernel.java +++ b/core/src/main/java/org/jruby/RubyKernel.java @@ -127,6 +127,7 @@ import static org.jruby.api.Create.*; import static org.jruby.api.Error.argumentError; import static org.jruby.api.Error.typeError; +import static org.jruby.api.Warn.warnDeprecatedForRemovalAlternate; import static org.jruby.ir.runtime.IRRuntimeHelpers.dupIfKeywordRestAtCallsite; import static org.jruby.runtime.ThreadContext.hasKeywords; import static org.jruby.runtime.Visibility.PRIVATE; @@ -294,6 +295,7 @@ public static IRubyObject open(ThreadContext context, IRubyObject recv, IRubyObj } else { IRubyObject cmd = PopenExecutor.checkPipeCommand(context, tmp); if (cmd != context.nil) { + warnDeprecatedForRemovalAlternate(context, "Calling Kernel#open with a leading '|'", "4.0", "IO.popen"); if (PopenExecutor.nativePopenAvailable(context.runtime)) { args[0] = cmd; return PopenExecutor.popen(context, args, ioClass(context), block);