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

#command, #get_config, #host_inventory, instance, #os_info, #set_config, #set_example

Constructor Details

#initialize(config = {}) ⇒ ShellScript


6
7
8
9
10
11
# File 'lib/specinfra/backend/shell_script.rb', line 6

def initialize(config = {})
  super

  @lines = [ "#!/bin/sh", "" ]
  ObjectSpace.define_finalizer(self, Writer.new(@lines))
end

Instance Method Details

#run_command(cmd, opts = {}) ⇒ Object


13
14
15
16
# File 'lib/specinfra/backend/shell_script.rb', line 13

def run_command(cmd, opts={})
  @lines << cmd
  CommandResult.new
end