1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

io/console: rdoc

* ext/io/console/console.c (io_getch): add rdoc.

* ext/io/console/lib/console/size.rb (IO.console_size): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2013-05-24 06:54:25 +00:00
parent db41a18845
commit 755f669316
2 changed files with 8 additions and 0 deletions

View file

@ -768,6 +768,12 @@ console_dev(VALUE klass)
return con;
}
/*
* call-seq:
* io.getch(min: nil, time: nil) -> char
*
* See IO#getch.
*/
static VALUE
io_getch(int argc, VALUE *argv, VALUE io)
{

View file

@ -1,3 +1,4 @@
# fallback to console window size
def IO.default_console_size
[
ENV["LINES"].to_i.nonzero? || 25,
@ -12,6 +13,7 @@ rescue LoadError
alias console_size default_console_size
end
else
# returns console window size
def IO.console_size
console.winsize
rescue NoMethodError