Sha256: ee54100c95d5dd5c8e9f847a6e4066b3d388df391ec8a736e0f38f9a09f0486a
Contents?: true
Size: 943 Bytes
Versions: 25
Compression:
Stored size: 943 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_port = current_host_and_port if property[:os_by_host][host_port] os_by_host = property[:os_by_host][host_port] 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_port] = os_by_host end os_by_host end private # put this in a module for better reuse def current_host_and_port if SpecInfra.configuration.ssh [SpecInfra.configuration.ssh.host, SpecInfra.configuration.ssh.options[:port]] else ['localhost', nil] end end end end end
Version data entries
25 entries across 25 versions & 1 rubygems