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

ruby-changes:59309

From: Nobuyoshi <ko1@a...>
Date: Wed, 18 Dec 2019 00:08:48 +0900 (JST)
Subject: [ruby-changes:59309] 4b7d27ca0d (master): [ruby/io-console] Use IO.console instead of STDIN

https://git.ruby-lang.org/ruby.git/commit/?id=4b7d27ca0d

From 4b7d27ca0de5e1294fa2072d948953ef49753fc5 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Tue, 17 Dec 2019 17:24:21 +0900
Subject: [ruby/io-console] Use IO.console instead of STDIN

https://github.com/ruby/io-console/commit/9e3ec5b936

diff --git a/test/io/console/test_io_console.rb b/test/io/console/test_io_console.rb
index 765385d..083b4a7 100644
--- a/test/io/console/test_io_console.rb
+++ b/test/io/console/test_io_console.rb
@@ -332,11 +332,12 @@ defined?(PTY) and defined?(IO.console) and TestIO_Console.class_eval do https://github.com/ruby/ruby/blob/trunk/test/io/console/test_io_console.rb#L332
       begin;
         STDOUT.puts `stty -a`.scan(/\b\w+ *= *\^.;/), ""
         STDOUT.flush
-        while c = STDIN.getch
+        con = IO.console
+        while c = con.getch
           p c.ord
-          p STDIN.getch(intr: false).ord
+          p con.getch(intr: false).ord
           begin
-            p STDIN.getch(intr: true).ord
+            p con.getch(intr: true).ord
           rescue Interrupt => e
             p e
           end
-- 
cgit v0.10.2


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

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