Skip to content

Commit

Permalink
Warn about removal of Kernel#open support for pipes
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Dec 19, 2024
1 parent 57a1b31 commit 3b50df5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/src/main/java/org/jruby/RubyKernel.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 3b50df5

Please sign in to comment.