Class: AutomateIt::PlatformManager::LSB

Inherits:
Uname show all
Defined in:
lib/automateit/platform_manager/lsb.rb

Overview

PlatformManager::LSB

A PlatformManager driver for LSB (Linux Standards Base) systems. The platform doesn’t actually need to be Linux, but simply has to provide an lsb_release command.

Constant Summary collapse

LSB_RELEASE =
"lsb_release"

Constants inherited from AutomateIt::Plugin::Driver

AutomateIt::Plugin::Driver::BASE_DRIVER_NAME

Constants included from Constants

Constants::HELPERS_DIR, Constants::INSTALL_DIR, Constants::PERROR, Constants::PEXEC, Constants::PNOTE, Constants::WARNING_BOILERPLATE

Instance Attribute Summary

Attributes inherited from Struct

#key_aliases

Attributes inherited from AutomateIt::Plugin::Driver

#manager

Attributes inherited from Common

#interpreter

Instance Method Summary collapse

Methods inherited from Struct

#query, #single_vendor?, #tags

Methods inherited from AutomateIt::Plugin::Driver

abstract_driver, #available?, base_driver, base_driver?, depends_on, inherited, manager_token

Methods inherited from AutomateIt::Plugin::Base

#token, token

Methods inherited from Common

#initialize, #log, #nitpick, #noop, #noop=, #noop?, #preview, #preview=, #preview?, #preview_for, #superuser?, #writing, #writing=, #writing?

Constructor Details

This class inherits a constructor from AutomateIt::Common

Instance Method Details

#setup(opts = {}) ⇒ Object

:nodoc:



16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/automateit/platform_manager/lsb.rb', line 16

def setup(opts={}) # :nodoc:
  super(opts) # Rely on Uname to set :os and :arch
  @struct[:distro]  ||= @@struct_cache[:distro]
  @struct[:release] ||= @@struct_cache[:release]
  if available?
    unless @struct[:distro] and @struct[:release]
      hash = _parse_lsb_release_data(_read_lsb_release_data)
      @struct[:distro]  ||= @@struct_cache[:distro]  ||= hash["Distributor ID"].to_s.downcase
      @struct[:release] ||= @@struct_cache[:release] ||= hash["Release"].to_s.downcase
    end
  end
end

#suitability(method, *args) ⇒ Object

:nodoc:



11
12
13
14
# File 'lib/automateit/platform_manager/lsb.rb', line 11

def suitability(method, *args) # :nodoc:
  # Level must be greater than Uname and Debian
  return available? ? 4 : 0
end