Sha256: 4b1b26bd9c3766e90e7a8cf6f240dc71e29ff844b515d5a47b3c2db9c4eb9793

Contents?: true

Size: 434 Bytes

Versions: 92

Compression:

Stored size: 434 Bytes

Contents

require 'singleton'

module Specinfra::Backend
  class ShellScript < Base
    def initialize
      @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

Version data entries

92 entries across 92 versions & 1 rubygems

Version Path
specinfra-2.25.0 lib/specinfra/backend/shell_script.rb
specinfra-2.24.2 lib/specinfra/backend/shell_script.rb
specinfra-2.24.1 lib/specinfra/backend/shell_script.rb
specinfra-2.24.0 lib/specinfra/backend/shell_script.rb
specinfra-2.23.0 lib/specinfra/backend/shell_script.rb
specinfra-2.22.0 lib/specinfra/backend/shell_script.rb
specinfra-2.21.1 lib/specinfra/backend/shell_script.rb
specinfra-2.21.0 lib/specinfra/backend/shell_script.rb
specinfra-2.20.2 lib/specinfra/backend/shell_script.rb
specinfra-2.20.1 lib/specinfra/backend/shell_script.rb
specinfra-2.20.0 lib/specinfra/backend/shell_script.rb
specinfra-2.19.6 lib/specinfra/backend/shell_script.rb
specinfra-2.19.5 lib/specinfra/backend/shell_script.rb
specinfra-2.19.4 lib/specinfra/backend/shell_script.rb
specinfra-2.19.3 lib/specinfra/backend/shell_script.rb
specinfra-2.19.2 lib/specinfra/backend/shell_script.rb
specinfra-2.19.1 lib/specinfra/backend/shell_script.rb
specinfra-2.19.0 lib/specinfra/backend/shell_script.rb
specinfra-2.18.3 lib/specinfra/backend/shell_script.rb
specinfra-2.18.2 lib/specinfra/backend/shell_script.rb