hotdog 0.8.2 → 0.9.0
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 +12 -1
- data/lib/hotdog/commands/search.rb +1 -1
- data/lib/hotdog/commands/ssh.rb +6 -1
- data/lib/hotdog/version.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ccee00108b31b9154a5f11b031a06955d1b4dd0
|
4
|
+
data.tar.gz: 23bda8a7a49eddb81abfd3c5e96580715cc9a6ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 322a60fa2690142f3b30d934136e06462c473a4a8be83c6d761783f3a219badc79ae9215b5f4246cb30bc26ac08a365457aca1310d58e8bc64c1faf78f350257
|
7
|
+
data.tar.gz: 6958e8bc715bda65ff2ad7b86e0068288c76c201661e5d84f97b653564484d2f1e065cddec8e1f367cb4f71a24ed89cfe1c7456287434f0047112266c1bf993a
|
data/lib/hotdog/commands/pssh.rb
CHANGED
@@ -4,6 +4,7 @@ require "json"
|
|
4
4
|
require "parallel"
|
5
5
|
require "parslet"
|
6
6
|
require "shellwords"
|
7
|
+
require "tempfile"
|
7
8
|
require "hotdog/commands/ssh"
|
8
9
|
|
9
10
|
module Hotdog
|
@@ -22,11 +23,21 @@ module Hotdog
|
|
22
23
|
|
23
24
|
private
|
24
25
|
def run_main(hosts, options={})
|
26
|
+
if STDIN.tty?
|
27
|
+
infile = nil
|
28
|
+
else
|
29
|
+
infile = Tempfile.new()
|
30
|
+
while cs = STDIN.read(4096)
|
31
|
+
infile.write(cs)
|
32
|
+
end
|
33
|
+
infile.flush
|
34
|
+
infile.seek(0)
|
35
|
+
end
|
25
36
|
begin
|
26
37
|
stats = Parallel.map(hosts.each_with_index.to_a, in_threads: parallelism(hosts)) { |host, i|
|
27
38
|
cmdline = build_command_string(host, @remote_command, options)
|
28
39
|
identifier = options[:show_identifier] ? host : nil
|
29
|
-
success = exec_command(identifier, cmdline, index: i, output: true)
|
40
|
+
success = exec_command(identifier, cmdline, index: i, output: true, infile: infile.path)
|
30
41
|
if !success && options[:stop_on_error]
|
31
42
|
raise StopException.new
|
32
43
|
end
|
data/lib/hotdog/commands/ssh.rb
CHANGED
@@ -158,7 +158,12 @@ module Hotdog
|
|
158
158
|
else
|
159
159
|
color = nil
|
160
160
|
end
|
161
|
-
|
161
|
+
if options[:infile]
|
162
|
+
stdin = IO.popen("cat #{Shellwords.shellescape(options[:infile])}")
|
163
|
+
else
|
164
|
+
stdin = :close
|
165
|
+
end
|
166
|
+
IO.popen(cmdline, in: stdin, err: [:child, :out]) do |io|
|
162
167
|
io.each_with_index do |s, i|
|
163
168
|
if output
|
164
169
|
if identifier
|
data/lib/hotdog/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hotdog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yamashita Yuu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04
|
11
|
+
date: 2016-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -256,4 +256,3 @@ test_files:
|
|
256
256
|
- spec/parser/regexp_expression_spec.rb
|
257
257
|
- spec/parser/string_expression_spec.rb
|
258
258
|
- spec/spec_helper.rb
|
259
|
-
has_rdoc:
|