Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ext/io/wait/wait.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ io_nread(VALUE io)
int len;
ioctl_arg n;

rb_category_warn(RB_WARN_CATEGORY_DEPRECATED, "IO#nread is deprecated; use wait_readable instead");
GetOpenFile(io, fptr);
rb_io_check_char_readable(fptr);
len = rb_io_read_pending(fptr);
Expand Down Expand Up @@ -142,6 +143,7 @@ io_ready_p(VALUE io)
struct timeval tv = {0, 0};
#endif

rb_category_warn(RB_WARN_CATEGORY_DEPRECATED, "IO#ready? is deprecated; use wait_readable instead");
GetOpenFile(io, fptr);
rb_io_check_char_readable(fptr);
if (rb_io_read_pending(fptr)) return Qtrue;
Expand Down
4 changes: 4 additions & 0 deletions ext/java/org/jruby/ext/io/wait/IOWaitLibrary.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@

import java.nio.channels.SelectionKey;

import static org.jruby.api.Warn.warnDeprecated;

/**
* @author Nick Sieger
*/
Expand All @@ -62,6 +64,7 @@ public static IRubyObject nread(ThreadContext context, IRubyObject _io) {
// ioctl_arg n;
RubyIO io = (RubyIO)_io;

warnDeprecated(context, "IO#nread is deprecated; use wait_readable instead");
fptr = io.getOpenFileChecked();
fptr.checkReadable(context);
len = fptr.readPending();
Expand All @@ -83,6 +86,7 @@ public static IRubyObject ready(ThreadContext context, IRubyObject _io) {
OpenFile fptr;
// ioctl_arg n;

warnDeprecated(context, "IO#ready? is deprecated; use wait_readable instead");
fptr = io.getOpenFileChecked();
fptr.checkReadable(context);
if (fptr.readPending() != 0) return context.tru;
Expand Down
2 changes: 1 addition & 1 deletion io-wait.gemspec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
_VERSION = "0.3.5"
_VERSION = "0.3.6"

Gem::Specification.new do |spec|
spec.name = "io-wait"
Expand Down
Loading