Class: PEBuild::Config::Global

Inherits:
Object
  • Object
show all
Includes:
PEBuild::ConfigDefault
Defined in:
lib/pe_build/config/global.rb

Direct Known Subclasses

PEBootstrap

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeGlobal

Returns a new instance of Global.



48
49
50
51
52
53
54
55
# File 'lib/pe_build/config/global.rb', line 48

def initialize
  @download_root = UNSET_VALUE
  @version       = UNSET_VALUE
  @version_file  = UNSET_VALUE
  @series        = UNSET_VALUE
  @suffix        = UNSET_VALUE
  @filename      = UNSET_VALUE
end

Instance Attribute Details

#download_rootString

Returns The root URI from which to download packages. The URI scheme must be one of the values listed in Transfer::IMPLEMENTATIONS.

Returns:

  • (String)

    The root URI from which to download packages. The URI scheme must be one of the values listed in Transfer::IMPLEMENTATIONS.

Since:

  • 0.1.0



12
13
14
# File 'lib/pe_build/config/global.rb', line 12

def download_root
  @download_root
end

#filenameString

Returns The exact name of the PE installer archive. If missing, a name will be constructed from #version.

Returns:

  • (String)

    The exact name of the PE installer archive. If missing, a name will be constructed from #version.

Since:

  • 0.1.0



46
47
48
# File 'lib/pe_build/config/global.rb', line 46

def filename
  @filename
end

#seriesString

Returns The release series of PE. Completely optional and currently has no effect other than being an interpolation token available for use in download_root.

Returns:

  • (String)

    The release series of PE. Completely optional and currently has no effect other than being an interpolation token available for use in download_root.

Since:

  • 0.9.0



34
35
36
# File 'lib/pe_build/config/global.rb', line 34

def series
  @series
end

#suffixString

Returns The distribution specifix suffix of the Puppet Enterprise installer to use.

Returns:

  • (String)

    The distribution specifix suffix of the Puppet Enterprise installer to use.

Since:

  • 0.1.0



40
41
42
# File 'lib/pe_build/config/global.rb', line 40

def suffix
  @suffix
end

#versionString

Returns The version of PE to install. Must conform to x.y.x[-optional-arbitrary-stuff]. Used to determine the name of the PE installer archive if filename is unset.

Returns:

  • (String)

    The version of PE to install. Must conform to x.y.x[-optional-arbitrary-stuff]. Used to determine the name of the PE installer archive if filename is unset.

Since:

  • 0.1.0



19
20
21
# File 'lib/pe_build/config/global.rb', line 19

def version
  @version
end

#version_fileString, URI

Returns A fully-qualified URI or a path relative to download_root. The contents of this file will be read and used to Specify version.

Returns:

  • (String, URI)

    A fully-qualified URI or a path relative to download_root. The contents of this file will be read and used to Specify version.

Since:

  • 0.9.0



26
27
28
# File 'lib/pe_build/config/global.rb', line 26

def version_file
  @version_file
end

Instance Method Details

#finalize!Object



59
60
61
62
63
64
65
66
# File 'lib/pe_build/config/global.rb', line 59

def finalize!
  set_default :@version, nil
  set_default :@version_file, nil
  set_default :@series, nil
  set_default :@suffix, :detect
  set_default :@download_root, nil
  set_default :@filename, nil
end

#validate(machine) ⇒ Object



68
69
70
71
72
73
74
75
# File 'lib/pe_build/config/global.rb', line 68

def validate(machine)
  errors = []

  validate_version(errors, machine)
  validate_download_root(errors, machine)

  {"PE build global config" => errors}
end