home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
ruby164.zip
/
rbemx164.zip
/
ruby
/
share
/
doc
/
rdtool-0.6.10
/
test
/
temp-dir.rb
< prev
next >
Wrap
Text File
|
2001-03-22
|
254b
|
20 lines
def in_temp_dir
tmpdir = "test-tmp.#$$"
pwd = Dir.pwd
Dir.mkdir(tmpdir)
Dir.chdir(tmpdir)
begin
yield
ensure
Dir.chdir(pwd)
Dir.rmdir(tmpdir)
end
end
def remove_file(file)
if File.exist? file
File.unlink(file)
end
end