Sha256: b060872c23989784dae11713c2c027b0a856d21f641d40163bf4dfe382a45b8f
Contents?: true
Size: 935 Bytes
Versions: 51
Compression:
Stored size: 935 Bytes
Contents
require 'singleton' require 'specinfra/command_result' module Specinfra module Backend class Base def self.instance @instance ||= self.new end def initialize(config = {}) @config = config end def get_config(key) @config[key] || Specinfra.configuration.send(key) end def set_config(key, value) @config[key] = value end def os_info return @os_info if @os_info Specinfra::Helper::DetectOs.subclasses.each do |klass| if @os_info = klass.new(self).detect @os_info[:arch] ||= self.run_command('uname -m').stdout.strip return @os_info end end end def command CommandFactory.new(os_info) end def host_inventory @inventory ||= HostInventory.new(self) end def set_example(e) @example = e end end end end
Version data entries
51 entries across 51 versions & 1 rubygems