Sha256: c195c6430788ea1c945873660fd1a47f4d8a4cebecd0c54a5cfab79a6bb5642e

Contents?: true

Size: 906 Bytes

Versions: 39

Compression:

Stored size: 906 Bytes

Contents

require_relative 'posix'

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

  # (see PEBuild::Cap::Facts::Base#os_info)
  #
  # Currently returns `family` as `RedHat`.
  # @todo Implement `name` detection (RHEL, CentOS, Sci. Linux, etc.).
  #
  # @see PEBuild::Cap::Facts::Base#os_info
  def os_info
    {
      'family' => 'RedHat'
    }
  end

  # (see PEBuild::Cap::Facts::Base#release_info)
  #
  # Reads `/etc/redhat-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/redhat-release')[:stdout]
    version = release_file.match(/release (\d+\.\d+)/)[1]

    {
      'major' => version.split('.', 2)[0],
      'minor' => version.split('.', 2)[1],
      'full'  => version
    }
  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/redhat.rb
vagrant-pe_build-0.19.1 lib/pe_build/cap/facts/redhat.rb
vagrant-pe_build-0.19.0 lib/pe_build/cap/facts/redhat.rb
vagrant-pe_build-0.18.2 lib/pe_build/cap/facts/redhat.rb
vagrant-pe_build-0.18.1 lib/pe_build/cap/facts/redhat.rb
vagrant-pe_build-0.18.0 lib/pe_build/cap/facts/redhat.rb
vagrant-pe_build-0.17.14 lib/pe_build/cap/facts/redhat.rb
vagrant-pe_build-0.17.13 lib/pe_build/cap/facts/redhat.rb
vagrant-pe_build-0.17.12 lib/pe_build/cap/facts/redhat.rb
vagrant-pe_build-0.17.11 lib/pe_build/cap/facts/redhat.rb
vagrant-pe_build-0.17.10 lib/pe_build/cap/facts/redhat.rb
vagrant-pe_build-0.17.9 lib/pe_build/cap/facts/redhat.rb
vagrant-pe_build-0.17.8 lib/pe_build/cap/facts/redhat.rb
vagrant-pe_build-0.17.7 lib/pe_build/cap/facts/redhat.rb
vagrant-pe_build-0.17.6 lib/pe_build/cap/facts/redhat.rb
vagrant-pe_build-0.17.5 lib/pe_build/cap/facts/redhat.rb
vagrant-pe_build-0.17.4 lib/pe_build/cap/facts/redhat.rb
vagrant-pe_build-0.17.3 lib/pe_build/cap/facts/redhat.rb
vagrant-pe_build-0.17.2 lib/pe_build/cap/facts/redhat.rb
vagrant-pe_build-0.17.1 lib/pe_build/cap/facts/redhat.rb