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.17.0 lib/pe_build/cap/facts/redhat.rb
vagrant-pe_build-0.16.0 lib/pe_build/cap/facts/redhat.rb
vagrant-pe_build-0.15.6 lib/pe_build/cap/facts/redhat.rb
vagrant-pe_build-0.15.5 lib/pe_build/cap/facts/redhat.rb
vagrant-pe_build-0.15.4 lib/pe_build/cap/facts/redhat.rb
vagrant-pe_build-0.15.3 lib/pe_build/cap/facts/redhat.rb
vagrant-pe_build-0.15.1 lib/pe_build/cap/facts/redhat.rb
vagrant-pe_build-0.15.0 lib/pe_build/cap/facts/redhat.rb
vagrant-pe_build-0.14.2 lib/pe_build/cap/facts/redhat.rb
vagrant-pe_build-0.14.1 lib/pe_build/cap/facts/redhat.rb
vagrant-pe_build-0.14.0 lib/pe_build/cap/facts/redhat.rb
vagrant-pe_build-0.13.7 lib/pe_build/cap/facts/redhat.rb
vagrant-pe_build-0.13.6 lib/pe_build/cap/facts/redhat.rb
vagrant-pe_build-0.13.5 lib/pe_build/cap/facts/redhat.rb
vagrant-pe_build-0.13.4 lib/pe_build/cap/facts/redhat.rb
vagrant-pe_build-0.13.3 lib/pe_build/cap/facts/redhat.rb
vagrant-pe_build-0.13.2 lib/pe_build/cap/facts/redhat.rb
vagrant-pe_build-0.13.1 lib/pe_build/cap/facts/redhat.rb
vagrant-pe_build-0.13.0 lib/pe_build/cap/facts/redhat.rb