hashipack 0.1.7 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/hashipack/client.rb +5 -2
- data/lib/hashipack/message.rb +11 -2
- data/lib/hashipack/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a87321f217996af0552f2572e3fa9ef1f641bf90739a7f3f0e660f5c55966d96
|
4
|
+
data.tar.gz: 8e5d4888e4f5d9628333dc0fd2803549c7af38f61f3fa1add68b64b36d47aa50
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e7920bd5b7a750e7600c6f132bbe44e7e02c347d6c9a41873f4528947a62cc0eb416215966caa5511b04e5925407aacd54a1c71061c09e1de2d51ef6989ccbb
|
7
|
+
data.tar.gz: e56c1c34631b7c4dc92e5d14d2ef7f06e04670654658bef32355749c4f6df1770f951cc4b4b365dc3899a099aa662928c6e44a4035d1b3f5854b35aff6e0cb77
|
data/Gemfile.lock
CHANGED
data/lib/hashipack/client.rb
CHANGED
@@ -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
|
-
|
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
|
|
data/lib/hashipack/message.rb
CHANGED
@@ -7,8 +7,7 @@ module Hashipack
|
|
7
7
|
elsif msg.artifact?
|
8
8
|
ArtifactMessage.new(line)
|
9
9
|
else
|
10
|
-
|
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
|
data/lib/hashipack/version.rb
CHANGED