Module: Pullr::CommandLine
- Included in:
- SCM::Git, SCM::Mercurial, SCM::Rsync, SCM::SubVersion
- Defined in:
- lib/pullr/command_line.rb
Instance Method Summary collapse
-
#cd(path) { ... } ⇒ Object
Changes directories.
-
#sh(program, *args) ⇒ Object
Runs a command.
Instance Method Details
#cd(path) { ... } ⇒ Object
Changes directories.
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/pullr/command_line.rb', line 13 def cd(path,&block) if block pwd = Dir.pwd Dir.chdir(path) block.call() Dir.chdir(pwd) else Dir.chdir(path) end end |
#sh(program, *args) ⇒ Object
Runs a command.
35 36 37 |
# File 'lib/pullr/command_line.rb', line 35 def sh(program,*args) system(program,*args) end |