Sha256: f1cd9be66adc0ac93e1c7e3c2e2a9279c95e7c06e87b65b7e9905d73f5b1a323
Contents?: true
Size: 616 Bytes
Versions: 17
Compression:
Stored size: 616 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 { :stdout => nil, :stderr => nil, :exit_status => 0, :exit_signal => nil } 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
17 entries across 17 versions & 1 rubygems