docker_toolkit 0.1.19 → 0.1.20

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: bc743640766da2fbed5f66e532fa6a41b1581d731d65e32cda14bfccff399491
4
- data.tar.gz: 44004a6a32b55a6c4cb7d764dd03d4c4961c1b38389811c64f688523f161b090
3
+ metadata.gz: 0bf86f05ad92b1bc8a9d2c716f4d43ed623822704d6b2f7f2cb1cd450bba045b
4
+ data.tar.gz: 633486188aa3b061625e24d3e8b4b854a9e59b7ac2ca773a041ef6fef0b45c1c
5
5
  SHA512:
6
- metadata.gz: b03174458ba29be5cbefa222aab71b565ce0cdea16ba3a4e3bc188aa849e14eea7d251e0a609660b1c5575e0a4edc9c3dfd5008a4027944af10308f7f856285a
7
- data.tar.gz: 8524574068f9289bbbd377f11b0877fbe8994b5e2eae2b1ce78bcd90059703bd56e8d8bb7c1204ba068646273fc7f704cb249a0bbadf749e1b3ab6e931dc56ea
6
+ metadata.gz: 1b228ca1cee6f826eadf20eb7fc8b1eeae3dd7a50b5e2e636e130904a5811107fde91f211324378510113b2ffb9bfdd39926a240e5089c51b18dab55eeaf1211
7
+ data.tar.gz: 8cacc284e037a69dec8f61046c9b85cfdd0c2e02ca4399b6d4094d15293aff4bd4deed4b958b83ce564442a8bf0f11b049ad753ec44d0d01c042cc789e0dfa3e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- docker_toolkit (0.1.19)
4
+ docker_toolkit (0.1.20)
5
5
  diplomat
6
6
  dotenv
7
7
  json
@@ -1,5 +1,5 @@
1
1
  module DockerToolkit
2
2
 
3
- VERSION = '0.1.19'.freeze
3
+ VERSION = '0.1.20'.freeze
4
4
 
5
5
  end
@@ -30,7 +30,18 @@ module DockerToolkit
30
30
  rescue StandardError
31
31
  nil
32
32
  end
33
- ::Process.kill 'TERM', meta[:process].pid
33
+ if meta[:termcmd].is_a? String
34
+ log "Terminating by #{meta[:termcmd].gsub('%PID%', meta[:process].pid.to_s)}..."
35
+ output = `#{meta[:termcmd].gsub('%PID%', meta[:process].pid.to_s)}`
36
+ if $?.success?
37
+ log "ok: #{output}"
38
+ else
39
+ log "Error: #{output}"
40
+ ::Process.kill 'TERM', meta[:process].pid
41
+ end
42
+ else
43
+ ::Process.kill 'TERM', meta[:process].pid
44
+ end
34
45
  end
35
46
 
36
47
  terminating.each do |meta|
@@ -75,6 +86,13 @@ module DockerToolkit
75
86
  end
76
87
 
77
88
  def add(*cmd)
89
+ options = cmd.last
90
+ if options.is_a? Hash
91
+ cmd.pop
92
+ else
93
+ options = {}
94
+ end
95
+
78
96
  cmd = cmd.flatten.map{|c| c.to_s.strip }.reject(&:empty?)
79
97
  process = ChildProcess.build(*cmd)
80
98
 
@@ -90,7 +108,8 @@ module DockerToolkit
90
108
  process: process,
91
109
  stdout: rout,
92
110
  stderr: rerr,
93
- stdin: process.io.stdin
111
+ stdin: process.io.stdin,
112
+ termcmd: options[:termcmd],
94
113
  }
95
114
 
96
115
  @threads << Thread.new(meta[:stdout], STDOUT) do |io, out|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docker_toolkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.19
4
+ version: 0.1.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Godko Ivan
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-08-22 00:00:00.000000000 Z
12
+ date: 2018-09-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: diplomat
@@ -161,7 +161,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
161
161
  version: '0'
162
162
  requirements: []
163
163
  rubyforge_project:
164
- rubygems_version: 2.7.3
164
+ rubygems_version: 2.7.7
165
165
  signing_key:
166
166
  specification_version: 4
167
167
  summary: Helper scripts for work with docker and consul