Path: | lib/rscm/path_converter.rb |
Last Update: | Wed Oct 18 07:58:41 +0000 2006 |
WIN32 | = | RUBY_PLATFORM == "i386-mswin32" |
CYGWIN | = | RUBY_PLATFORM == "i386-cygwin" |
WINDOWS | = | WIN32 || CYGWIN |
# File lib/rscm/path_converter.rb, line 7 7: def with_working_dir(dir) 8: # Can't use Dir.chdir{ block } - will fail with multithreaded code. 9: # http://www.ruby-doc.org/core/classes/Dir.html#M000790 10: # 11: prev = Dir.pwd 12: begin 13: dir = File.expand_path(dir) 14: FileUtils.mkdir_p(dir) 15: Dir.chdir(dir) 16: yield 17: ensure 18: Dir.chdir(prev) 19: end 20: end