Sha256: 509ecf5f89d31ed359aaf44905ef74a4c204b6e48eb161b63da6ef4f436353cf

Contents?: true

Size: 779 Bytes

Versions: 38

Compression:

Stored size: 779 Bytes

Contents

require_relative 'base'

# Base class for retrieving facts from POSIX
#
# @abstract Subclass and override {#os_info} and {#release_info} to implement
#   for a particular POSIX system.
#
# @since 0.13.0
class PEBuild::Cap::Facts::POSIX < PEBuild::Cap::Facts::Base

  # (see PEBuild::Cap::Facts::Base#architecture)
  #
  # This method is a concrete implementation which uses `uname -m`.
  #
  # @see PEBuild::Cap::Facts::Base#architecture
  def architecture
    sudo('uname -m')[:stdout]
  end

  private

  def find_puppet
    paths = %w[
      /opt/puppetlabs/bin/puppet
      /opt/puppet/bin/puppet
      /usr/local/bin/puppet
    ]

    paths.each do |path|
      return path if @machine.communicate.test("#{path} --version", :sudo => true)
    end

    return nil
  end

end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
vagrant-pe_build-0.17.0 lib/pe_build/cap/facts/posix.rb
vagrant-pe_build-0.16.0 lib/pe_build/cap/facts/posix.rb
vagrant-pe_build-0.15.6 lib/pe_build/cap/facts/posix.rb
vagrant-pe_build-0.15.5 lib/pe_build/cap/facts/posix.rb
vagrant-pe_build-0.15.4 lib/pe_build/cap/facts/posix.rb
vagrant-pe_build-0.15.3 lib/pe_build/cap/facts/posix.rb
vagrant-pe_build-0.15.1 lib/pe_build/cap/facts/posix.rb
vagrant-pe_build-0.15.0 lib/pe_build/cap/facts/posix.rb
vagrant-pe_build-0.14.2 lib/pe_build/cap/facts/posix.rb
vagrant-pe_build-0.14.1 lib/pe_build/cap/facts/posix.rb
vagrant-pe_build-0.14.0 lib/pe_build/cap/facts/posix.rb
vagrant-pe_build-0.13.7 lib/pe_build/cap/facts/posix.rb
vagrant-pe_build-0.13.6 lib/pe_build/cap/facts/posix.rb
vagrant-pe_build-0.13.5 lib/pe_build/cap/facts/posix.rb
vagrant-pe_build-0.13.4 lib/pe_build/cap/facts/posix.rb
vagrant-pe_build-0.13.3 lib/pe_build/cap/facts/posix.rb
vagrant-pe_build-0.13.2 lib/pe_build/cap/facts/posix.rb
vagrant-pe_build-0.13.1 lib/pe_build/cap/facts/posix.rb