Class: PEBuild::Cap::DetectInstaller::POSIX Abstract
- Defined in:
- lib/pe_build/cap/detect_installer/posix.rb
Overview
This class is abstract.
Provide an abstract base class for detecting the installer name on POSIX systems.
Instance Method Summary collapse
- #arch ⇒ Object
- #detect ⇒ Object
- #ext ⇒ Object
-
#name ⇒ String
abstract
The name of the distribution.
-
#release_file ⇒ String
abstract
The file to use as the release file for the guest.
-
#release_file_format ⇒ Regexp
abstract
A regular expression with one capture that parses the distro version.
-
#supported_releases ⇒ Array<String>
abstract
All supported releases for the distribution.
Methods inherited from Base
Constructor Details
This class inherits a constructor from PEBuild::Cap::DetectInstaller::Base
Instance Method Details
#arch ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/pe_build/cap/detect_installer/posix.rb', line 36 def arch results = execute_command("uname -m") unless results[:retval] == 0 raise PEBuild::Cap::DetectInstaller::DetectFailed, :name => @machine.name, :error => "Could not run 'uname -m' on #{@machine.name}: got #{results[:stderr]}" end content = results[:stdout] content = 'i386' if content.match /i\d86/ content end |
#detect ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/pe_build/cap/detect_installer/posix.rb', line 24 def detect dist_version = parse_release_file unless supported_releases.include? dist_version raise PEBuild::Cap::DetectInstaller::DetectFailed, :name => @machine.name, :error => "#{self.class.name} release #{dist_version} not supported" end "puppet-enterprise-#{@version}-#{name}-#{dist_version}-#{arch}.#{ext}" end |
#ext ⇒ Object
52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/pe_build/cap/detect_installer/posix.rb', line 52 def ext # Posix release versions of Puppet Enterprise are packaged as .tar.gz # files. Pre-release builds are not gzip'd. Select a default extension # accordingly. As usual, for exceptional circumstances it's always possible # to specify an explicit filename rather than relying on the # detect_installer capability. if @version =~ /^\d+\.\d+\.\d+$/ 'tar.gz' else 'tar' end end |
#name ⇒ String
This method is abstract.
Returns The name of the distribution.
|
# File 'lib/pe_build/cap/detect_installer/posix.rb', line 8
|
#release_file ⇒ String
This method is abstract.
Returns The file to use as the release file for the guest.
|
# File 'lib/pe_build/cap/detect_installer/posix.rb', line 12
|
#release_file_format ⇒ Regexp
This method is abstract.
Returns A regular expression with one capture that parses the distro version.
|
# File 'lib/pe_build/cap/detect_installer/posix.rb', line 16
|
#supported_releases ⇒ Array<String>
This method is abstract.
Returns All supported releases for the distribution.
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/pe_build/cap/detect_installer/posix.rb', line 24 def detect dist_version = parse_release_file unless supported_releases.include? dist_version raise PEBuild::Cap::DetectInstaller::DetectFailed, :name => @machine.name, :error => "#{self.class.name} release #{dist_version} not supported" end "puppet-enterprise-#{@version}-#{name}-#{dist_version}-#{arch}.#{ext}" end |