[MacRuby] #1026: IO::open give a warning when passed a block

MacRuby ruby-noreply at macosforge.org
Mon Dec 6 23:00:59 PST 2010


#1026: IO::open give a warning when passed a block
------------------------------------+---------------------------------------
 Reporter:  mrada@…                 |       Owner:  lsansonetti@…        
     Type:  defect                  |      Status:  new                  
 Priority:  major                   |   Milestone:                       
Component:  MacRuby                 |    Keywords:                       
------------------------------------+---------------------------------------

Comment(by watson1978@…):

 {{{
 $ ruby19 -v -e "IO.open(1){|f| p f}"
 ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.4.0]
 #<IO:fd 1>

 $ ruby -v -e "IO.open(1){|f| p f}"
 ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
 #<IO:0x10016aa20>

 macruby -e "IO.open(1){|f| p f}"
 unknown: warning: IO::new() does not take block; use IO::open() instead
 #<IO:0x20003d000>
 }}}

 The similar warning can watch TCPServer/TCPSocket/UDPSocket.
 {{{
 macruby -r socket -e "TCPServer.open('localhost'){|f| p f}"
 unknown: warning: TCPServer::new() does not take block; use
 TCPServer::open() instead

 macruby -r socket -e "TCPSocket.open('localhost', 80){|f| p f}"
 unknown: warning: TCPSocket::new() does not take block; use
 TCPSocket::open() instead
 -e:1:in `<main>': Connection refused - connect(2) (Errno::ECONNREFUSED)

 macruby -r socket -e "UDPSocket.open(){|f| p f}"
 unknown: warning: UDPSocket::new() does not take block; use
 UDPSocket::open() instead
 #<UDPSocket:0x2000c59c0>
 }}}

-- 
Ticket URL: <http://www.macruby.org/trac/ticket/1026#comment:1>
MacRuby <http://macruby.org/>



More information about the macruby-tickets mailing list