Class: Specinfra::Backend::ShellScript

Inherits:
Base
  • Object
show all
Defined in:
lib/specinfra/backend/shell_script.rb

Defined Under Namespace

Classes: Writer

Instance Method Summary collapse

Methods inherited from Base

#set_example

Constructor Details

#initializeShellScript

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