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

ruby-changes:35042

From: nobu <ko1@a...>
Date: Sun, 10 Aug 2014 11:41:08 +0900 (JST)
Subject: [ruby-changes:35042] nobu:r47124 (trunk): sample: use IO::NULL

nobu	2014-08-10 11:41:03 +0900 (Sun, 10 Aug 2014)

  New Revision: 47124

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

  Log:
    sample: use IO::NULL
    
    * sample/cgi-session-pstore.rb: use IO::NULL instead of hard coded
      device name for portability.
    
    * sample/drb/ring_place.rb: ditto.

  Modified files:
    trunk/sample/cgi-session-pstore.rb
    trunk/sample/drb/ring_place.rb
Index: sample/cgi-session-pstore.rb
===================================================================
--- sample/cgi-session-pstore.rb	(revision 47123)
+++ sample/cgi-session-pstore.rb	(revision 47124)
@@ -1,7 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/sample/cgi-session-pstore.rb#L1
 require 'cgi'
 require 'cgi/session/pstore'
 
-STDIN.reopen("/dev/null")
+STDIN.reopen(IO::NULL)
 cgi = CGI.new
 session = CGI::Session.new(cgi, 'database_manager' => CGI::Session::PStore)
 session['key'] = {'k' => 'v'}
Index: sample/drb/ring_place.rb
===================================================================
--- sample/drb/ring_place.rb	(revision 47123)
+++ sample/drb/ring_place.rb	(revision 47124)
@@ -18,8 +18,8 @@ if $DEBUG https://github.com/ruby/ruby/blob/trunk/sample/drb/ring_place.rb#L18
   puts DRb.uri
   DRb.thread.join
 else
-  STDIN.reopen('/dev/null')
-  STDOUT.reopen('/dev/null', 'w')
-  STDERR.reopen('/dev/null', 'w')
+  STDIN.reopen(IO::NULL)
+  STDOUT.reopen(IO::NULL, 'w')
+  STDERR.reopen(IO::NULL, 'w')
   DRb.thread.join
 end

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

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