net-ssh-cli 1.3.0 → 1.3.1
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 +4 -4
- data/lib/net/ssh/cli.rb +7 -3
- data/lib/net/ssh/cli/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: edf3e84c80ca5ee2c6b67efee26c5f5b4f4b51a6c3425c4b7093e1d20eee4816
|
4
|
+
data.tar.gz: 59b804e5249298c0f6de5debb26a89eacc3221e0a7d1bf3fe47aa08c5c2e89fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d1046b9eab50cf26d5a1acab9d9301fa90225204df55168c64dcb9d985310aacdee023fe2c4ce2628cf016847e891feed6f94da3c0423c6555f41f3727262da
|
7
|
+
data.tar.gz: 2c70b909d56f711d972b8381f4eef838e785b1b78d63d11786fded541b00d0b03b487fa66418b791965d4c13c0a02c28f65751cab5fa917a459c5ccdffa00ae6
|
data/lib/net/ssh/cli.rb
CHANGED
@@ -174,11 +174,15 @@ module Net
|
|
174
174
|
def read_till(prompt: current_prompt, timeout: read_till_timeout, **_opts)
|
175
175
|
raise Error::UndefinedMatch, 'no prompt given or default_prompt defined' unless prompt
|
176
176
|
|
177
|
-
|
177
|
+
hard_timeout = timeout
|
178
|
+
hard_timeout += 0.5 if timeout
|
179
|
+
::Timeout.timeout(hard_timeout, Error::ReadTillTimeout) do
|
178
180
|
with_prompt(prompt) do
|
179
|
-
soft_timeout = Time.now + timeout
|
181
|
+
soft_timeout = Time.now + timeout if timeout
|
180
182
|
until stdout[current_prompt] do
|
181
|
-
|
183
|
+
if timeout and soft_timeout < Time.now
|
184
|
+
raise Error::ReadTillTimeout, "Timeout after #{timeout}s, #{current_prompt.inspect} never matched #{stdout.inspect}"
|
185
|
+
end
|
182
186
|
process
|
183
187
|
sleep 0.1
|
184
188
|
end
|
data/lib/net/ssh/cli/version.rb
CHANGED