net-ssh-telnet 0.2.1 → 0.3.0
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 +5 -5
- data/History.md +4 -0
- data/lib/net/ssh/telnet.rb +10 -5
- data/lib/net/ssh/telnet/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 10aec54d7c32b4a525b98057128d3da89e49fbd3f9b94933c086ed52ea8aafc4
|
4
|
+
data.tar.gz: 9a0b9a576e1f9dbb5e99266ba34b376201cee0a3ce7be5ceb22418d07498feb7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f390243d5ebf140299256ab4843055ea596cb8e55024038efbb0bf80da0b456d3e7911d1259e3ab0c672b6aca6bfe5da93504095245d0b01553e9337d424f3c0
|
7
|
+
data.tar.gz: f6b0e8cc9de3e02c1adec0d6d2ff290120d8a5583e584a62e855fffb35f4e9ab88b4cfa8d02bd6c106cb63c1c9f0b343ab8552443a675a235f250d3008c23987
|
data/History.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
### 0.3.0 / 2021-01-26
|
2
|
+
* Require net/protocol to ensure Net::ReadTimeout is available (patch from electricalen)
|
3
|
+
* Add option to not allocate PTY (patch from lumean)
|
4
|
+
|
1
5
|
### 0.2.1 / 2017-10-08
|
2
6
|
* Add compatibility for net-ssh v4.2 (patch from haccht)
|
3
7
|
* Add PTYOptions option (patch from Ben Miller)
|
data/lib/net/ssh/telnet.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'net/ssh'
|
2
|
+
require 'net/protocol'
|
2
3
|
|
3
4
|
module Net
|
4
5
|
module SSH
|
@@ -147,6 +148,7 @@ module SSH
|
|
147
148
|
# * <tt>"Timeout"</tt> - the time out value passed on to Net::SSH - also the default value for #waitfor(Default: 10)
|
148
149
|
# * <tt>"Waittime"</tt> - Max time to wait after a possible prompt it seen to make sure more data isn't coming(Default: 0)
|
149
150
|
# * <tt>"Terminator"</tt> - This value is appended to all strings that are sent to #print.(Default: LF)
|
151
|
+
# * <tt>"PTY"</tt> - If true a real Pty is allocated (ssh -T) otherwise only a shell is requested (Default: true)
|
150
152
|
# * <tt>"Binmode"</tt> - Enable binary mode.(Default: false)
|
151
153
|
# * <tt>"Output_log"</tt> - A file name to open as an output log.
|
152
154
|
# * <tt>"Dump_log"</tt> - A file name to open to dump the entire session to.
|
@@ -163,6 +165,7 @@ module SSH
|
|
163
165
|
@options["Timeout"] = 10 unless @options.has_key?("Timeout")
|
164
166
|
@options["Waittime"] = 0 unless @options.has_key?("Waittime")
|
165
167
|
@options["Terminator"] = LF unless @options.has_key?("Terminator")
|
168
|
+
@options["PTY"] = true unless @options.has_key?("PTY")
|
166
169
|
@options["PTYOptions"] = {} unless @options.has_key?("PTYOptions")
|
167
170
|
|
168
171
|
unless @options.has_key?("Binmode")
|
@@ -258,11 +261,13 @@ module SSH
|
|
258
261
|
channel.on_data { |ch,data| @buf << data }
|
259
262
|
channel.on_extended_data { |ch,type,data| @buf << data if type == 1 }
|
260
263
|
channel.on_close { @eof = true }
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
264
|
+
if @options["PTY"]
|
265
|
+
channel.request_pty(@options["PTYOptions"]) { |ch,success|
|
266
|
+
if success == false
|
267
|
+
raise "Failed to open ssh pty"
|
268
|
+
end
|
269
|
+
}
|
270
|
+
end
|
266
271
|
channel.send_channel_request("shell") { |ch, success|
|
267
272
|
if success
|
268
273
|
@channel = ch
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: net-ssh-telnet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Dilda
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-ssh
|
@@ -83,8 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
83
83
|
- !ruby/object:Gem::Version
|
84
84
|
version: '0'
|
85
85
|
requirements: []
|
86
|
-
|
87
|
-
rubygems_version: 2.6.13
|
86
|
+
rubygems_version: 3.0.3
|
88
87
|
signing_key:
|
89
88
|
specification_version: 4
|
90
89
|
summary: Provides Net::Telnet API for SSH connections
|