irb(main):001:0> require "io/console"
=>false
irb(main):002:0> IO.console
=>#<File:/dev/tty>
irb(main):003:0> IO.console.winsize
NoMethodError: undefined method `open?' for #<File:/dev/tty> from /usr/local/rbenv/versions/jruby-9.0.0.0/lib/ruby/stdlib/io/console.rb:159:in `console' from (irb):3:in `<eval>' from org/jruby/RubyKernel.java:979:in `eval'
from org/jruby/RubyKernel.java:1292:in `loop' from org/jruby/RubyKernel.java:1099:in `catch' from org/jruby/RubyKernel.java:1099:in `catch' from /usr/local/rbenv/versions/jruby-9.0.0.0/bin/irb:13:in `<top>'
irb(main):004:0>
The text was updated successfully, but these errors were encountered:
So I get the same behavior with my fix as MRI does but I had to make a guess. My guess was that since we are assuming that branch was dealing with an IO we should make sure it is in fact an IO before calling open?.
MRI implements all this in C and we implement ours in Ruby so a side-by-side comparison is difficult. I definitely made sure we will only safely call open? and the comment next to this like implies something about digging in internals of IO.
I am unable to reproduce on JRuby 9.1, but perhaps my io/console is loading and yours is not? You do appear to get the proper File opened on /dev/tty, but for some reason it doesn't have the methods it should.
Im getting this error when using airbrush. I report to them mattbrictson/airbrussh#62 and he checked this is jruby's bug.
The text was updated successfully, but these errors were encountered: