Sha256: 71c392365263d4d5ac61fdc4b27eddcdb6cf6829ceb35b9b0800558550fac36e

Contents?: true

Size: 512 Bytes

Versions: 256

Compression:

Stored size: 512 Bytes

Contents

require 'singleton'

module Specinfra
  module Backend
    class ShellScript < Base
      def initialize(config = {})
        super

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

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

      class Writer
        def initialize(lines)
          @lines = lines
        end

        def call(*args)
          puts @lines
        end
      end
    end
  end
end

Version data entries

256 entries across 256 versions & 3 rubygems

Version Path
specinfra-2.76.5 lib/specinfra/backend/shell_script.rb
specinfra-2.76.4 lib/specinfra/backend/shell_script.rb
specinfra-2.76.3 lib/specinfra/backend/shell_script.rb
specinfra-2.76.2 lib/specinfra/backend/shell_script.rb
specinfra-2.76.1 lib/specinfra/backend/shell_script.rb
specinfra-2.76.0 lib/specinfra/backend/shell_script.rb
specinfra-2.75.1 lib/specinfra/backend/shell_script.rb
specinfra-rb19-2.44.7 lib/specinfra/backend/shell_script.rb
specinfra-2.75.0 lib/specinfra/backend/shell_script.rb
specinfra-2.74.0 lib/specinfra/backend/shell_script.rb
specinfra-2.73.4 lib/specinfra/backend/shell_script.rb
specinfra-2.73.3 lib/specinfra/backend/shell_script.rb
specinfra-2.73.2 lib/specinfra/backend/shell_script.rb
specinfra-2.73.1 lib/specinfra/backend/shell_script.rb
specinfra-2.73.0 lib/specinfra/backend/shell_script.rb
specinfra-2.72.1 lib/specinfra/backend/shell_script.rb
specinfra-2.72.0 lib/specinfra/backend/shell_script.rb
specinfra-2.71.3 lib/specinfra/backend/shell_script.rb
specinfra-2.71.2 lib/specinfra/backend/shell_script.rb
specinfra-2.71.1 lib/specinfra/backend/shell_script.rb