Sha256: 56568bc4eb8fdc226444e43000adedfc9288200954c817cf7abf2149dee0b4a4

Contents?: true

Size: 898 Bytes

Versions: 39

Compression:

Stored size: 898 Bytes

Contents

require_relative 'posix'

# Facts implementation for SUSE guests
#
# @since 0.13.0
class PEBuild::Cap::Facts::SUSE < PEBuild::Cap::Facts::POSIX

  # (see PEBuild::Cap::Facts::Base#os_info)
  #
  # Returns `family` as `SUSE` and `name` as `SLES`.
  #
  # @see PEBuild::Cap::Facts::Base#os_info
  def os_info
    {
      'name'   => 'SLES',
      'family' => 'SUSE'
    }
  end

  # (see PEBuild::Cap::Facts::Base#release_info)
  #
  # Reads `/etc/SuSE-release` and generates a `full` version along with
  # `major` and `minor` components.
  #
  # @see PEBuild::Cap::Facts::Base#release_info
  def release_info
    release_file = sudo('cat /etc/SuSE-release')[:stdout]
    major = release_file.match(/VERSION\s*=\s*(\d+)/)[1]
    minor = release_file.match(/PATCHLEVEL\s*=\s*(\d+)/)[1]

    {
      'major' => major,
      'minor' => minor,
      'full'  => [major, minor].join('.')
    }
  end

end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
vagrant-pe_build-0.19.2 lib/pe_build/cap/facts/suse.rb
vagrant-pe_build-0.19.1 lib/pe_build/cap/facts/suse.rb
vagrant-pe_build-0.19.0 lib/pe_build/cap/facts/suse.rb
vagrant-pe_build-0.18.2 lib/pe_build/cap/facts/suse.rb
vagrant-pe_build-0.18.1 lib/pe_build/cap/facts/suse.rb
vagrant-pe_build-0.18.0 lib/pe_build/cap/facts/suse.rb
vagrant-pe_build-0.17.14 lib/pe_build/cap/facts/suse.rb
vagrant-pe_build-0.17.13 lib/pe_build/cap/facts/suse.rb
vagrant-pe_build-0.17.12 lib/pe_build/cap/facts/suse.rb
vagrant-pe_build-0.17.11 lib/pe_build/cap/facts/suse.rb
vagrant-pe_build-0.17.10 lib/pe_build/cap/facts/suse.rb
vagrant-pe_build-0.17.9 lib/pe_build/cap/facts/suse.rb
vagrant-pe_build-0.17.8 lib/pe_build/cap/facts/suse.rb
vagrant-pe_build-0.17.7 lib/pe_build/cap/facts/suse.rb
vagrant-pe_build-0.17.6 lib/pe_build/cap/facts/suse.rb
vagrant-pe_build-0.17.5 lib/pe_build/cap/facts/suse.rb
vagrant-pe_build-0.17.4 lib/pe_build/cap/facts/suse.rb
vagrant-pe_build-0.17.3 lib/pe_build/cap/facts/suse.rb
vagrant-pe_build-0.17.2 lib/pe_build/cap/facts/suse.rb
vagrant-pe_build-0.17.1 lib/pe_build/cap/facts/suse.rb