Sha256: 405e5cefe471d495373e4638a9ef78b7f726e66ccbc0dc5386ad6975e3218a5c

Contents?: true

Size: 551 Bytes

Versions: 3

Compression:

Stored size: 551 Bytes

Contents

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

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

        self.class.const_get('Serverspec').const_get('Commands').const_get(os[:family]).new
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
serverspec-0.11.5 lib/serverspec/helper/detect_os.rb
serverspec-0.11.4 lib/serverspec/helper/detect_os.rb
serverspec-0.11.3 lib/serverspec/helper/detect_os.rb