singel 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/bin/singel +1 -0
  3. data/lib/executor.rb +13 -4
  4. data/singel.gemspec +1 -1
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1ee381a02993b614f5755e85d1f245423a4b0433
4
- data.tar.gz: c42b7f3206eef7232508b63031fdbc39feed355f
3
+ metadata.gz: b044c6a0f921fc3cd684571e5be6c2dd48e7788b
4
+ data.tar.gz: 7d5117ca9e6e7a4d9d7f7248d3aca4bc053f877c
5
5
  SHA512:
6
- metadata.gz: d0cbeb4027d312aa825eabfd05e1be3d0728b2f65ff2b4cf4c1b7b58bc49ad7c0e3902b77b45a0647a0e7da970152c640a1ef332351878c24545b47e860e9226
7
- data.tar.gz: 0e54f2c167cb5b7452128995a1ed31254eddd99823d92edd993e1ca4c54363dbe0e2e9794b318c63ceeeb552be328a700f8e31fb4f008cf4c83a51f7be1aaa3d
6
+ metadata.gz: 47c2f627068266abe8fa919e4264aab32829b9335ddcbbb3c982a5c6fa70024c3f795e7b30e94328b5578c5d86cbace13345a3773f94bc8a43cad00d875ce134
7
+ data.tar.gz: 23c68854c622fc10268c5e736ea1ade9117ef586ee6f8b422464b3d9846505b73d838813232da42d29c1097395d5efd706f73158e76e7c3deab76c6f386ea5a7
data/bin/singel CHANGED
@@ -24,6 +24,7 @@ begin
24
24
  require 'English'
25
25
  require 'aws-sdk-core'
26
26
  require 'json'
27
+ require 'pty'
27
28
  require 'orchestrator.rb'
28
29
  require 'executor.rb'
29
30
  require 'uploader.rb'
@@ -39,15 +39,24 @@ class PackerExecutor
39
39
  end
40
40
  end
41
41
 
42
+ def build
43
+ puts "Building #{File.basename(@file_path, '.json')}:".to_green
44
+ stream_cmd("packer build #{build_options} #{@file_path}")
45
+ end
46
+
42
47
  # specify the builders if any were passed
43
48
  def build_options
44
49
  "-only=#{@specified_builders.join(',')}" unless @specified_builders.empty?
45
50
  end
46
51
 
47
- def build
48
- puts "Building #{File.basename(@file_path, '.json')}:".to_green
49
- IO.popen("packer build #{build_options} #{@file_path}") do |cmd|
50
- cmd.each { |line| puts line }
52
+ def stream_cmd(command)
53
+ PTY.spawn(command) do |r, _w, _pid|
54
+ begin
55
+ r.each { |line| print line; }
56
+ rescue Errno::EIO
57
+ end
51
58
  end
59
+ rescue PTY::ChildExited
60
+ puts 'The child process exited!'
52
61
  end
53
62
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'singel'
3
- s.version = '0.2.0'
3
+ s.version = '0.2.1'
4
4
  s.date = Date.today.to_s
5
5
  s.platform = Gem::Platform::RUBY
6
6
  s.extra_rdoc_files = ['README.md', 'LICENSE']
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: singel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Smith