Class: Packer::Output::Build
- Inherits:
-
MachineReadable
- Object
- Base
- MachineReadable
- Packer::Output::Build
- Defined in:
- lib/packer/output/build.rb
Overview
Represents the output from packer build.
Instance Method Summary collapse
-
#artifacts ⇒ Array<Packer::Message::Artifact]
Information about an artifact of the targeted item.
-
#errors ⇒ Array<Packer::Message::Error]
Build errors that occurred.
Methods inherited from MachineReadable
Methods inherited from Base
Constructor Details
This class inherits a constructor from Packer::Output::Base
Instance Method Details
#artifacts ⇒ Array<Packer::Message::Artifact]
Information about an artifact of the targeted item.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/packer/output/build.rb', line 10 def artifacts afcts = [] afct ||= Packer::Message::Artifact.new ('artifact').each do |fields| afct. ||= fields[0] afct.target ||= fields[1] afct.type ||= 'artifact' afct.artifact_index ||= fields[3] case fields[4] when 'builder-id' afct.builder_id = fields[5] when 'end' afcts << afct afct = Packer::Message::Artifact.new when 'file' afct.files ||= [] afct.files << Packer::Message::ArtifactFile.from_fields(fields) when 'files-count' next when 'id' afct.id = fields[5] when 'nil' afct.nil = true when 'string' afct.string = fields[5] end end afcts end |
#errors ⇒ Array<Packer::Message::Error]
Build errors that occurred
46 47 48 |
# File 'lib/packer/output/build.rb', line 46 def errors ('error').map { |fields| Packer::Message::Error.from_fields(fields) } end |