class DeploYML::LocalShell
Represents a shell running on the local system.
Public Instance Methods
cd(path,&block)
click to toggle source
Changes the current working directory.
@param [String] path
The path of the new current working directory to use.
@yield []
If a block is given, then the directory will be changed back after the block has returned.
# File lib/deployml/local_shell.rb, line 57 def cd(path,&block) Dir.chdir(path,&block) end
echo(message)
click to toggle source
Prints out a message.
@param [String] message
The message to print.
# File lib/deployml/local_shell.rb, line 43 def echo(message) puts message end
exec(command)
click to toggle source
Executes a command.
@param [String] command
The command to be executed.
@since 0.5.2
# File lib/deployml/local_shell.rb, line 33 def exec(command) system(command) end
run(program,*arguments)
click to toggle source
Runs a program locally.
@param [String] program
The name or path of the program to run.
@param [Array<String>] arguments
Additional arguments for the program.
# File lib/deployml/local_shell.rb, line 18 def run(program,*arguments) program = program.to_s arguments = arguments.map { |arg| arg.to_s } system(program,*arguments) end