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);