Module: GithubBackup::Helpers

Defined in:
lib/github_backup/helpers.rb

Instance Method Summary collapse

Instance Method Details

#chdir_p(path) ⇒ Object



12
13
14
15
# File 'lib/github_backup/helpers.rb', line 12

def chdir_p(path)
  FileUtils.mkdir_p path
  Dir.chdir path
end

#inside(dir) ⇒ Object



5
6
7
8
9
10
# File 'lib/github_backup/helpers.rb', line 5

def inside(dir)
  current = Dir.pwd
  chdir_p dir
  yield
  Dir.chdir(current)
end