Sha256: 9c9fc9dbd4c1b455f36d6b2a23dcaa8bbaa4e99adbd41e9769945b7fd5e612e8
Contents?: true
Size: 549 Bytes
Versions: 29
Compression:
Stored size: 549 Bytes
Contents
require 'singleton' module Specinfra module Backend class ShellScript < Base def initialize @lines = [ "#!/bin/sh", "" ] ObjectSpace.define_finalizer(self, Writer.new("spec.sh", @lines)) end def run_command(cmd, opts={}) @lines << cmd CommandResult.new end class Writer def initialize(file, lines) @file = file @lines = lines end def call(*args) File.write(@file, @lines.join("\n")) end end end end end
Version data entries
29 entries across 29 versions & 1 rubygems