Top Level Namespace
Defined Under Namespace
Classes: RailsInstaller
Instance Method Summary collapse
-
#in_directory(directory) ⇒ Object
Run a block inside of a specific directory.
Instance Method Details
#in_directory(directory) ⇒ Object
Run a block inside of a specific directory. Chdir into the directory before executing the block, then chdir back to the original directory when the block exits.
564 565 566 567 568 569 570 571 572 573 574 |
# File 'lib/rails-installer.rb', line 564 def in_directory(directory) begin old_dir = Dir.pwd Dir.chdir(directory) value = yield ensure Dir.chdir(old_dir) end return value end |