Class: Specinfra::Backend::ShellScript
- Defined in:
- lib/specinfra/backend/shell_script.rb
Defined Under Namespace
Classes: Writer
Instance Method Summary collapse
-
#initialize ⇒ ShellScript
constructor
A new instance of ShellScript.
- #run_command(cmd, opts = {}) ⇒ Object
Methods inherited from Base
Constructor Details
#initialize ⇒ ShellScript
Returns a new instance of ShellScript.
5 6 7 8 |
# File 'lib/specinfra/backend/shell_script.rb', line 5 def initialize @lines = [ "#!/bin/sh", "" ] ObjectSpace.define_finalizer(self, Writer.new(@lines)) end |
Instance Method Details
#run_command(cmd, opts = {}) ⇒ Object
10 11 12 13 |
# File 'lib/specinfra/backend/shell_script.rb', line 10 def run_command(cmd, opts={}) @lines << cmd CommandResult.new end |