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 CHANGED
Binary file
@@ -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
@@ -1,7 +1,7 @@
1
1
  = net-ssh-telnet
2
2
 
3
3
  * http://net-ssh-telnet.rubyforge.org
4
- * mailto:matt@bravenet.com
4
+ * mailto:mkent@magoazul.com
5
5
 
6
6
  == DESCRIPTION:
7
7
 
@@ -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.1'
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 ((@eof and @buf == "") or not IO::select([sock], nil, nil, waittime))
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
- @channel.connection.process(0.1)
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.1
7
- date: 2008-06-06 00:00:00 -07:00
8
- summary: A ruby module to provide a simple send/expect interface over SSH with an API almost identical to Net::Telnet
9
- require_paths:
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
- MIIDMDCCAhigAwIBAgIBADANBgkqhkiG9w0BAQUFADA+MQ0wCwYDVQQDDARtYXR0
32
- MRgwFgYKCZImiZPyLGQBGRYIYnJhdmVuZXQxEzARBgoJkiaJk/IsZAEZFgNjb20w
33
- HhcNMDgwNTI5MjM1MDUwWhcNMDkwNTI5MjM1MDUwWjA+MQ0wCwYDVQQDDARtYXR0
34
- MRgwFgYKCZImiZPyLGQBGRYIYnJhdmVuZXQxEzARBgoJkiaJk/IsZAEZFgNjb20w
35
- ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDDGVrJnpk6/hCO5lg6T7As
36
- unEksqdmCly6GkRpX0cVxusWG/wbjrZw4Ka5x9pSS2m3GfefEpu5CuWH9wnGB/q0
37
- LwbWhrkpQb+uNVD6hEbQcngDEiQbiitaSWZKSvrIymbM5Tl92rIScmvx7Pd7l8tz
38
- BLndL/DmrBHrHWQ47xLxOmBAA4NJy0gk7HdsdAFfJwrEoC14AAXqcI3X0qU3KGrr
39
- 9Fs0jVeIKktx3fthwGVPrpYrMIw3xgiUqOqn7M+V4soD013dopaN7orewmCm9dQL
40
- 4N06FMnGNjwFaS6+MV612nk8gkVpJwgcwTHE1GNt2NItR5zeK6j+AZ01DijYdjH9
41
-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vJIMkBJJ+2KP+7oWwU95/pclnEXE/
22
+ e0qKZkVsaszihkvh1loxlKhU/sV0Sjo+LJ/fM7SR1a9WzSw1c1C/5Twjmq6jnaLG
23
+ ZGECAwEAAaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFGhf
24
+ 2WxIO89iFR2KfqyyXeWlUsBMMA0GCSqGSIb3DQEBBQUAA4IBAQAyvET0KFjr4Ars
25
+ HvOFhZOer5jWTfGDUcKB8oOfLhbs7PANVNv0BARxgH0Dj95kTcIfSvQLWfv5OmqC
26
+ AT3P6hPV6WbRCJOGPy0jeZcKWgPepl8vqnBciqzB8beBXmYmEe097MNvnlZptqU5
27
+ If5GWrjlRoeYpRDNpMpaN4UFxsb/I4MGYvbnrEVc6Ev1ztgK5Kci8oYcINjUhCls
28
+ EOmi6kiwQNdHUW0XLqwGanEip196lyE5IHRylQ5UiwYI0T4hDSc9f0SE+dzENdFw
29
+ doMOs6odERAAmX+M7PQ4i3Zvs+Jv9SazZBcl8+sohZL3I5A1fkNQXts1hV6TObce
30
+ T6VhSPds
49
31
  -----END CERTIFICATE-----
50
32
 
51
- post_install_message:
52
- authors:
53
- - Matthew Kent
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
- test_files:
67
- - test/test_net-ssh-telnet.rb
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
- extra_rdoc_files:
72
- - History.txt
73
- - Manifest.txt
74
- - README.txt
75
- - Todo.txt
76
- executables: []
77
-
78
- extensions: []
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
- dependencies:
83
- - !ruby/object:Gem::Dependency
84
- name: net-ssh
85
- version_requirement:
86
- version_requirements: !ruby/object:Gem::Version::Requirement
87
- requirements:
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