net-telnet 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +7 -1
- data/README.md +2 -0
- data/lib/net/telnet.rb +17 -17
- data/lib/net/telnet/version.rb +1 -1
- data/net-telnet.gemspec +7 -2
- metadata +42 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 559287af4700c8d8ada67b47a6bdf94aca05308330d440f2204777e96a9ae495
|
4
|
+
data.tar.gz: 8ad75b98f6e723c6138d5516e292bbd236584bd8746c9d160b9d376c66a5602c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e3eaabb1c0427363187dc3dbe8cb38c452928536af18dc44849bbb473cd4cfb34ed15036be8575705716a613d00523810a20e9b3d3efac0b5b4bae968debf78
|
7
|
+
data.tar.gz: a5efaa746b0c8562480592140aa88ef5e577bb2ee301daa1edc845a4166607d6dd7f07055f9ebd956cbad3349d2d25dc35bc5a1adf68ab9a94c82853688fc851
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# Net::Telnet
|
2
2
|
|
3
|
+
[![Build Status](https://travis-ci.org/ruby/net-telnet.svg?branch=master)](https://travis-ci.org/ruby/net-telnet)
|
4
|
+
|
3
5
|
Provides telnet client functionality.
|
4
6
|
|
5
7
|
This class also has, through delegation, all the methods of a socket object (by default, a **TCPSocket**, but can be set by the **Proxy** option to ```new()```). This provides methods such as ```close()``` to end the session and ```sysread()``` to read data directly from the host, instead of via the ```waitfor()``` mechanism. Note that if you do use ```sysread()``` directly when in telnet mode, you should probably pass the output through ```preprocess()``` to extract telnet command sequences.
|
data/lib/net/telnet.rb
CHANGED
@@ -552,8 +552,8 @@ module Net
|
|
552
552
|
line = ''
|
553
553
|
buf = ''
|
554
554
|
rest = ''
|
555
|
-
until(prompt === line and not
|
556
|
-
unless
|
555
|
+
until(prompt === line and not @sock.wait_readable(waittime))
|
556
|
+
unless @sock.wait_readable(time_out)
|
557
557
|
raise Net::ReadTimeout, "timed out while waiting for more data"
|
558
558
|
end
|
559
559
|
begin
|
@@ -573,20 +573,20 @@ module Net
|
|
573
573
|
buf = preprocess(c)
|
574
574
|
rest = ''
|
575
575
|
end
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
576
|
+
else
|
577
|
+
# Not Telnetmode.
|
578
|
+
#
|
579
|
+
# We cannot use preprocess() on this data, because that
|
580
|
+
# method makes some Telnetmode-specific assumptions.
|
581
|
+
buf = rest + c
|
582
|
+
rest = ''
|
583
|
+
unless @options["Binmode"]
|
584
|
+
if pt = buf.rindex(/\r\z/no)
|
585
|
+
buf = buf[0 ... pt]
|
586
|
+
rest = buf[pt .. -1]
|
587
|
+
end
|
588
|
+
buf.gsub!(/#{EOL}/no, "\n")
|
589
|
+
end
|
590
590
|
end
|
591
591
|
@log.print(buf) if @options.has_key?("Output_log")
|
592
592
|
line += buf
|
@@ -610,7 +610,7 @@ module Net
|
|
610
610
|
def write(string)
|
611
611
|
length = string.length
|
612
612
|
while 0 < length
|
613
|
-
|
613
|
+
@sock.wait_writable
|
614
614
|
@dumplog.log_dump('>', string[-length..-1]) if @options.has_key?("Dump_log")
|
615
615
|
length -= @sock.syswrite(string[-length..-1])
|
616
616
|
end
|
data/lib/net/telnet/version.rb
CHANGED
data/net-telnet.gemspec
CHANGED
@@ -12,12 +12,17 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.summary = %q{Provides telnet client functionality.}
|
13
13
|
spec.description = %q{Provides telnet client functionality.}
|
14
14
|
spec.homepage = "https://github.com/ruby/net-telnet"
|
15
|
+
spec.license = "ruby"
|
15
16
|
|
16
17
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
17
18
|
spec.bindir = "exe"
|
18
19
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
20
|
spec.require_paths = ["lib"]
|
20
21
|
|
21
|
-
spec.
|
22
|
-
|
22
|
+
spec.required_ruby_version = '>= 2.3.0'
|
23
|
+
|
24
|
+
spec.add_development_dependency "bundler"
|
25
|
+
spec.add_development_dependency "rake"
|
26
|
+
spec.add_development_dependency 'minitest'
|
27
|
+
spec.add_development_dependency "mspec"
|
23
28
|
end
|
metadata
CHANGED
@@ -1,43 +1,71 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: net-telnet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SHIBATA Hiroshi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: minitest
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: mspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
41
69
|
description: Provides telnet client functionality.
|
42
70
|
email:
|
43
71
|
- hsbt@ruby-lang.org
|
@@ -58,7 +86,8 @@ files:
|
|
58
86
|
- lib/net/telnet/version.rb
|
59
87
|
- net-telnet.gemspec
|
60
88
|
homepage: https://github.com/ruby/net-telnet
|
61
|
-
licenses:
|
89
|
+
licenses:
|
90
|
+
- ruby
|
62
91
|
metadata: {}
|
63
92
|
post_install_message:
|
64
93
|
rdoc_options: []
|
@@ -68,7 +97,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
68
97
|
requirements:
|
69
98
|
- - ">="
|
70
99
|
- !ruby/object:Gem::Version
|
71
|
-
version:
|
100
|
+
version: 2.3.0
|
72
101
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
73
102
|
requirements:
|
74
103
|
- - ">="
|
@@ -76,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
76
105
|
version: '0'
|
77
106
|
requirements: []
|
78
107
|
rubyforge_project:
|
79
|
-
rubygems_version: 2.
|
108
|
+
rubygems_version: 2.7.6
|
80
109
|
signing_key:
|
81
110
|
specification_version: 4
|
82
111
|
summary: Provides telnet client functionality.
|