summaryrefslogtreecommitdiff
path: root/ext/io
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-24 06:54:25 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-24 06:54:25 +0000
commit755f669316b5d1ea5c618754e7c432ac1baf5b0e (patch)
treeafe9157100c6dc884c3a1a5e18100ec9aebe1732 /ext/io
parentdb41a18845d1578797a2b5baab6d9cbb76e29e42 (diff)
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
Diffstat (limited to 'ext/io')
-rw-r--r--ext/io/console/console.c6
-rw-r--r--ext/io/console/lib/console/size.rb2
2 files changed, 8 insertions, 0 deletions
diff --git a/ext/io/console/console.c b/ext/io/console/console.c
index 756daca..2a83f17 100644
--- a/ext/io/console/console.c
+++ b/ext/io/console/console.c
@@ -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)
{
diff --git a/ext/io/console/lib/console/size.rb b/ext/io/console/lib/console/size.rb
index e9d8a1f..519bc3b 100644
--- a/ext/io/console/lib/console/size.rb
+++ b/ext/io/console/lib/console/size.rb
@@ -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