Sha256: 3fe9d050985139c193e8e41bbc532c4f5e0b796965fc33b1ad06a693ee19503a

Contents?: true

Size: 424 Bytes

Versions: 14

Compression:

Stored size: 424 Bytes

Contents

require 'multi_json'

module Serverspec::Type
  class Command < Base
    def stdout
      command_result.stdout
    end

    def stdout_as_json
      MultiJson.load(command_result.stdout)
    end

    def stderr
      command_result.stderr
    end

    def exit_status
      command_result.exit_status.to_i
    end

    private
    def command_result()
      @command_result ||= @runner.run_command(@name)
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
serverspec-2.41.7 lib/serverspec/type/command.rb
serverspec-2.41.6 lib/serverspec/type/command.rb
serverspec-2.41.5 lib/serverspec/type/command.rb
serverspec-2.41.4 lib/serverspec/type/command.rb
serverspec-2.41.3 lib/serverspec/type/command.rb
serverspec-2.41.2 lib/serverspec/type/command.rb
serverspec-2.41.1 lib/serverspec/type/command.rb
serverspec-2.41.0 lib/serverspec/type/command.rb
serverspec-2.40.0 lib/serverspec/type/command.rb
serverspec-2.39.2 lib/serverspec/type/command.rb
serverspec-2.39.1 lib/serverspec/type/command.rb
serverspec-2.39.0 lib/serverspec/type/command.rb
serverspec-2.38.1 lib/serverspec/type/command.rb
serverspec-2.38.0 lib/serverspec/type/command.rb