net-ping 1.7.6 → 1.7.7
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/CHANGES +3 -0
- data/Gemfile.lock +22 -0
- data/{README → README.md} +17 -20
- data/lib/net/ping/http.rb +1 -1
- data/net-ping.gemspec +5 -5
- data/test/test_net_ping_http.rb +27 -0
- metadata +33 -26
- checksums.yaml +0 -7
data/CHANGES
CHANGED
data/Gemfile.lock
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
net-ping (1.7.7)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: http://rubygems.org/
|
8
|
+
specs:
|
9
|
+
fakeweb (1.3.0)
|
10
|
+
power_assert (0.2.2)
|
11
|
+
rake (10.4.2)
|
12
|
+
test-unit (3.0.9)
|
13
|
+
power_assert
|
14
|
+
|
15
|
+
PLATFORMS
|
16
|
+
ruby
|
17
|
+
|
18
|
+
DEPENDENCIES
|
19
|
+
fakeweb
|
20
|
+
net-ping!
|
21
|
+
rake
|
22
|
+
test-unit
|
data/{README → README.md}
RENAMED
@@ -1,7 +1,7 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# net-ping
|
2
|
+
A collection of classes that provide different ways to ping computers.
|
3
3
|
|
4
|
-
|
4
|
+
## Prerequisites
|
5
5
|
* ffi
|
6
6
|
* win32-security (MS Windows only)
|
7
7
|
* fakeweb (test only)
|
@@ -10,33 +10,30 @@
|
|
10
10
|
Ruby users should use Ruby 1.9.3 or later.
|
11
11
|
JRuby users should use JRuby 1.6.7 or later.
|
12
12
|
|
13
|
-
|
14
|
-
gem install net-ping
|
13
|
+
## Installation
|
14
|
+
```gem install net-ping```
|
15
15
|
|
16
|
-
|
17
|
-
I would very much like to turn this gem over to someone who is using it
|
18
|
-
more actively than I am. Please let me know if you are interested!
|
19
|
-
|
20
|
-
== Notes
|
16
|
+
## Notes
|
21
17
|
Please read the documentation under the 'doc' directory. Especially pay
|
22
18
|
attention to the documentation pertaining to ECONNREFUSED and TCP pings.
|
23
19
|
|
24
20
|
Also note the documentation regarding down hosts.
|
25
|
-
|
21
|
+
|
22
|
+
## How to require net-ping
|
26
23
|
You can do either this:
|
27
24
|
|
28
|
-
require 'net/ping'
|
25
|
+
```require 'net/ping'```
|
29
26
|
|
30
27
|
In which case you will get Net::Ping and all of its subclasses. Or,
|
31
28
|
you can load individual subclasses like this:
|
32
29
|
|
33
|
-
require 'net/ping/tcp'
|
30
|
+
```require 'net/ping/tcp'```
|
34
31
|
|
35
32
|
The former has the advantage of being easier to remember and all inclusive,
|
36
33
|
not to mention backwards compatible. The latter has the advantage of
|
37
34
|
reducing your memory footprint.
|
38
|
-
|
39
|
-
|
35
|
+
|
36
|
+
## Known Issues
|
40
37
|
Older versions of Ruby 1.9.x may not work with UDP pings.
|
41
38
|
|
42
39
|
Older versions of JRuby will return false positives in UDP pings
|
@@ -48,19 +45,19 @@
|
|
48
45
|
ICMP pings will not work with JRuby without some sort of third-party
|
49
46
|
library support for raw sockets in Java, such as RockSaw.
|
50
47
|
|
51
|
-
|
48
|
+
## License
|
52
49
|
Artistic 2.0
|
53
50
|
|
54
|
-
|
51
|
+
## Contributions
|
55
52
|
Although this library is free, please consider having your company
|
56
53
|
setup a gittip if used by your company professionally.
|
57
54
|
|
58
55
|
http://www.gittip.com/djberg96/
|
59
|
-
|
60
|
-
|
56
|
+
|
57
|
+
## More documentation
|
61
58
|
If you installed this library via Rubygems, you can view the inline
|
62
59
|
documentation via ri or fire up 'gem server', and point your browser at
|
63
60
|
http://localhost:8808.
|
64
61
|
|
65
|
-
|
62
|
+
## Author
|
66
63
|
Daniel J. Berger
|
data/lib/net/ping/http.rb
CHANGED
data/net-ping.gemspec
CHANGED
@@ -3,16 +3,16 @@ require 'rbconfig'
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |spec|
|
5
5
|
spec.name = 'net-ping'
|
6
|
-
spec.version = '1.7.
|
6
|
+
spec.version = '1.7.7'
|
7
7
|
spec.license = 'Artistic 2.0'
|
8
|
-
spec.author = '
|
9
|
-
spec.email = '
|
10
|
-
spec.homepage = 'https://github.com/
|
8
|
+
spec.author = 'Chris Chernesky'
|
9
|
+
spec.email = 'chris.netping@tinderglow.com'
|
10
|
+
spec.homepage = 'https://github.com/chernesk/net-ping'
|
11
11
|
spec.summary = 'A ping interface for Ruby.'
|
12
12
|
spec.test_file = 'test/test_net_ping.rb'
|
13
13
|
spec.files = Dir['**/*'].reject{ |f| f.include?('git') }
|
14
14
|
|
15
|
-
spec.extra_rdoc_files = ['README', 'CHANGES', 'doc/ping.txt']
|
15
|
+
spec.extra_rdoc_files = ['README.md', 'CHANGES', 'doc/ping.txt']
|
16
16
|
|
17
17
|
# The TCP Ping class requires this for non-blocking sockets.
|
18
18
|
spec.required_ruby_version = ">= 1.9.3"
|
data/test/test_net_ping_http.rb
CHANGED
@@ -13,6 +13,9 @@ class TC_Net_Ping_HTTP < Test::Unit::TestCase
|
|
13
13
|
ENV['http_proxy'] = ENV['https_proxy'] = ENV['no_proxy'] = nil
|
14
14
|
@uri = 'http://www.google.com/index.html'
|
15
15
|
@uri_https = 'https://encrypted.google.com'
|
16
|
+
@uri_http_domain = 'http.com'
|
17
|
+
@uri_http_domain_scheme = 'http://http.com'
|
18
|
+
@uri_http_domain_schemes = 'https://http.com'
|
16
19
|
@proxy = 'http://username:password@proxymoxie:3128'
|
17
20
|
FakeWeb.allow_net_connect = false
|
18
21
|
|
@@ -20,6 +23,12 @@ class TC_Net_Ping_HTTP < Test::Unit::TestCase
|
|
20
23
|
FakeWeb.register_uri(:head, @uri, :body => "PONG")
|
21
24
|
FakeWeb.register_uri(:head, @uri_https, :body => "PONG")
|
22
25
|
FakeWeb.register_uri(:get, @uri_https, :body => "PONG")
|
26
|
+
FakeWeb.register_uri(:get, "http://#{@uri_http_domain}", :body => "PONG")
|
27
|
+
FakeWeb.register_uri(:head, "http://#{@uri_http_domain}", :body => "PONG")
|
28
|
+
FakeWeb.register_uri(:get, @uri_http_domain_scheme, :body => "PONG")
|
29
|
+
FakeWeb.register_uri(:head, @uri_http_domain_scheme, :body => "PONG")
|
30
|
+
FakeWeb.register_uri(:get, @uri_http_domain_schemes, :body => "PONG")
|
31
|
+
FakeWeb.register_uri(:head, @uri_http_domain_schemes, :body => "PONG")
|
23
32
|
FakeWeb.register_uri(:head, "http://jigsaw.w3.org/HTTP/300/302.html",
|
24
33
|
:body => "PONG",
|
25
34
|
:location => "#{@uri}",
|
@@ -31,6 +40,9 @@ class TC_Net_Ping_HTTP < Test::Unit::TestCase
|
|
31
40
|
:status => ["502", "Bad Gateway"])
|
32
41
|
|
33
42
|
@http = Net::Ping::HTTP.new(@uri, 80, 30)
|
43
|
+
@http_http_domain = Net::Ping::HTTP.new(@uri_http_domain, 80, 30)
|
44
|
+
@http_http_domain_scheme = Net::Ping::HTTP.new(@uri_http_domain_scheme, 80, 30)
|
45
|
+
@http_http_domain_schemes = Net::Ping::HTTP.new(@uri_http_domain_schemes, 80, 30)
|
34
46
|
@bad = Net::Ping::HTTP.new('http://www.blabfoobarurghxxxx.com') # One hopes not
|
35
47
|
end
|
36
48
|
|
@@ -39,6 +51,21 @@ class TC_Net_Ping_HTTP < Test::Unit::TestCase
|
|
39
51
|
assert_nothing_raised{ @http.ping }
|
40
52
|
end
|
41
53
|
|
54
|
+
test 'ping site with http in domain' do
|
55
|
+
assert_respond_to(@http_http_domain, :ping)
|
56
|
+
assert_nothing_raised{ @http_http_domain.ping }
|
57
|
+
end
|
58
|
+
|
59
|
+
test 'ping site with http in domain and http scheme' do
|
60
|
+
assert_respond_to(@http_http_domain_scheme, :ping)
|
61
|
+
assert_nothing_raised{ @http_http_domain_scheme.ping }
|
62
|
+
end
|
63
|
+
|
64
|
+
test 'ping site with http in domain and https scheme' do
|
65
|
+
assert_respond_to(@http_http_domain_schemes, :ping)
|
66
|
+
assert_nothing_raised{ @http_http_domain_schemes.ping }
|
67
|
+
end
|
68
|
+
|
42
69
|
test 'ping returns a boolean value' do
|
43
70
|
assert_boolean(@http.ping?)
|
44
71
|
assert_boolean(@bad.ping?)
|
metadata
CHANGED
@@ -1,80 +1,82 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: net-ping
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.7
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
|
-
-
|
8
|
+
- Chris Chernesky
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date:
|
12
|
+
date: 2015-01-23 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: test-unit
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
16
18
|
requirements:
|
17
|
-
- -
|
19
|
+
- - ! '>='
|
18
20
|
- !ruby/object:Gem::Version
|
19
21
|
version: '0'
|
20
22
|
type: :development
|
21
23
|
prerelease: false
|
22
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
23
26
|
requirements:
|
24
|
-
- -
|
27
|
+
- - ! '>='
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: '0'
|
27
30
|
- !ruby/object:Gem::Dependency
|
28
31
|
name: fakeweb
|
29
32
|
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
30
34
|
requirements:
|
31
|
-
- -
|
35
|
+
- - ! '>='
|
32
36
|
- !ruby/object:Gem::Version
|
33
37
|
version: '0'
|
34
38
|
type: :development
|
35
39
|
prerelease: false
|
36
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
37
42
|
requirements:
|
38
|
-
- -
|
43
|
+
- - ! '>='
|
39
44
|
- !ruby/object:Gem::Version
|
40
45
|
version: '0'
|
41
46
|
- !ruby/object:Gem::Dependency
|
42
47
|
name: rake
|
43
48
|
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
44
50
|
requirements:
|
45
|
-
- -
|
51
|
+
- - ! '>='
|
46
52
|
- !ruby/object:Gem::Version
|
47
53
|
version: '0'
|
48
54
|
type: :development
|
49
55
|
prerelease: false
|
50
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
51
58
|
requirements:
|
52
|
-
- -
|
59
|
+
- - ! '>='
|
53
60
|
- !ruby/object:Gem::Version
|
54
61
|
version: '0'
|
55
|
-
description:
|
56
|
-
|
57
|
-
|
58
|
-
classes.
|
59
|
-
email: djberg96@gmail.com
|
62
|
+
description: ! " The net-ping library provides a ping interface for Ruby. It includes\n
|
63
|
+
\ separate TCP, HTTP, LDAP, ICMP, UDP, WMI (for Windows) and external ping\n classes.\n"
|
64
|
+
email: chris.netping@tinderglow.com
|
60
65
|
executables: []
|
61
66
|
extensions: []
|
62
67
|
extra_rdoc_files:
|
63
|
-
- README
|
68
|
+
- README.md
|
64
69
|
- CHANGES
|
65
70
|
- doc/ping.txt
|
66
71
|
files:
|
67
72
|
- CHANGES
|
68
|
-
- Gemfile
|
69
|
-
- MANIFEST
|
70
|
-
- README
|
71
|
-
- Rakefile
|
72
73
|
- doc/ping.txt
|
73
74
|
- examples/example_pingexternal.rb
|
74
75
|
- examples/example_pinghttp.rb
|
75
76
|
- examples/example_pingtcp.rb
|
76
77
|
- examples/example_pingudp.rb
|
77
|
-
-
|
78
|
+
- Gemfile
|
79
|
+
- Gemfile.lock
|
78
80
|
- lib/net/ping/external.rb
|
79
81
|
- lib/net/ping/http.rb
|
80
82
|
- lib/net/ping/icmp.rb
|
@@ -82,7 +84,11 @@ files:
|
|
82
84
|
- lib/net/ping/tcp.rb
|
83
85
|
- lib/net/ping/udp.rb
|
84
86
|
- lib/net/ping/wmi.rb
|
87
|
+
- lib/net/ping.rb
|
88
|
+
- MANIFEST
|
85
89
|
- net-ping.gemspec
|
90
|
+
- Rakefile
|
91
|
+
- README.md
|
86
92
|
- test/test_net_ping.rb
|
87
93
|
- test/test_net_ping_external.rb
|
88
94
|
- test/test_net_ping_http.rb
|
@@ -90,29 +96,30 @@ files:
|
|
90
96
|
- test/test_net_ping_tcp.rb
|
91
97
|
- test/test_net_ping_udp.rb
|
92
98
|
- test/test_net_ping_wmi.rb
|
93
|
-
homepage: https://github.com/
|
99
|
+
homepage: https://github.com/chernesk/net-ping
|
94
100
|
licenses:
|
95
101
|
- Artistic 2.0
|
96
|
-
metadata: {}
|
97
102
|
post_install_message:
|
98
103
|
rdoc_options: []
|
99
104
|
require_paths:
|
100
105
|
- lib
|
101
106
|
required_ruby_version: !ruby/object:Gem::Requirement
|
107
|
+
none: false
|
102
108
|
requirements:
|
103
|
-
- -
|
109
|
+
- - ! '>='
|
104
110
|
- !ruby/object:Gem::Version
|
105
111
|
version: 1.9.3
|
106
112
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
107
114
|
requirements:
|
108
|
-
- -
|
115
|
+
- - ! '>='
|
109
116
|
- !ruby/object:Gem::Version
|
110
117
|
version: '0'
|
111
118
|
requirements: []
|
112
119
|
rubyforge_project:
|
113
|
-
rubygems_version:
|
120
|
+
rubygems_version: 1.8.23.2
|
114
121
|
signing_key:
|
115
|
-
specification_version:
|
122
|
+
specification_version: 3
|
116
123
|
summary: A ping interface for Ruby.
|
117
124
|
test_files:
|
118
125
|
- test/test_net_ping.rb
|
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: 96c46fa2d17c2e28a06b71883b77a7a5a67f8ceb
|
4
|
-
data.tar.gz: 8866c7f3dd99b1206be6d1de5af8c1c55e6e046e
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: 2c74009e6ff5a7c497f7286260b7aa8570a669747943eb337f8850cbf111516a70bf8d74742bb697680c258c3dddc2f22e840dd5c2da3b23d6ff0e81d3db1022
|
7
|
-
data.tar.gz: a2735b50295f1d9e2a3f359341777f951dca9c6e4e415f4f816358d35e399f0fe771e4093ec57131e8720b18d93c0e4b5e9c9ed5ad993caf3f5e77be7a9189c2
|