hocho 0.3.6 → 0.3.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/hocho/drivers/ssh_base.rb +22 -16
- data/lib/hocho/host.rb +1 -1
- data/lib/hocho/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f5398ffdb759cbfa7f06c5d388d5fa4b5455e81229f7546a302f9a97d9aeb8d
|
4
|
+
data.tar.gz: d07ddf5a3b23e81ba9b9d2eda67a909c3a4e84bd2a60a69bffcd682cad7db1e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e41c1eaa65f335385d5dead37cd1784500576f4ad3dfbb39e316771d28517b909097fafa687799e80067d2568a83ada90baa1db2e9030c3bcc6ddaca30020da
|
7
|
+
data.tar.gz: fdb35fd1103394c48602a766db80bcc90bec1777fb6d62dc562aebf0be2dfe6f73e3af6618679547d91ab92a07626a0e8c1616033e28f32e7017f5aa72deb31f
|
@@ -109,30 +109,36 @@ module Hocho
|
|
109
109
|
end
|
110
110
|
|
111
111
|
def set_ssh_output_hook(c)
|
112
|
-
|
113
|
-
|
114
|
-
|
112
|
+
check = ->(prefix, data, buf) do
|
113
|
+
data = buf + data unless buf.empty?
|
114
|
+
return if data.empty?
|
115
|
+
|
115
116
|
lines = data.lines
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
(
|
122
|
-
puts "#{prefix} #{line}"
|
123
|
-
end
|
124
|
-
buf.replace([])
|
117
|
+
|
118
|
+
# If data is not NL-terminated, its last line is carried over to next check.call
|
119
|
+
if lines.last.end_with?("\n")
|
120
|
+
buf.clear
|
121
|
+
else
|
122
|
+
buf.replace(lines.pop)
|
125
123
|
end
|
126
|
-
|
127
|
-
|
124
|
+
|
125
|
+
lines.each do |line|
|
126
|
+
puts "#{prefix}#{line}"
|
128
127
|
end
|
129
128
|
end
|
130
129
|
|
130
|
+
outbuf, errbuf = +"", +""
|
131
|
+
outpre, errpre = "[#{host.name}] ", "[#{host.name}/ERR] "
|
132
|
+
|
131
133
|
c.on_data do |c, data|
|
132
|
-
check.call
|
134
|
+
check.call outpre, data, outbuf
|
133
135
|
end
|
134
136
|
c.on_extended_data do |c, _, data|
|
135
|
-
check.call
|
137
|
+
check.call errpre, data, errbuf
|
138
|
+
end
|
139
|
+
c.on_close do
|
140
|
+
puts "#{outpre}#{outbuf}" unless outbuf.empty?
|
141
|
+
puts "#{errpre}#{errbuf}" unless errbuf.empty?
|
136
142
|
end
|
137
143
|
end
|
138
144
|
|
data/lib/hocho/host.rb
CHANGED
data/lib/hocho/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hocho
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sorah (Shota Fukumori)
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -108,7 +108,7 @@ dependencies:
|
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
|
-
description:
|
111
|
+
description:
|
112
112
|
email:
|
113
113
|
- her@sorah.jp
|
114
114
|
executables:
|
@@ -153,7 +153,7 @@ homepage: https://github.com/sorah/hocho
|
|
153
153
|
licenses:
|
154
154
|
- MIT
|
155
155
|
metadata: {}
|
156
|
-
post_install_message:
|
156
|
+
post_install_message:
|
157
157
|
rdoc_options: []
|
158
158
|
require_paths:
|
159
159
|
- lib
|
@@ -169,7 +169,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
169
169
|
version: '0'
|
170
170
|
requirements: []
|
171
171
|
rubygems_version: 3.1.2
|
172
|
-
signing_key:
|
172
|
+
signing_key:
|
173
173
|
specification_version: 4
|
174
174
|
summary: Server provisioning tool with itamae
|
175
175
|
test_files: []
|