Module: Boilerpl8::ShellHelper

Included in:
Operation
Defined in:
lib/boilerpl8.rb

Instance Method Summary collapse

Instance Method Details

#chdir(dir, &block) ⇒ Object



37
38
39
40
41
# File 'lib/boilerpl8.rb', line 37

def chdir(dir, &block)
  puts "$ cd #{dir}"
  Dir.chdir(dir, &block)
  puts "$ cd -"
end

#mv(oldpath, newpath) ⇒ Object



27
28
29
30
# File 'lib/boilerpl8.rb', line 27

def mv(oldpath, newpath)
  puts "$ mv #{oldpath} #{newpath}"
  File.rename oldpath, newpath
end

#rm_rf(path) ⇒ Object



22
23
24
25
# File 'lib/boilerpl8.rb', line 22

def rm_rf(path)
  puts "$ rm -rf #{path}"
  FileUtils.rm_rf path
end

#sys(command) ⇒ Object



32
33
34
35
# File 'lib/boilerpl8.rb', line 32

def sys(command)
  puts "$ #{command}"
  system command
end