Sha256: 34a25e5f98b286de29c6e0e33985bb53e36502edd8f23d1beb7783438fd439b4

Contents?: true

Size: 527 Bytes

Versions: 2

Compression:

Stored size: 527 Bytes

Contents

module Serverspec
  module Helper
    module DetectOS
      def commands
        property[:os_type] = {} if ! property[:os_type]
        host = RSpec.configuration.ssh ? RSpec.configuration.ssh.host : 'localhost'

        if property[:os_type][host]
          os = property[:os_type][host]
        else
          os = backend(Serverspec::Commands::Base).check_os
          property[:os_type][host] = os
        end

        self.class.const_get('Serverspec').const_get('Commands').const_get(os).new
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
serverspec-0.11.1 lib/serverspec/helper/detect_os.rb
serverspec-0.11.0 lib/serverspec/helper/detect_os.rb