hashipack 0.1.7 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 87fd41d558d6ee4d58c99aa4e2a33eeffc370a03aef72e39ff573d746378b5e2
4
- data.tar.gz: b0fd96379a70bd93ee8fbf8cde578aa2aa3d9dac4d942edda84a40e18220d7ba
3
+ metadata.gz: a87321f217996af0552f2572e3fa9ef1f641bf90739a7f3f0e660f5c55966d96
4
+ data.tar.gz: 8e5d4888e4f5d9628333dc0fd2803549c7af38f61f3fa1add68b64b36d47aa50
5
5
  SHA512:
6
- metadata.gz: d076feaf4992bf9bdd0f98c5a4e531e1c2c7b71ba658557c14fa0f831340fd18889466e8bbe2cc156a0cb63d4c729304f81987f4d24490cdb1719d4e340aac9b
7
- data.tar.gz: b35accd2f1f4d7b4009c953c0995882a59e3ac82361d196863a7c0d456a0a7c108c7187c45ff3fa85437042924c88c872c8ecbe78054a67cc73a16482686f2b9
6
+ metadata.gz: 3e7920bd5b7a750e7600c6f132bbe44e7e02c347d6c9a41873f4528947a62cc0eb416215966caa5511b04e5925407aacd54a1c71061c09e1de2d51ef6989ccbb
7
+ data.tar.gz: e56c1c34631b7c4dc92e5d14d2ef7f06e04670654658bef32355749c4f6df1770f951cc4b4b365dc3899a099aa662928c6e44a4035d1b3f5854b35aff6e0cb77
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hashipack (0.1.7)
4
+ hashipack (0.1.9)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -3,10 +3,11 @@ require 'open3'
3
3
 
4
4
  module Hashipack
5
5
  class Client
6
- def build(path, on_output: lambda {}, on_progress: lambda {}, estimated_duration: 300, debug: false)
6
+ def build(path, on_output: lambda {}, on_progress: lambda {}, estimated_duration: 300, debug: false, machine_readable: true, additional_options: '')
7
7
  directory, filename = File.split(path)
8
8
  debug_option = debug ? '-debug' : ''
9
- command = "packer -machine-readable build #{debug_option} #{filename}"
9
+ machine_readable_option = machine_readable ? '-machine-readable' : ''
10
+ command = "packer build #{machine_readable_option} #{debug_option} #{additional_options} #{filename}"
10
11
 
11
12
  initial_timestamp = 99999999999
12
13
  last_timestamp = 0
@@ -34,6 +35,8 @@ module Hashipack
34
35
  artifacts[message.number] ||= Artifact.new
35
36
  artifacts[message.number].append_info(message.key, message.value)
36
37
 
38
+ elsif message.type == :other
39
+ on_output.call(message.text)
37
40
  end
38
41
  end
39
42
 
@@ -7,8 +7,7 @@ module Hashipack
7
7
  elsif msg.artifact?
8
8
  ArtifactMessage.new(line)
9
9
  else
10
- puts "Ignoring unknown message type #{msg.type}"
11
- Message.new(line)
10
+ OtherMessage.new(line)
12
11
  end
13
12
  end
14
13
 
@@ -45,6 +44,16 @@ module Hashipack
45
44
  end
46
45
  end
47
46
 
47
+ class OtherMessage < Message
48
+ def type
49
+ :other
50
+ end
51
+
52
+ def text
53
+ @parts.join(',')
54
+ end
55
+ end
56
+
48
57
  class ArtifactMessage < Message
49
58
  def type
50
59
  :artifact
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Hashipack
4
- VERSION = "0.1.7"
4
+ VERSION = "0.1.9"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hashipack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lukas_Skywalker