net-ping 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +7 -0
- data/README +6 -0
- data/doc/ping.txt +3 -1
- data/lib/net/ping/external.rb +6 -7
- data/lib/net/ping/http.rb +0 -3
- data/lib/net/ping/icmp.rb +0 -3
- data/lib/net/ping/ping.rb +1 -1
- data/lib/net/ping/tcp.rb +0 -3
- data/lib/net/ping/udp.rb +0 -3
- data/net-ping.gemspec +16 -12
- data/test/test_net_ping_external.rb +1 -1
- data/test/test_net_ping_http.rb +1 -1
- data/test/test_net_ping_icmp.rb +1 -1
- data/test/test_net_ping_tcp.rb +9 -9
- data/test/test_net_ping_udp.rb +1 -1
- metadata +7 -7
data/CHANGES
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
== 1.3.1 - 22-Jul-2009
|
2
|
+
* Removed class aliases, e.g. use Ping::External, not PingExternal.
|
3
|
+
* Minor code change to eliminate a warning that popped up in 1.9.x.
|
4
|
+
* The win32-open3 library is removed as a dependency for Ruby 1.9.x.
|
5
|
+
* Changed license to Artistic 2.0.
|
6
|
+
* Some gemspec and README updates.
|
7
|
+
|
1
8
|
== 1.3.0 - 19-May-2009
|
2
9
|
* Added the Ping::WMI class for MS Windows. This class encapsulates the
|
3
10
|
Win32_PingStatus WMI class. Unlike other ping methods, this one returns
|
data/README
CHANGED
@@ -35,6 +35,12 @@
|
|
35
35
|
not to mention backwards compatible. The latter has the advantage of
|
36
36
|
reducing your memory footprint.
|
37
37
|
|
38
|
+
== Known Issues
|
39
|
+
Older versions of Ruby 1.9.x may not work with UDP pings.
|
40
|
+
|
41
|
+
== License
|
42
|
+
Artistic 2.0
|
43
|
+
|
38
44
|
== More documentation
|
39
45
|
If you installed this library via Rubygems, you can view the inline
|
40
46
|
documentation via ri or fire up 'gem server', and point your browser at
|
data/doc/ping.txt
CHANGED
@@ -221,6 +221,8 @@ Ping#warning
|
|
221
221
|
known issues. This may cause the Ping::ICMP class to fail. In fact, I
|
222
222
|
make an effort to skip those tests if I detect the one-click installer.
|
223
223
|
|
224
|
+
UDP pings may not work with older versions of Ruby 1.9.x.
|
225
|
+
|
224
226
|
Please report any bugs on the project page at
|
225
227
|
http://www.rubyforge.org/projects/shards.
|
226
228
|
|
@@ -233,7 +235,7 @@ Ping#warning
|
|
233
235
|
Add support for syn pings.
|
234
236
|
|
235
237
|
= License
|
236
|
-
|
238
|
+
Artistic 2.0
|
237
239
|
|
238
240
|
= Copyright
|
239
241
|
(C) 2003-2009 Daniel J. Berger, All Rights Reserved
|
data/lib/net/ping/external.rb
CHANGED
@@ -2,7 +2,9 @@ $LOAD_PATH.unshift File.dirname(__FILE__)
|
|
2
2
|
require 'ping'
|
3
3
|
|
4
4
|
if RUBY_PLATFORM.match('mswin')
|
5
|
-
|
5
|
+
if RUBY_VERSION.to_f < 1.9
|
6
|
+
require 'win32/open3'
|
7
|
+
end
|
6
8
|
require 'windows/console'
|
7
9
|
include Windows::Console
|
8
10
|
else
|
@@ -80,9 +82,9 @@ module Net
|
|
80
82
|
request\ timed\ out|
|
81
83
|
100%\ packet\ loss
|
82
84
|
/ix
|
83
|
-
lines.each{ |
|
84
|
-
if regexp.match(
|
85
|
-
@exception =
|
85
|
+
lines.each{ |line|
|
86
|
+
if regexp.match(line)
|
87
|
+
@exception = line.chomp
|
86
88
|
break
|
87
89
|
end
|
88
90
|
}
|
@@ -106,7 +108,4 @@ module Net
|
|
106
108
|
alias ping? ping
|
107
109
|
alias pingecho ping
|
108
110
|
end
|
109
|
-
|
110
|
-
# Class alias for backwards compatibility.
|
111
|
-
PingExternal = Ping::External
|
112
111
|
end
|
data/lib/net/ping/http.rb
CHANGED
data/lib/net/ping/icmp.rb
CHANGED
data/lib/net/ping/ping.rb
CHANGED
data/lib/net/ping/tcp.rb
CHANGED
data/lib/net/ping/udp.rb
CHANGED
data/net-ping.gemspec
CHANGED
@@ -2,7 +2,8 @@ require 'rubygems'
|
|
2
2
|
|
3
3
|
spec = Gem::Specification.new do |gem|
|
4
4
|
gem.name = 'net-ping'
|
5
|
-
gem.version = '1.3.
|
5
|
+
gem.version = '1.3.1'
|
6
|
+
gem.license = 'Artistic 2.0'
|
6
7
|
gem.author = 'Daniel J. Berger'
|
7
8
|
gem.email = 'djberg96@gmail.com'
|
8
9
|
gem.homepage = 'http://www.rubyforge.org/projects/shards'
|
@@ -13,23 +14,26 @@ spec = Gem::Specification.new do |gem|
|
|
13
14
|
gem.files = Dir['**/*'].reject{ |f| f.include?('CVS') }
|
14
15
|
gem.extra_rdoc_files = ['README', 'CHANGES', 'doc/ping.txt']
|
15
16
|
|
16
|
-
gem.add_dependency('test-unit', '>= 2.0.
|
17
|
+
gem.add_dependency('test-unit', '>= 2.0.3')
|
17
18
|
|
18
19
|
case RUBY_PLATFORM
|
19
|
-
when /mswin/i
|
20
|
+
when /mswin|dos|win32/i
|
20
21
|
gem.platform = Gem::Platform::CURRENT
|
21
|
-
gem.add_dependency('windows-pr', '>= 0.
|
22
|
-
|
22
|
+
gem.add_dependency('windows-pr', '>= 1.0.6') # Net::Ping::External
|
23
|
+
|
24
|
+
if RUBY_VERSION.to_f < 1.9
|
25
|
+
gem.add_dependency('win32-open3', '>= 0.3.0') # Net::Ping::External
|
26
|
+
end
|
23
27
|
else
|
24
28
|
gem.platform = Gem::Platform::RUBY
|
25
29
|
end
|
26
30
|
|
27
|
-
description =
|
28
|
-
|
29
|
-
|
31
|
+
gem.description = <<-EOF
|
32
|
+
The net-ping library provides a ping interface for Ruby. It includes
|
33
|
+
separate TCP, HTTP, ICMP, UDP, WMI (for Windows) and external ping
|
34
|
+
classes.
|
35
|
+
EOF
|
30
36
|
end
|
31
37
|
|
32
|
-
if
|
33
|
-
|
34
|
-
Gem::Builder.new(spec).build
|
35
|
-
end
|
38
|
+
Gem.manage_gems if Gem::RubyGemsVersion.to_f < 1.0
|
39
|
+
Gem::Builder.new(spec).build
|
data/test/test_net_ping_http.rb
CHANGED
data/test/test_net_ping_icmp.rb
CHANGED
data/test/test_net_ping_tcp.rb
CHANGED
@@ -19,7 +19,7 @@ class TC_PingTCP < Test::Unit::TestCase
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def test_version
|
22
|
-
assert_equal('1.3.
|
22
|
+
assert_equal('1.3.1', Ping::TCP::VERSION)
|
23
23
|
end
|
24
24
|
|
25
25
|
def test_ping
|
@@ -47,25 +47,25 @@ class TC_PingTCP < Test::Unit::TestCase
|
|
47
47
|
|
48
48
|
def test_ping_service_check_true
|
49
49
|
msg = "+this test may fail depending on your network environment+"
|
50
|
-
|
50
|
+
Ping::TCP.service_check = true
|
51
51
|
assert_equal(true, @tcp.ping?, msg)
|
52
52
|
end
|
53
53
|
|
54
54
|
def test_service_check
|
55
|
-
assert_respond_to(
|
56
|
-
assert_respond_to(
|
55
|
+
assert_respond_to(Ping::TCP, :service_check)
|
56
|
+
assert_respond_to(Ping::TCP, :service_check=)
|
57
57
|
end
|
58
58
|
|
59
59
|
# These will be removed eventually
|
60
60
|
def test_service_check_aliases
|
61
|
-
assert_respond_to(
|
62
|
-
assert_respond_to(
|
63
|
-
assert_respond_to(
|
64
|
-
assert_respond_to(
|
61
|
+
assert_respond_to(Ping::TCP, :econnrefused)
|
62
|
+
assert_respond_to(Ping::TCP, :econnrefused=)
|
63
|
+
assert_respond_to(Ping::TCP, :ecr)
|
64
|
+
assert_respond_to(Ping::TCP, :ecr=)
|
65
65
|
end
|
66
66
|
|
67
67
|
def test_service_check_expected_errors
|
68
|
-
assert_raises(ArgumentError){
|
68
|
+
assert_raises(ArgumentError){ Ping::TCP.service_check = "blah" }
|
69
69
|
end
|
70
70
|
|
71
71
|
# If the ping failed, the duration will be nil
|
data/test/test_net_ping_udp.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: net-ping
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel J. Berger
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-07-22 00:00:00 -06:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -20,9 +20,9 @@ dependencies:
|
|
20
20
|
requirements:
|
21
21
|
- - ">="
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: 2.0.
|
23
|
+
version: 2.0.3
|
24
24
|
version:
|
25
|
-
description:
|
25
|
+
description: " The net-ping library provides a ping interface for Ruby. It includes\n separate TCP, HTTP, ICMP, UDP, WMI (for Windows) and external ping\n classes.\n"
|
26
26
|
email: djberg96@gmail.com
|
27
27
|
executables: []
|
28
28
|
|
@@ -60,8 +60,8 @@ files:
|
|
60
60
|
- test/test_net_ping_wmi.rb
|
61
61
|
has_rdoc: true
|
62
62
|
homepage: http://www.rubyforge.org/projects/shards
|
63
|
-
licenses:
|
64
|
-
|
63
|
+
licenses:
|
64
|
+
- Artistic 2.0
|
65
65
|
post_install_message:
|
66
66
|
rdoc_options: []
|
67
67
|
|
@@ -82,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
82
82
|
requirements: []
|
83
83
|
|
84
84
|
rubyforge_project: shards
|
85
|
-
rubygems_version: 1.3.
|
85
|
+
rubygems_version: 1.3.4
|
86
86
|
signing_key:
|
87
87
|
specification_version: 3
|
88
88
|
summary: A ping interface for Ruby.
|