class Specinfra::Backend::Base
Public Class Methods
instance()
click to toggle source
# File lib/specinfra/backend/base.rb, line 7 def self.instance @instance ||= self.new end
new(config = {})
click to toggle source
# File lib/specinfra/backend/base.rb, line 11 def initialize(config = {}) @config = config end
Public Instance Methods
command()
click to toggle source
# File lib/specinfra/backend/base.rb, line 34 def command CommandFactory.new(os_info) end
get_config(key)
click to toggle source
# File lib/specinfra/backend/base.rb, line 15 def get_config(key) @config[key] || Specinfra.configuration.send(key) end
host_inventory()
click to toggle source
# File lib/specinfra/backend/base.rb, line 38 def host_inventory @inventory ||= HostInventory.new(self) end
os_info()
click to toggle source
# File lib/specinfra/backend/base.rb, line 23 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
set_config(key, value)
click to toggle source
# File lib/specinfra/backend/base.rb, line 19 def set_config(key, value) @config[key] = value end
set_example(e)
click to toggle source
# File lib/specinfra/backend/base.rb, line 42 def set_example(e) @example = e end
stderr_handler=(block)
click to toggle source
# File lib/specinfra/backend/base.rb, line 50 def stderr_handler=(block) @stderr_handler = block end
stdout_handler=(block)
click to toggle source
# File lib/specinfra/backend/base.rb, line 46 def stdout_handler=(block) @stdout_handler = block end