Read more

Change the current directory without side effects in Ruby

Henning Koch
December 01, 2010Software engineer at makandra GmbH

To temporarily change the current working directory in Ruby, call Dir.chdir with a block. The previous working directory will be restored when the block ends:

Dir.chdir('/usr/local') do
  # do stuff in /usr/local
end
Illustration UI/UX Design

UI/UX Design by makandra brand

We make sure that your target audience has the best possible experience with your digital product. You get:

  • Design tailored to your audience
  • Proven processes customized to your needs
  • An expert team of experienced designers
Read more Show archive.org snapshot
Posted by Henning Koch to makandra dev (2010-12-01 10:33)