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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 8bd2806c7292a8729c2b4a565f16a480a5066280
4
- data.tar.gz: 2ac60b8aa2714e62f089b7717e08d666bb9264eb
2
+ SHA256:
3
+ metadata.gz: 559287af4700c8d8ada67b47a6bdf94aca05308330d440f2204777e96a9ae495
4
+ data.tar.gz: 8ad75b98f6e723c6138d5516e292bbd236584bd8746c9d160b9d376c66a5602c
5
5
  SHA512:
6
- metadata.gz: 1c2a387f5829fa8558023f7ab637e395b9d11e7a7711f5227a121d315771646cc1cc2a07245587a5162b9049680731bcd5d21f0554fcc4c2f6bb9955274b5f18
7
- data.tar.gz: 128977c248d5b38a3151d4a734a758e331e1b2481f627ba8b21353b37edce1171d7d2aaefbb92acf5b1234178139dd01c44f4d8142cb8b52494fcc5f68c1e421
6
+ metadata.gz: 0e3eaabb1c0427363187dc3dbe8cb38c452928536af18dc44849bbb473cd4cfb34ed15036be8575705716a613d00523810a20e9b3d3efac0b5b4bae968debf78
7
+ data.tar.gz: a5efaa746b0c8562480592140aa88ef5e577bb2ee301daa1edc845a4166607d6dd7f07055f9ebd956cbad3349d2d25dc35bc5a1adf68ab9a94c82853688fc851
@@ -1,4 +1,10 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.2.2
3
+ - 2.3.6
4
+ - 2.4.3
5
+ - 2.5.0
4
6
  - ruby-head
7
+
8
+ script:
9
+ - rake test
10
+ - mspec
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.
@@ -552,8 +552,8 @@ module Net
552
552
  line = ''
553
553
  buf = ''
554
554
  rest = ''
555
- until(prompt === line and not IO::select([@sock], nil, nil, waittime))
556
- unless IO::select([@sock], nil, nil, time_out)
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
- 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
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
- IO::select(nil, [@sock])
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
@@ -1,5 +1,5 @@
1
1
  module Net
2
2
  class Telnet
3
- VERSION = "0.1.1"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
@@ -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.add_development_dependency "bundler", "~> 1.9"
22
- spec.add_development_dependency "rake", "~> 10.0"
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.1.1
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: 2015-04-21 00:00:00.000000000 Z
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: '1.9'
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: '1.9'
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: '10.0'
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: '10.0'
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: '0'
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.4.6
108
+ rubygems_version: 2.7.6
80
109
  signing_key:
81
110
  specification_version: 4
82
111
  summary: Provides telnet client functionality.