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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 380b4a02d1dd654994f3f1ea4d4a69eef6712967
4
- data.tar.gz: 4bbb5bb1974ec6cfa48e72780fb06e999935e65a
3
+ metadata.gz: a977853c554635cda43f1247c7c2a10264c343ce
4
+ data.tar.gz: f9dbf44744c041c8574e9b1bc384dd080a66848e
5
5
  SHA512:
6
- metadata.gz: bd8ac3e16d6b817d81d8e10911e343657643acaf03ffebd9a7227e3d47a38c5d5dc8af433ffc6775cef7ae2a6867bd2f541ff29acbb8c341a8c7d74ca61ceed3
7
- data.tar.gz: 8c011e9f95681fcc351365a3d8309ef509dc1329b6895754cbd5b8c12734e01e9b47b993c983d67e25e5bb481d6e55fc6a02d2546c35a5a44ebf54b785582de1
6
+ metadata.gz: c6826283bbbf10a5dba85bc85769b4247bc3a0793dd62794a243ca36f8d167f678b4e08216d82556f19cc5ab0669e8360aefcf52f08b440250d686f20ed83e7f
7
+ data.tar.gz: 6860eff5f70b693c4288fcd09ea43e6e26d9316d1f40364b00c6e1e5a378c493e339d2d09a290ddb0b050961495f39ca6b9b4c6246708ad12647216846b5dcb5
@@ -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 "#{name}: #{line}"
101
+ STDOUT.write "#{header}: #{line}"
94
102
  }
95
103
  end
96
104
  $?.success? # $? is thread-local variable
@@ -1,3 +1,3 @@
1
1
  module Hotdog
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.9"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hotdog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yamashita Yuu