Class: DeploYML::LocalShell
Overview
Represents a shell running on the local system.
Instance Attribute Summary
Attributes inherited from Shell
Instance Method Summary collapse
-
#cd(path) { ... } ⇒ Object
Changes the current working directory.
-
#echo(message) ⇒ Object
Prints out a message.
-
#run(program, *arguments) ⇒ Object
Runs a program locally.
Methods inherited from Shell
#exec, #initialize, #rake, #rake_task, #status
Constructor Details
This class inherits a constructor from DeploYML::Shell
Instance Method Details
#cd(path) { ... } ⇒ Object
Changes the current working directory.
45 46 47 |
# File 'lib/deployml/local_shell.rb', line 45 def cd(path,&block) Dir.chdir(path,&block) end |
#echo(message) ⇒ Object
Prints out a message.
31 32 33 |
# File 'lib/deployml/local_shell.rb', line 31 def echo() puts end |
#run(program, *arguments) ⇒ Object
Runs a program locally.
18 19 20 21 22 23 |
# 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 |