ztk 1.17.4 → 1.18.0
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 +8 -8
- data/lib/ztk/ansi.rb +21 -0
- data/lib/ztk/parallel.rb +3 -3
- data/lib/ztk/ssh/core.rb +2 -2
- data/lib/ztk/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZTdlMWFhZjVjYjllYjMzMjExOWZlNDI5ZjM1OWE1Mjk0Nzc3ZGEyMw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ODg4YWYxMjhiMDg0OTgzZWNlOTcxMzRhOTM4YmYzZWJkNWYwZDU0Nw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZjYyN2YzNjJmYzQ4YzI3M2FlOTE3NWE1NjRhNDhjMjNkOTM2Njg4MDQzZDZk
|
10
|
+
YjhmZmMwZjFkMWNjODcyZjUzOTcxYzE0NDAwZDE4YWY5NTYzOWZkN2FjYzE5
|
11
|
+
ZWRhMGI2Y2I0OGE1NjE5YTZiYzM0ZmY4ZjY2OGE3Y2U5MzMzOTc=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MWViZWEwOWJiZTkzODIyOTYzOTIyMjE2MTYwYTg4ZTNjZGMzZGZjZWVjZjg5
|
14
|
+
Y2E1NDFiYWE1MGFmNmRiZjRjZjc2YzNjMTFmYzA1MmE5OGQ3NDQ2N2M4YzA3
|
15
|
+
NGRiMTE3MjIxNDljNmFkNTA5YWI2NGM1YWZlYzU4ZGFkNmQ1OWQ=
|
data/lib/ztk/ansi.rb
CHANGED
@@ -175,6 +175,27 @@ module ZTK
|
|
175
175
|
end
|
176
176
|
end
|
177
177
|
|
178
|
+
def reset(string=nil, &block)
|
179
|
+
result = Array.new
|
180
|
+
|
181
|
+
result << %(\e[2J)
|
182
|
+
if block_given?
|
183
|
+
result << block.call
|
184
|
+
elsif string.respond_to?(:to_str)
|
185
|
+
result << string.to_str
|
186
|
+
elsif respond_to?(:to_str)
|
187
|
+
result << to_str
|
188
|
+
else
|
189
|
+
return result
|
190
|
+
end
|
191
|
+
|
192
|
+
result.join
|
193
|
+
end
|
194
|
+
|
195
|
+
def goto(x=0, y=0)
|
196
|
+
%(\e[#{x};#{y}H)
|
197
|
+
end
|
198
|
+
|
178
199
|
extend self
|
179
200
|
|
180
201
|
build_ansi_methods(ANSI_COLORS)
|
data/lib/ztk/parallel.rb
CHANGED
@@ -146,7 +146,7 @@ module ZTK
|
|
146
146
|
|
147
147
|
%w( kill term int hup ).map(&:upcase).each do |signal|
|
148
148
|
Signal.trap(signal) do
|
149
|
-
$stderr.puts("SIG#{signal} received by PID##{Process.pid};
|
149
|
+
$stderr.puts("SIG#{signal} received by PID##{Process.pid}; signaling child processes...")
|
150
150
|
|
151
151
|
signal_all(signal)
|
152
152
|
exit!(1)
|
@@ -216,10 +216,10 @@ module ZTK
|
|
216
216
|
# @return [Array<pid, status, data>] An array containing the pid,
|
217
217
|
# status and data returned from the process block. If wait2() fails nil
|
218
218
|
# is returned.
|
219
|
-
def wait
|
219
|
+
def wait(flags=0)
|
220
220
|
config.ui.logger.debug { "wait" }
|
221
221
|
config.ui.logger.debug { "forks(#{@forks.inspect})" }
|
222
|
-
pid, status = (Process.wait2(-1) rescue nil)
|
222
|
+
pid, status = (Process.wait2(-1, flags) rescue nil)
|
223
223
|
|
224
224
|
if !pid.nil? && !status.nil? && !(fork = @forks.select{ |f| f[:pid] == pid }.first).nil?
|
225
225
|
data = (Marshal.load(Base64.decode64(fork[:reader].read.to_s)) rescue nil)
|
data/lib/ztk/ssh/core.rb
CHANGED
@@ -67,8 +67,8 @@ module ZTK
|
|
67
67
|
|
68
68
|
# Attempts to close the gateway session if it is valid.
|
69
69
|
def close_gateway
|
70
|
-
if (!@gateway.nil?
|
71
|
-
config.ui.logger.debug { "gateway object is valid
|
70
|
+
if (!@gateway.nil?)
|
71
|
+
config.ui.logger.debug { "gateway object is valid" }
|
72
72
|
|
73
73
|
begin
|
74
74
|
config.ui.logger.debug { "attempting to shutdown" }
|
data/lib/ztk/version.rb
CHANGED