Top Level Namespace

Defined Under Namespace

Classes: RailsInstaller

Instance Method Summary collapse

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.



685
686
687
688
689
690
691
692
693
694
695
# File 'lib/rails-installer.rb', line 685

def in_directory(directory)
  begin
    old_dir = Dir.pwd
    Dir.chdir(directory)
    value = yield
  ensure
    Dir.chdir(old_dir)
  end
  
  return value
end