Sha256: d3124ca2cdf02e0809a2e3979ab642fcdc87b9548a667216777b77af84df6e41

Contents?: true

Size: 625 Bytes

Versions: 54

Compression:

Stored size: 625 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
          # Set command object explicitly to avoid `stack too deep`
          os = backend(SpecInfra::Command::Base.new).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

54 entries across 54 versions & 1 rubygems

Version Path
specinfra-1.11.0 lib/specinfra/helper/detect_os.rb
specinfra-1.10.0 lib/specinfra/helper/detect_os.rb
specinfra-2.0.0.beta1 lib/specinfra/helper/detect_os.rb
specinfra-1.9.0 lib/specinfra/helper/detect_os.rb
specinfra-1.8.0 lib/specinfra/helper/detect_os.rb
specinfra-1.7.0 lib/specinfra/helper/detect_os.rb
specinfra-1.6.0 lib/specinfra/helper/detect_os.rb
specinfra-1.5.1 lib/specinfra/helper/detect_os.rb
specinfra-1.5.0 lib/specinfra/helper/detect_os.rb
specinfra-1.4.0 lib/specinfra/helper/detect_os.rb
specinfra-1.3.0 lib/specinfra/helper/detect_os.rb
specinfra-1.2.1 lib/specinfra/helper/detect_os.rb
specinfra-1.2.0 lib/specinfra/helper/detect_os.rb
specinfra-1.1.1 lib/specinfra/helper/detect_os.rb
specinfra-1.1.0 lib/specinfra/helper/detect_os.rb
specinfra-1.0.5 lib/specinfra/helper/detect_os.rb
specinfra-1.0.4 lib/specinfra/helper/detect_os.rb
specinfra-1.0.3 lib/specinfra/helper/detect_os.rb
specinfra-1.0.2 lib/specinfra/helper/detect_os.rb
specinfra-1.0.1 lib/specinfra/helper/detect_os.rb