Class: AutomateIt::PlatformManager

Inherits:
AutomateIt::Plugin::Manager show all
Defined in:
lib/automateit/platform_manager.rb

Overview

PlatformManager

The PlatformManager provides a way to query platform identifiers, such as the operating system distribution’s version.

Defined Under Namespace

Classes: BaseDriver, Darwin, Debian, FreeBSD, Gentoo, LSB, OpenBSD, Struct, SunOS, Uname, Windows

Constant Summary

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 AutomateIt::Plugin::Manager

#drivers

Attributes inherited from Common

#interpreter

Instance Method Summary collapse

Methods inherited from AutomateIt::Plugin::Manager

#[], abstract_manager, alias_methods, #available?, #default, #default=, #dispatch, #dispatch_safely, #dispatch_safely_to, #dispatch_to, driver_classes, #driver_for, #driver_suitability_levels_for, inherited, #instantiate_drivers, #setup

Methods inherited from AutomateIt::Plugin::Base

#setup, #token, token

Methods inherited from Common

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

Constructor Details

This class inherits a constructor from AutomateIt::Common

Instance Method Details

#query(search) ⇒ Object

Query the search field. The search can either be a key or a set of keys separated by “#” signs.

Examples:

query(:os) # => "linux"
query("arch") # => "i686"
query("os#arch") # => "linux_i686"
query("os#arch#distro#release") # => "linux_i686_ubuntu_6.06"

Fields that may be provided by drivers:

  • :arch – Hardware architecture, e.g., “i686”

  • :os – Operating system, e.g., “linux”

  • :distro – Operating system distribution, e.g., “ubuntu”

  • :release – Operating system distribution release, e.g., “6.06”



20
# File 'lib/automateit/platform_manager.rb', line 20

def query(search) dispatch(search) end

#single_vendor?Boolean

Is this a single-vendor operating system? E.g., Windows is, while Linux isn’t. This method helps the TagManager determine how to name tags. A single-vendor product uses the “os#release” format (e.g., “windows_xp”), while a multi-vendor product uses a “distro#release” format (“ubuntu_6.06”).

Returns:

  • (Boolean)


27
# File 'lib/automateit/platform_manager.rb', line 27

def single_vendor?() dispatch() end

#tagsObject

Return an array of tags for this platform.



30
# File 'lib/automateit/platform_manager.rb', line 30

def tags() dispatch() end