net-ssh-telnet 0.0.1 → 0.0.2
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.
- data.tar.gz.sig +0 -0
- data/History.txt +11 -2
- data/README.txt +1 -1
- data/lib/net/ssh/telnet.rb +19 -8
- metadata +81 -73
- metadata.gz.sig +0 -0
data.tar.gz.sig
CHANGED
Binary file
|
data/History.txt
CHANGED
@@ -1,7 +1,16 @@
|
|
1
|
+
=== 0.0.2 / 2009-03-15
|
2
|
+
|
3
|
+
* 4 bugfixes from Brian Candler
|
4
|
+
* Bug in original Net::Telnet EOL translation
|
5
|
+
(http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/16599)
|
6
|
+
duplicate the fix.
|
7
|
+
* Remove rubygems require.
|
8
|
+
* Handle EOF more gracefully.
|
9
|
+
* Allow FailEOF to propagate through cmd() to waitfor().
|
10
|
+
|
1
11
|
=== 0.0.1 / 2008-06-06
|
2
12
|
|
3
13
|
* 1 major enhancement
|
4
|
-
|
5
14
|
* Birthday!
|
15
|
+
* Initial revision by Brian Candler based on Net::Telnet.
|
6
16
|
* Test release.
|
7
|
-
|
data/README.txt
CHANGED
data/lib/net/ssh/telnet.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'rubygems'
|
2
1
|
require 'net/ssh'
|
3
2
|
|
4
3
|
module Net
|
@@ -15,7 +14,7 @@ module SSH
|
|
15
14
|
CR = "\015"
|
16
15
|
LF = "\012"
|
17
16
|
EOL = CR + LF
|
18
|
-
VERSION = '0.0.
|
17
|
+
VERSION = '0.0.2'
|
19
18
|
|
20
19
|
# Wrapper to emulate the behaviour of Net::Telnet "Proxy" option, where
|
21
20
|
# the user passes in an already-open socket
|
@@ -320,17 +319,27 @@ module SSH
|
|
320
319
|
rest = ''
|
321
320
|
sock = @ssh.transport.socket
|
322
321
|
|
323
|
-
until prompt === line and
|
322
|
+
until prompt === line and @buf == "" and (@eof or (not sock.closed? and not IO::select([sock], nil, nil, waittime)))
|
324
323
|
while @buf == "" and !@eof
|
325
324
|
# timeout is covered by net-ssh
|
326
|
-
|
325
|
+
begin
|
326
|
+
@channel.connection.process(0.1)
|
327
|
+
rescue IOError
|
328
|
+
@eof = true
|
329
|
+
end
|
327
330
|
end
|
328
331
|
if @buf != ""
|
329
332
|
c = @buf; @buf = ""
|
330
333
|
@dumplog.log_dump('<', c) if @options.has_key?("Dump_log")
|
331
|
-
buf = c
|
332
|
-
buf.gsub!(/#{EOL}/no, "\n") unless @options["Binmode"]
|
334
|
+
buf = rest + c
|
333
335
|
rest = ''
|
336
|
+
unless @options["Binmode"]
|
337
|
+
if pt = buf.rindex(/\r\z/no)
|
338
|
+
buf = buf[0 ... pt]
|
339
|
+
rest = buf[pt .. -1]
|
340
|
+
end
|
341
|
+
buf.gsub!(/#{EOL}/no, "\n")
|
342
|
+
end
|
334
343
|
@log.print(buf) if @options.has_key?("Output_log")
|
335
344
|
line += buf
|
336
345
|
yield buf if block_given?
|
@@ -389,20 +398,22 @@ module SSH
|
|
389
398
|
def cmd(options) # :yield: recvdata
|
390
399
|
match = @options["Prompt"]
|
391
400
|
time_out = @options["Timeout"]
|
401
|
+
fail_eof = @options["FailEOF"]
|
392
402
|
|
393
403
|
if options.kind_of?(Hash)
|
394
404
|
string = options["String"]
|
395
405
|
match = options["Match"] if options.has_key?("Match")
|
396
406
|
time_out = options["Timeout"] if options.has_key?("Timeout")
|
407
|
+
fail_eof = options["FailEOF"] if options.has_key?("FailEOF")
|
397
408
|
else
|
398
409
|
string = options
|
399
410
|
end
|
400
411
|
|
401
412
|
self.puts(string)
|
402
413
|
if block_given?
|
403
|
-
waitfor({"Prompt" => match, "Timeout" => time_out}){|c| yield c }
|
414
|
+
waitfor({"Prompt" => match, "Timeout" => time_out, "FailEOF" => fail_eof}){|c| yield c }
|
404
415
|
else
|
405
|
-
waitfor({"Prompt" => match, "Timeout" => time_out})
|
416
|
+
waitfor({"Prompt" => match, "Timeout" => time_out, "FailEOF" => fail_eof})
|
406
417
|
end
|
407
418
|
end
|
408
419
|
|
metadata
CHANGED
@@ -1,56 +1,70 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.9.0
|
3
|
-
specification_version: 1
|
4
2
|
name: net-ssh-telnet
|
5
3
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.0.
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
- lib
|
11
|
-
email:
|
12
|
-
- matt@bravenet.com
|
13
|
-
homepage: http://net-ssh-telnet.rubyforge.org
|
14
|
-
rubyforge_project: net-ssh-telnet
|
15
|
-
description: A ruby module to provide a simple send/expect interface over SSH with an API almost identical to Net::Telnet. Ideally it should be a drop in replacement. Please see Net::Telnet for main documentation (included with ruby stdlib).
|
4
|
+
version: 0.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Matthew Kent
|
16
8
|
autorequire:
|
17
|
-
default_executable:
|
18
9
|
bindir: bin
|
19
|
-
has_rdoc: true
|
20
|
-
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
21
|
-
requirements:
|
22
|
-
- - ">"
|
23
|
-
- !ruby/object:Gem::Version
|
24
|
-
version: 0.0.0
|
25
|
-
version:
|
26
|
-
platform: ruby
|
27
|
-
signing_key:
|
28
10
|
cert_chain:
|
29
11
|
- |
|
30
12
|
-----BEGIN CERTIFICATE-----
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
13
|
+
MIIDMjCCAhqgAwIBAgIBADANBgkqhkiG9w0BAQUFADA/MQ4wDAYDVQQDDAVta2Vu
|
14
|
+
dDEYMBYGCgmSJomT8ixkARkWCG1hZ29henVsMRMwEQYKCZImiZPyLGQBGRYDY29t
|
15
|
+
MB4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Xts1hV6TObce
|
30
|
+
T6VhSPds
|
49
31
|
-----END CERTIFICATE-----
|
50
32
|
|
51
|
-
|
52
|
-
|
53
|
-
|
33
|
+
date: 2009-03-15 00:00:00 -07:00
|
34
|
+
default_executable:
|
35
|
+
dependencies:
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: net-ssh
|
38
|
+
type: :runtime
|
39
|
+
version_requirement:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: 2.0.1
|
45
|
+
version:
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: hoe
|
48
|
+
type: :development
|
49
|
+
version_requirement:
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 1.7.0
|
55
|
+
version:
|
56
|
+
description: A ruby module to provide a simple send/expect interface over SSH with an API almost identical to Net::Telnet. Ideally it should be a drop in replacement. Please see Net::Telnet for main documentation (included with ruby stdlib).
|
57
|
+
email:
|
58
|
+
- matt@bravenet.com
|
59
|
+
executables: []
|
60
|
+
|
61
|
+
extensions: []
|
62
|
+
|
63
|
+
extra_rdoc_files:
|
64
|
+
- History.txt
|
65
|
+
- Manifest.txt
|
66
|
+
- README.txt
|
67
|
+
- Todo.txt
|
54
68
|
files:
|
55
69
|
- History.txt
|
56
70
|
- Manifest.txt
|
@@ -63,38 +77,32 @@ files:
|
|
63
77
|
- examples/non_standard_shell.rb
|
64
78
|
- lib/net/ssh/telnet.rb
|
65
79
|
- test/test_net-ssh-telnet.rb
|
66
|
-
|
67
|
-
|
80
|
+
has_rdoc: true
|
81
|
+
homepage: http://net-ssh-telnet.rubyforge.org
|
82
|
+
post_install_message:
|
68
83
|
rdoc_options:
|
69
84
|
- --main
|
70
85
|
- README.txt
|
71
|
-
|
72
|
-
-
|
73
|
-
|
74
|
-
|
75
|
-
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
86
|
+
require_paths:
|
87
|
+
- lib
|
88
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
89
|
+
requirements:
|
90
|
+
- - ">="
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: "0"
|
93
|
+
version:
|
94
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
95
|
+
requirements:
|
96
|
+
- - ">="
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: "0"
|
99
|
+
version:
|
80
100
|
requirements: []
|
81
101
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
- !ruby/object:Gem::Version
|
90
|
-
version: 2.0.1
|
91
|
-
version:
|
92
|
-
- !ruby/object:Gem::Dependency
|
93
|
-
name: hoe
|
94
|
-
version_requirement:
|
95
|
-
version_requirements: !ruby/object:Gem::Version::Requirement
|
96
|
-
requirements:
|
97
|
-
- - ">="
|
98
|
-
- !ruby/object:Gem::Version
|
99
|
-
version: 1.5.3
|
100
|
-
version:
|
102
|
+
rubyforge_project: net-ssh-telnet
|
103
|
+
rubygems_version: 1.2.0
|
104
|
+
signing_key:
|
105
|
+
specification_version: 2
|
106
|
+
summary: A ruby module to provide a simple send/expect interface over SSH with an API almost identical to Net::Telnet
|
107
|
+
test_files:
|
108
|
+
- test/test_net-ssh-telnet.rb
|
metadata.gz.sig
CHANGED
Binary file
|