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.
652 653 654 655 656 657 658 659 660 661 662 |
# File 'lib/rails-installer.rb', line 652 def in_directory(directory) begin old_dir = Dir.pwd Dir.chdir(directory) value = yield ensure Dir.chdir(old_dir) end return value end |