Sha256: e8f2c34a25c741ae8698cd04d4a74c12d46b7a8d8a500a2cff7347d1f9ff7c80

Contents?: true

Size: 549 Bytes

Versions: 75

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

75 entries across 75 versions & 1 rubygems

Version Path
specinfra-1.27.5 lib/specinfra/backend/shellscript.rb
specinfra-1.27.4 lib/specinfra/backend/shellscript.rb
specinfra-1.27.3 lib/specinfra/backend/shellscript.rb
specinfra-1.27.2 lib/specinfra/backend/shellscript.rb
specinfra-1.27.1 lib/specinfra/backend/shellscript.rb
specinfra-1.27.0 lib/specinfra/backend/shellscript.rb
specinfra-1.26.0 lib/specinfra/backend/shellscript.rb
specinfra-1.25.8 lib/specinfra/backend/shellscript.rb
specinfra-1.25.7 lib/specinfra/backend/shellscript.rb
specinfra-1.25.6 lib/specinfra/backend/shellscript.rb
specinfra-1.25.5 lib/specinfra/backend/shellscript.rb
specinfra-1.25.4 lib/specinfra/backend/shellscript.rb
specinfra-1.25.3 lib/specinfra/backend/shellscript.rb
specinfra-1.25.2 lib/specinfra/backend/shellscript.rb
specinfra-1.25.1 lib/specinfra/backend/shellscript.rb
specinfra-1.25.0 lib/specinfra/backend/shellscript.rb
specinfra-1.24.0 lib/specinfra/backend/shellscript.rb
specinfra-1.23.1 lib/specinfra/backend/shellscript.rb
specinfra-1.23.0 lib/specinfra/backend/shellscript.rb
specinfra-1.22.1 lib/specinfra/backend/shellscript.rb