Branch: refs/heads/master Home: https://github.com/MacRuby/MacRuby Commit: 7945aca523c6dc638a252d5c7941d7f41cdea933 https://github.com/MacRuby/MacRuby/commit/7945aca523c6dc638a252d5c7941d7f41c... Author: Watson <watson1978@gmail.com> Date: 2011-03-29 (Tue, 29 Mar 2011) Changed paths: M io.c M spec/frozen/tags/macruby/core/file/reopen_tags.txt M spec/frozen/tags/macruby/core/io/reopen_tags.txt Log Message: ----------- IO#reopen will accept an object that has a #to_path method. Test Script: {{{ require 'test/unit/assertions.rb' include Test::Unit::Assertions FILE1 = "tmp.xxxxxx" FILE2 = "tmp.reopen.xxxxx" io = File.open(FILE1, "w") obj = Object.new def obj.to_path FILE2 end io.reopen(obj, "w") io.puts "hello world" io.close File.open(FILE2, "r") { |f| assert_equal("hello world\n", f.gets) } File.unlink(FILE1) File.unlink(FILE2) puts :ok }}}