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

ruby-changes:37132

From: akr <ko1@a...>
Date: Mon, 12 Jan 2015 00:58:54 +0900 (JST)
Subject: [ruby-changes:37132] akr:r49213 (trunk): [DOC]

akr	2015-01-12 00:58:40 +0900 (Mon, 12 Jan 2015)

  New Revision: 49213

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

  Log:
    [DOC]

  Modified files:
    trunk/ext/pty/pty.c
    trunk/test/io/console/test_io_console.rb
Index: ext/pty/pty.c
===================================================================
--- ext/pty/pty.c	(revision 49212)
+++ ext/pty/pty.c	(revision 49213)
@@ -503,6 +503,14 @@ pty_close_pty(VALUE assoc) https://github.com/ruby/ruby/blob/trunk/ext/pty/pty.c#L503
  * +slave_file+::   the slave of the pty, as a File.  The path to the
  *		    terminal device is available via +slave_file.path+
  *
+ * IO#raw! is usable to disable newline conversions:
+ *
+ *   require 'io/console'
+ *   PTY.open {|m, s|
+ *     s.raw!
+ *     ...
+ *   }
+ *
  */
 static VALUE
 pty_open(VALUE klass)
Index: test/io/console/test_io_console.rb
===================================================================
--- test/io/console/test_io_console.rb	(revision 49212)
+++ test/io/console/test_io_console.rb	(revision 49213)
@@ -68,6 +68,14 @@ class TestIO_Console < Test::Unit::TestC https://github.com/ruby/ruby/blob/trunk/test/io/console/test_io_console.rb#L68
     }
   end
 
+  def test_raw!
+    helper {|m, s|
+      s.raw!
+      s.print "foo\n"
+      assert_equal("foo\n", m.gets)
+    }
+  end
+
   def test_cooked
     helper {|m, s|
       assert_send([s, :echo?])

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

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