You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IO.console# #<File:/dev/tty>IO.consoleNoMethodError: undefinedmethod`open?' for #<File:/dev/tty> from /Users/davida/.rvm/rubies/jruby-9.0.4.0/lib/ruby/stdlib/io/console.rb:159:in `console' from (irb):2:in `<eval>'
In order to use the console returned by IO.console you have to store a reference to it:
# ExplodesIO.console.winsize# [60, 120]IO.console.winsize# Worksc=IO.consolec.winsize# [60, 120]# Also worksIO.consoleIO.instance_variable_get(:@console).winsize
The text was updated successfully, but these errors were encountered:
>> con=File.open('/dev/tty','r+')# or just File.new("test.txt", "w")=>#<File:/dev/tty>
>> con.kind_of?(File)=>true
>> con.kind_of?(IO)=>true
>> con.open?NoMethodError: undefinedmethod`open?' for #<File:/dev/tty> from (irb):10:in `<eval>' from org/jruby/RubyKernel.java:978:in `eval'fromorg/jruby/RubyKernel.java:1291:in`loop' from org/jruby/RubyKernel.java:1098:in `catch' from org/jruby/RubyKernel.java:1098:in `catch'from ~/.rvm/rubies/jruby-9.0.4.0/bin/irb:13:in `<top>'
Code to reproduce:
In order to use the console returned by IO.console you have to store a reference to it:
The text was updated successfully, but these errors were encountered: