Class: Rake::Delphi::ChDir
- Defined in:
- lib/rake/common/chdirtask.rb
Instance Method Summary collapse
-
#initialize(task, dir) ⇒ ChDir
constructor
A new instance of ChDir.
Methods inherited from BasicTask
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 |