ruby-changes:37772
From: nobu <ko1@a...>
Date: Thu, 5 Mar 2015 14:07:51 +0900 (JST)
Subject: [ruby-changes:37772] nobu:r49853 (trunk): remove GEM directories at exit
nobu 2015-03-05 14:07:39 +0900 (Thu, 05 Mar 2015) New Revision: 49853 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=49853 Log: remove GEM directories at exit Modified files: trunk/lib/rubygems/test_case.rb Index: lib/rubygems/test_case.rb =================================================================== --- lib/rubygems/test_case.rb (revision 49852) +++ lib/rubygems/test_case.rb (revision 49853) @@ -1442,6 +1442,9 @@ rescue LoadError, Gem::LoadError https://github.com/ruby/ruby/blob/trunk/lib/rubygems/test_case.rb#L1442 end require 'rubygems/test_utilities' -ENV['GEM_HOME'] = Dir.mktmpdir "home" -ENV['GEM_PATH'] = Dir.mktmpdir "path" +tmpdirs = [] +tmpdirs << (ENV['GEM_HOME'] = Dir.mktmpdir("home")) +tmpdirs << (ENV['GEM_PATH'] = Dir.mktmpdir("path")) +pid = $$ +END {tmpdirs.each {|dir| Dir.rmdir(dir)} if $$ == pid} Gem.clear_paths -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/