Class AutomateIt::PlatformManager::LSB
In: lib/automateit/platform_manager/lsb.rb
Parent: AutomateIt::PlatformManager::Uname

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.

Methods

Constants

LSB_RELEASE = "lsb_release"

Protected Instance methods

Parses LSB data into a hash.

[Source]

# File lib/automateit/platform_manager/lsb.rb, line 41
  def _parse_lsb_release_data(data)
    data.scan(/^([^:]+):\s+([^\n]+)/).inject({}){|s,v| s[v.first] = v.last; s}
  end

Returns the LSB data for this platform‘s Distributor and ID

[Source]

# File lib/automateit/platform_manager/lsb.rb, line 32
  def _read_lsb_release_data
    # TODO Consider parsing files directly to avoid the overhead of this command.
    #
    # Do NOT use 'lsb_release -a' because this takes a few seconds. Telling
    # 'lsb_release' which fields we want makes it much faster.
    `"#{LSB_RELEASE}" --release --id`
  end

[Validate]