[前][次][番号順一覧][スレッド一覧]

ruby-changes:22873

From: nobu <ko1@a...>
Date: Tue, 6 Mar 2012 12:31:30 +0900 (JST)
Subject: [ruby-changes:22873] nobu:r34922 (ruby_1_9_3): merge revision(s) 33172,33968:

nobu	2012-03-06 12:31:12 +0900 (Tue, 06 Mar 2012)

  New Revision: 34922

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=34922

  Log:
    merge revision(s) 33172,33968:
    
    * ext/io/console/console.c (console_set_winsize): remove
      unused variable.
    * io.c (Init_IO):  Mention io/console methods.  [Ruby 1.9 - Bug #5602]
    
    * ext/io/console/console.c:  Mention that io/console must be required
      similar to lib/time.rb

  Modified files:
    branches/ruby_1_9_3/ChangeLog
    branches/ruby_1_9_3/ext/io/console/console.c
    branches/ruby_1_9_3/io.c
    branches/ruby_1_9_3/version.h

Index: ruby_1_9_3/ChangeLog
===================================================================
--- ruby_1_9_3/ChangeLog	(revision 34921)
+++ ruby_1_9_3/ChangeLog	(revision 34922)
@@ -1,3 +1,9 @@
+Tue Mar  6 12:29:34 2012  Eric Hodel  <drbrain@s...>
+
+	* io.c (Init_IO):  Mention io/console methods.  [Ruby 1.9 - Bug #5602]
+	* ext/io/console/console.c:  Mention that io/console must be required
+	  similar to lib/time.rb
+
 Tue Mar  6 11:42:52 2012  Nobuyoshi Nakada  <nobu@r...>
 
 	* ext/syck/lib/syck/rubytypes.rb (Exception.yaml_new): fix bug
Index: ruby_1_9_3/io.c
===================================================================
--- ruby_1_9_3/io.c	(revision 34921)
+++ ruby_1_9_3/io.c	(revision 34922)
@@ -10699,6 +10699,35 @@
  *  command line (or STDIN if no files are mentioned). ARGF provides
  *  the methods <code>#path</code> and <code>#filename</code> to access
  *  the name of the file currently being read.
+ *
+ *  == io/console
+ *
+ *  The io/console extension provides methods for interacting with the
+ *  console.  The console can be accessed from <code>IO.console</code> or
+ *  the standard input/output/error IO objects.
+ *
+ *  Requiring io/console adds the following methods:
+ *
+ *  * IO::console
+ *  * IO#raw
+ *  * IO#raw!
+ *  * IO#cooked
+ *  * IO#cooked!
+ *  * IO#getch
+ *  * IO#echo=
+ *  * IO#echo?
+ *  * IO#noecho
+ *  * IO#winsize
+ *  * IO#winsize=
+ *  * IO#iflush
+ *  * IO#ioflush
+ *  * IO#oflush
+ *
+ *  Example:
+ *
+ *    require 'io/console'
+ *    rows, columns = $stdin.winsize
+ *    puts "You screen is #{columns} wide and #{rows} tall"
  */
 
 void
Index: ruby_1_9_3/ext/io/console/console.c
===================================================================
--- ruby_1_9_3/ext/io/console/console.c	(revision 34921)
+++ ruby_1_9_3/ext/io/console/console.c	(revision 34922)
@@ -247,6 +247,8 @@
  *   STDIN.raw(&:gets)
  *
  * will read and return a line with echo back and line editing.
+ *
+ * You must require 'io/console' to use this method.
  */
 static VALUE
 console_raw(VALUE io)
@@ -261,6 +263,8 @@
  * Enables raw mode.
  *
  * If the terminal mode needs to be back, use io.raw { ... }.
+ *
+ * You must require 'io/console' to use this method.
  */
 static VALUE
 console_set_raw(VALUE io)
@@ -288,6 +292,8 @@
  *   io.getch       -> char
  *
  * Reads and returns a character in raw mode.
+ *
+ * You must require 'io/console' to use this method.
  */
 static VALUE
 console_getch(VALUE io)
@@ -304,6 +310,8 @@
  *   STDIN.noecho(&:gets)
  *
  * will read and return a line without echo back.
+ *
+ * You must require 'io/console' to use this method.
  */
 static VALUE
 console_noecho(VALUE io)
@@ -316,6 +324,8 @@
  *   io.echo = flag
  *
  * Enables/disables echo back.
+ *
+ * You must require 'io/console' to use this method.
  */
 static VALUE
 console_set_echo(VALUE io, VALUE f)
@@ -340,6 +350,8 @@
  *   io.echo?       -> true or false
  *
  * Returns +true+ if echo back is enabled.
+ *
+ * You must require 'io/console' to use this method.
  */
 static VALUE
 console_echo_p(VALUE io)
@@ -379,6 +391,8 @@
  *   io.winsize     -> [rows, columns]
  *
  * Returns console size.
+ *
+ * You must require 'io/console' to use this method.
  */
 static VALUE
 console_winsize(VALUE io)
@@ -399,6 +413,8 @@
  *
  * Tries to set console size.  The effect depends on the platform and
  * the running environment.
+ *
+ * You must require 'io/console' to use this method.
  */
 static VALUE
 console_set_winsize(VALUE io, VALUE size)
@@ -410,7 +426,9 @@
     int newrow, newcol;
 #endif
     VALUE row, col, xpixel, ypixel;
+#if defined TIOCSWINSZ
     int fd;
+#endif
 
     GetOpenFile(io, fptr);
     size = rb_Array(size);
@@ -456,6 +474,8 @@
  *   io.iflush
  *
  * Flushes input buffer in kernel.
+ *
+ * You must require 'io/console' to use this method.
  */
 static VALUE
 console_iflush(VALUE io)
@@ -476,6 +496,8 @@
  *   io.oflush
  *
  * Flushes output buffer in kernel.
+ *
+ * You must require 'io/console' to use this method.
  */
 static VALUE
 console_oflush(VALUE io)
@@ -496,6 +518,8 @@
  *   io.ioflush
  *
  * Flushes input and output buffers in kernel.
+ *
+ * You must require 'io/console' to use this method.
  */
 static VALUE
 console_ioflush(VALUE io)
@@ -525,6 +549,8 @@
  *   IO.console      -> #<File:/dev/tty>
  *
  * Returns an File instance opened console.
+ *
+ * You must require 'io/console' to use this method.
  */
 static VALUE
 console_dev(VALUE klass)
Index: ruby_1_9_3/version.h
===================================================================
--- ruby_1_9_3/version.h	(revision 34921)
+++ ruby_1_9_3/version.h	(revision 34922)
@@ -1,5 +1,5 @@
 #define RUBY_VERSION "1.9.3"
-#define RUBY_PATCHLEVEL 157
+#define RUBY_PATCHLEVEL 158
 
 #define RUBY_RELEASE_DATE "2012-03-06"
 #define RUBY_RELEASE_YEAR 2012

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]