Sha256: 1ac299f717afd6ae1758da53d357c16fe20b9665f2dd41d915ee40e5056aa528

Contents?: true

Size: 553 Bytes

Versions: 4

Compression:

Stored size: 553 Bytes

Contents

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

        if property[:os_by_host][host]
          os = property[:os_by_host][host]
        else
          os = backend(SpecInfra::Command::Base).check_os
          property[:os_by_host][host] = os
        end
        self.class.const_get('SpecInfra').const_get('Command').const_get(os[:family]).new
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
specinfra-0.0.9 lib/specinfra/helper/detect_os.rb
specinfra-0.0.8 lib/specinfra/helper/detect_os.rb
specinfra-0.0.7 lib/specinfra/helper/detect_os.rb
specinfra-0.0.6 lib/specinfra/helper/detect_os.rb