Skip to content

Instantly share code, notes, and snippets.

@deepak
Created December 15, 2010 08:13
Show Gist options
  • Select an option

  • Save deepak/741761 to your computer and use it in GitHub Desktop.

Select an option

Save deepak/741761 to your computer and use it in GitHub Desktop.
Dir#chdir in ruby
# either use the cli option
# ruby -C /this/dir chdir.rb
# or explicitly set in code. this has some options -
# missing a gotcha check 'the ruby programming language' book
#puts "=== Dir.chdir: #{Dir.chdir(File.expand_path('..',__FILE__))}"
puts "=== Dir.pwd: #{Dir.pwd}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment