module Pullr::CommandLine
Public Instance Methods
cd(path,&block)
click to toggle source
Changes directories.
@param [String] path
Path to the new directory.
@yield []
If a block is given, then the directory will only be changed temporarily, then changed back after the block has finished.
# 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)
click to toggle source
Runs a command.
@param [String] program
The name or path of the program to run.
@param [Array<String>] args
The additional arguments to run with the program.
# File lib/pullr/command_line.rb, line 35 def sh(program,*args) system(program,*args) end