Skip to content
Commits on May 11, 2011
  1. @Watson1978

    raise an exception extended by IO::{WaitReadable, WaitWritable} in so…

    Watson1978 committed May 12, 2011
    …cket library
    
    - BasicSocket#recv_nonblock : extend IO::WaitReadable on EWOULDBLOCK and EAGAIN
    - TCPServer#accept_nonblock : extend IO::WaitReadable on EWOULDBLOCK, EAGAIN, ECONNABORTED and EPROTO
    - Socket#connect_nonblock   : extend IO::WaitWritable on EINPROGRESS
Commits on May 10, 2011
  1. @Watson1978
  2. @Watson1978
  3. @Watson1978
  4. @Watson1978
  5. @Watson1978
  6. @Watson1978
Commits on May 9, 2011
  1. @ferrous26
  2. @ferrous26

    Only run ruby_deploy specs if MacRuby is installed

    ferrous26 committed May 9, 2011
    This is temporary while the ruby_deploy specs are being fleshed out.
  3. @ferrous26
Commits on May 6, 2011
  1. @Watson1978

    close the files which used inside of IO#copy_strem. and, use the copy…

    Watson1978 committed May 6, 2011
    …file() only at the time of file copying.
    
    Test Script:
    {{{
    File.open("/tmp/a", "w") { |f|
      str = "x" * 200
      f.write str
    }
    
    100000.times { IO.copy_stream("/tmp/a", "/tmp/b") }
    puts :ok
    }}}
  2. @ferrous26
  3. @ferrous26
  4. @ferrous26

    Reduce some verbosity in command_line specs

    ferrous26 committed May 6, 2011
    By including FileUtils.
  5. @ferrous26
  6. @ferrous26
  7. @ferrous26
  8. @Watson1978

    IO.copy_stream will use copyfile() even when given descriptors. fix a…

    Watson1978 committed May 6, 2011
    … #363.
    
    Test Script:
    {{{
    File.open("/tmp/a", "w") { |f|
      f.write "x" * 10240
    }
    p IO.copy_stream("/tmp/a", "/tmp/b")
    
    src = open("/tmp/a")
    p IO.copy_stream(src, "/tmp/b")
    src.close
    
    src = open("/tmp/a")
    dst = open("/tmp/c", "w")
    p IO.copy_stream(src, dst)
    src.close
    dst.close
    }}}
  9. fix a bug in #caller where it would potentially return methods with t…

    Laurent Sansonetti committed May 5, 2011
    …railing ':' characters
  10. @Watson1978
Commits on May 5, 2011
  1. @alloy

    Check that the archs for which the ruby files should be compiled are …

    alloy committed May 5, 2011
    …taken from ENV['ARCHS'] or the app binary.
  2. @alloy
  3. @alloy

    Check that the install_name of the MacRuby framework is also adjusted…

    alloy committed May 5, 2011
    … to the embedded version in the app binary.
  4. @alloy

    Check that the install_name of the MacRuby framework is set correctly…

    alloy committed May 5, 2011
    … on compiled source files.
  5. @alloy

    Check that rbos actually work after compilation and that the original…

    alloy committed May 5, 2011
    … files are removed.
  6. @alloy
  7. @Watson1978

    IO#read and command execution with backquote will return tainted string.

    Watson1978 committed May 5, 2011
    Test Script:
    {{{
    require 'test/unit/assertions.rb'
    include Test::Unit::Assertions
    require 'tempfile'
    
    def make_tempfile
      t = Tempfile.new("foo")
      t.binmode
      t.puts "foo"
      t.puts "bar"
      t.puts "baz"
      t.close
      t
    end
    
    t = make_tempfile
    File.open(t.path) { |f|
      assert(f.read(2).tainted?)
    }
    
    puts :ok
    }}}
    
    {{{
    require 'test/unit/assertions.rb'
    include Test::Unit::Assertions
    
    str = `date`
    assert(str.tainted?)
    
    puts :ok
    }}}
  8. @Watson1978

    File#initialize will not accept what reinitialize.

    Watson1978 committed May 5, 2011
    Test Script:
    {{{
    require 'test/unit/assertions.rb'
    include Test::Unit::Assertions
    
    f = open("/tmp/test.txt", "w")
    assert_raise(RuntimeError) do
      f.instance_eval { initialize("/tmp/test2.txt", "w") }
      f.puts "xxxx"
    end
    
    assert_equal("#<File:/tmp/test.txt>", f.inspect)
    
    puts :ok
    }}}
  9. @alloy

    Compile ruby source files for the archs in either ENV['ARCHS'] or the…

    alloy committed May 5, 2011
    … ones inflected from the app binary.
  10. @vincentisambart
  11. @Watson1978

    IO.new will be able to decide an access mode from a given descriptor.

    Watson1978 committed May 5, 2011
    Test Script:
    {{{
    require 'test/unit/assertions.rb'
    include Test::Unit::Assertions
    
    fd = IO.sysopen("/tmp/test.txt", "w", 0666)
    
    f = IO.new(fd)
    f.write("foo\nbar\nbaz")
    f.close
    
    File.open("/tmp/test.txt") {|f|
      assert_equal("foo\nbar\nbaz", f.read)
    }
    
    assert_raise(Errno::EBADF){ IO.new(-1) }
    assert_raise(Errno::EBADF){ IO.new(32767) }
    
    puts :ok
    }}}
  12. fix a bug in the definition of the root #initialize method where it w…

    Laurent Sansonetti committed May 4, 2011
    …ould not accept variadic arguments (unlike CRuby)
Commits on May 4, 2011
  1. @Watson1978

    IO.pipe will support a block.

    Watson1978 committed May 5, 2011
    Test Script:
    {{{
    require 'test/unit/assertions.rb'
    include Test::Unit::Assertions
    
    class SubIO < IO; end
    
    x = nil
    ret = SubIO.pipe {|r, w|
      x = [r,w]
      assert_instance_of(SubIO, r)
      assert_instance_of(SubIO, w)
    
      Thread.start do
        w.print "abc"
        w.close
      end
      assert_equal("abc", r.read)
    
      assert(!r.closed?)
      assert(w.closed?)
      :foooo
    }
    assert_equal(:foooo, ret)
    assert(x[0].closed?)
    assert(x[1].closed?)
    
    puts :ok
    }}}
  2. @Watson1978

    Kernel.open with pipe will be able to open stream to write.

    Watson1978 committed May 4, 2011
    Test Script:
    {{{
    require 'test/unit/assertions.rb'
    include Test::Unit::Assertions
    
    open("| ruby", "r+") do |f|
      f.puts "puts 'foo'"
      f.close_write
      assert_equal("foo\n", f.read)
    end
    
    puts :ok
    }}}
  3. @takaokouji

    fixed break, next and redo with ensure block, fixed codes below.

    takaokouji committed May 4, 2011
    1)
    1.times { begin; break; ensure; p 42; end }
    
    2)
    i=0; while i<1; begin; break; ensure; p 42; end; end
    
    3)
    i=0; while true; begin; break if i>0; i=1; redo; ensure; p 42; end; end
    
    4)
    def f(&proc) p :ok; end; f(&nil)
Something went wrong with that request. Please try again.