diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-08-23 06:15:00 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-08-23 06:15:00 +0000 |
commit | c8d9fb8bd8638ab6842f2a129884abe5dada43c7 (patch) | |
tree | b71dac87e63fc59d3a0a02a6e2056ee51905d4b3 | |
parent | 9dc525e463d71cf73582183b42080f9506ea442d (diff) | |
download | ruby-c8d9fb8bd8638ab6842f2a129884abe5dada43c7.tar.gz ruby-c8d9fb8bd8638ab6842f2a129884abe5dada43c7.tar.xz ruby-c8d9fb8bd8638ab6842f2a129884abe5dada43c7.zip |
* bootstraptest/runner.rb (Dir.mktmpdir): updated to latest.
(in_temporary_working_directory): temporary directory name changed.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24630 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 6 | ||||
-rwxr-xr-x | bootstraptest/runner.rb | 18 |
2 files changed, 22 insertions, 2 deletions
@@ -1,3 +1,8 @@ +Sun Aug 23 15:12:22 2009 Tanaka Akira <akr@fsij.org> + + * bootstraptest/runner.rb (Dir.mktmpdir): updated to latest. + (in_temporary_working_directory): temporary directory name changed. + Sun Aug 23 00:56:13 2009 Tanaka Akira <akr@fsij.org> * thread.c (rb_thread_schedule): don't recur infinitely. @@ -10624,6 +10629,7 @@ Sun Dec 14 12:51:48 2008 Yusuke Endoh <mame@tsg.ne.jp> * random.c (rb_rand_internal): used by Bignum#*. * test/ruby/test_bignum.rb: add some tests for above. + Sun Dec 14 01:35:48 2008 Tanaka Akira <akr@fsij.org> * process.c (forked_child): new variable. diff --git a/bootstraptest/runner.rb b/bootstraptest/runner.rb index 1ba15fd20..047633c78 100755 --- a/bootstraptest/runner.rb +++ b/bootstraptest/runner.rb @@ -17,13 +17,27 @@ end if !Dir.respond_to?(:mktmpdir) # copied from lib/tmpdir.rb - def Dir.mktmpdir(prefix="d", tmpdir=nil) + def Dir.mktmpdir(prefix_suffix=nil, tmpdir=nil) + case prefix_suffix + when nil + prefix = "d" + suffix = "" + when String + prefix = prefix_suffix + suffix = "" + when Array + prefix = prefix_suffix[0] + suffix = prefix_suffix[1] + else + raise ArgumentError, "unexpected prefix_suffix: #{prefix_suffix.inspect}" + end tmpdir ||= Dir.tmpdir t = Time.now.strftime("%Y%m%d") n = nil begin path = "#{tmpdir}/#{prefix}#{t}-#{$$}-#{rand(0x100000000).to_s(36)}" path << "-#{n}" if n + path << suffix Dir.mkdir(path, 0700) rescue Errno::EEXIST n ||= 0 @@ -339,7 +353,7 @@ def in_temporary_working_directory(dir) yield } else - Dir.mktmpdir("bootstraptest.tmpwd") {|d| + Dir.mktmpdir(["bootstraptest", ".tmpwd"]) {|d| Dir.chdir(d) { yield } |