Class: Packer::Output::Version

Inherits:
MachineReadable show all
Defined in:
lib/packer/output/version.rb

Overview

Represents the output from packer version.

Instance Method Summary collapse

Methods inherited from MachineReadable

#ui_messages

Methods inherited from Base

#initialize, #stderr, #stdout

Constructor Details

This class inherits a constructor from Packer::Output::Base

Instance Method Details

#versionString

The version of Packer running, only including the major, minor, and patch versions.

Returns:

  • (String)


11
12
13
14
# File 'lib/packer/output/version.rb', line 11

def version
  msgs = select_messages('version')
  msgs[0][3]
end

#version_commitString

The SHA1 of the Git commit that build this version of Packer.

Returns:

  • (String)


19
20
21
22
# File 'lib/packer/output/version.rb', line 19

def version_commit
  msgs = select_messages('version-commit')
  msgs[0][3]
end

#version_prereleaseString

The prerelease tag (if any) for the running version of packer.

Returns:

  • (String)


27
28
29
30
# File 'lib/packer/output/version.rb', line 27

def version_prerelease
  msgs = select_messages('version-prelease')
  msgs[0][3]
end