Sha256: 60e1664dc6dc6a8bdc774963a48dfa3b1c1c289dc8c8633bfc2fd5ad0dd8a7b3

Contents?: true

Size: 693 Bytes

Versions: 11

Compression:

Stored size: 693 Bytes

Contents

module SpecInfra
  module Helper
    module DetectOS
      def commands
        self.class.const_get('SpecInfra').const_get('Command').const_get(os[:family]).new
      end

      def os
        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_by_host = property[:os_by_host][host]
        else
          # Set command object explicitly to avoid `stack too deep`
          os_by_host = backend(SpecInfra::Command::Base.new).check_os
          property[:os_by_host][host] = os_by_host
        end

        os_by_host
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
specinfra-1.18.3 lib/specinfra/helper/detect_os.rb
specinfra-1.18.2 lib/specinfra/helper/detect_os.rb
specinfra-1.18.1 lib/specinfra/helper/detect_os.rb
specinfra-1.18.0 lib/specinfra/helper/detect_os.rb
specinfra-1.17.0 lib/specinfra/helper/detect_os.rb
specinfra-1.16.0 lib/specinfra/helper/detect_os.rb
specinfra-1.15.1 lib/specinfra/helper/detect_os.rb
specinfra-1.15.0 lib/specinfra/helper/detect_os.rb
specinfra-1.14.0 lib/specinfra/helper/detect_os.rb
specinfra-1.13.1 lib/specinfra/helper/detect_os.rb
specinfra-1.13.0 lib/specinfra/helper/detect_os.rb