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.
-
#exec(command) ⇒ Object
Executes a command.
-
#run(program, *arguments) ⇒ Object
Runs a program locally.
Methods inherited from Shell
#initialize, #rake, #rake_task, #ruby, #shellescape, #status
Constructor Details
This class inherits a constructor from DeploYML::Shell
Instance Method Details
#cd(path) { ... } ⇒ Object
Changes the current working directory.
57 58 59 |
# File 'lib/deployml/local_shell.rb', line 57 def cd(path,&block) Dir.chdir(path,&block) end |
#echo(message) ⇒ Object
Prints out a message.
43 44 45 |
# File 'lib/deployml/local_shell.rb', line 43 def echo() puts end |
#exec(command) ⇒ Object
Executes a command.
33 34 35 |
# File 'lib/deployml/local_shell.rb', line 33 def exec(command) system(command) 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 |