path_converter.rb

Path: lib/rscm/path_converter.rb
Last Update: Tue Feb 28 07:54:15 UTC 2006

Required files

fileutils  

Methods

Constants

WIN32 = RUBY_PLATFORM == "i386-mswin32"
CYGWIN = RUBY_PLATFORM == "i386-cygwin"
WINDOWS = WIN32 || CYGWIN

Public Instance methods

[Source]

    # 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

[Validate]