Class: Rake::Delphi::ChDir

Inherits:
BasicTask show all
Defined in:
lib/rake/common/chdirtask.rb

Instance Method Summary collapse

Methods inherited from BasicTask

#trace?

Constructor Details

#initialize(task, dir) ⇒ ChDir

Returns a new instance of ChDir.



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/rake/common/chdirtask.rb', line 8

def initialize(task, dir)
    super(task)
    return unless block_given?
    od = Dir.pwd
    begin
        Dir.chdir(dir)
        yield dir
    ensure
        Dir.chdir(od)
    end
end