hotdog 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/hotdog/commands/pssh.rb +9 -1
- data/lib/hotdog/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a977853c554635cda43f1247c7c2a10264c343ce
|
4
|
+
data.tar.gz: f9dbf44744c041c8574e9b1bc384dd080a66848e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6826283bbbf10a5dba85bc85769b4247bc3a0793dd62794a243ca36f8d167f678b4e08216d82556f19cc5ab0669e8360aefcf52f08b440250d686f20ed83e7f
|
7
|
+
data.tar.gz: 6860eff5f70b693c4288fcd09ea43e6e26d9316d1f40364b00c6e1e5a378c493e339d2d09a290ddb0b050961495f39ca6b9b4c6246708ad12647216846b5dcb5
|
data/lib/hotdog/commands/pssh.rb
CHANGED
@@ -34,6 +34,8 @@ module Hotdog
|
|
34
34
|
ssh_option[:max_parallelism] = n
|
35
35
|
end
|
36
36
|
|
37
|
+
use_color = STDOUT.tty?
|
38
|
+
|
37
39
|
search_args = []
|
38
40
|
optparse.order!(args) {|search_arg| search_args.push(search_arg) }
|
39
41
|
expression = search_args.join(" ").strip
|
@@ -79,6 +81,12 @@ module Hotdog
|
|
79
81
|
|
80
82
|
threads = ssh_option[:max_parallelism] || addresses.size
|
81
83
|
stats = Parallel.map(addresses, in_threads: threads) do |address,name|
|
84
|
+
if use_color
|
85
|
+
header = "\e[0;36m#{name}\e[00m"
|
86
|
+
else
|
87
|
+
header = name
|
88
|
+
end
|
89
|
+
|
82
90
|
c = cmdline.dup
|
83
91
|
if user
|
84
92
|
c << (user + "@" + address)
|
@@ -90,7 +98,7 @@ module Hotdog
|
|
90
98
|
|
91
99
|
IO.popen([*c, in: :close, err: [:child, :out]]) do |io|
|
92
100
|
io.each_line {|line|
|
93
|
-
STDOUT.write "#{
|
101
|
+
STDOUT.write "#{header}: #{line}"
|
94
102
|
}
|
95
103
|
end
|
96
104
|
$?.success? # $? is thread-local variable
|
data/lib/hotdog/version.rb
CHANGED