net-ping 1.5.0 → 1.5.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +4 -0
- data/README +3 -3
- data/Rakefile +1 -1
- data/lib/net/ping.rb +3 -1
- data/lib/net/ping/external.rb +5 -3
- data/lib/net/ping/ping.rb +1 -1
- data/net-ping.gemspec +1 -1
- data/test/test_net_ping.rb +1 -1
- data/test/test_net_ping_external.rb +2 -2
- metadata +23 -25
data/CHANGES
CHANGED
data/README
CHANGED
@@ -2,9 +2,9 @@
|
|
2
2
|
A collection of classes that provide different ways to ping computers.
|
3
3
|
|
4
4
|
== Prerequisites
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
The win32-open3 (1.8.x) and windows-pr libraries are required on
|
6
|
+
MS Windows when using the Net::Ping::External class unless you're
|
7
|
+
using JRuby.
|
8
8
|
|
9
9
|
== Installation
|
10
10
|
gem install net-ping
|
data/Rakefile
CHANGED
data/lib/net/ping.rb
CHANGED
@@ -11,6 +11,8 @@ require File.join(File.dirname(__FILE__), 'ping/external')
|
|
11
11
|
require File.join(File.dirname(__FILE__), 'ping/http')
|
12
12
|
require File.join(File.dirname(__FILE__), 'ping/ldap')
|
13
13
|
|
14
|
-
|
14
|
+
RbConfig = Config unless Object.const_defined?(:RbConfig)
|
15
|
+
|
16
|
+
if RbConfig::CONFIG['host_os'] =~ /msdos|mswin|cygwin|mingw|win32|windows/i
|
15
17
|
require File.join(File.dirname(__FILE__), 'ping/wmi')
|
16
18
|
end
|
data/lib/net/ping/external.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
require 'rbconfig'
|
2
2
|
require File.join(File.dirname(__FILE__), 'ping')
|
3
3
|
|
4
|
-
|
4
|
+
RbConfig = Config unless Object.const_defined?(:RbConfig)
|
5
|
+
|
6
|
+
if RbConfig::CONFIG['host_os'] =~ /mswin|win32|msdos|cygwin|mingw|windows/i &&
|
5
7
|
RUBY_PLATFORM != 'java'
|
6
8
|
then
|
7
9
|
if RUBY_VERSION.to_f < 1.9
|
@@ -18,7 +20,7 @@ module Net
|
|
18
20
|
# The Ping::External class encapsulates methods for external (system) pings.
|
19
21
|
class Ping::External < Ping
|
20
22
|
|
21
|
-
CWINDOWS =
|
23
|
+
CWINDOWS = RbConfig::CONFIG['host_os'] =~ /mswin|win32|msdos|cygwin|mingw|windows/i &&
|
22
24
|
RUBY_PLATFORM != 'java'
|
23
25
|
|
24
26
|
if CWINDOWS
|
@@ -40,7 +42,7 @@ module Net
|
|
40
42
|
bool = false
|
41
43
|
orig_cp = nil
|
42
44
|
|
43
|
-
case
|
45
|
+
case RbConfig::CONFIG['host_os']
|
44
46
|
when /linux|bsd|osx|mach|darwin/i
|
45
47
|
pstring += "-c 1 #{host}"
|
46
48
|
when /solaris|sunos/i
|
data/lib/net/ping/ping.rb
CHANGED
data/net-ping.gemspec
CHANGED
data/test/test_net_ping.rb
CHANGED
@@ -12,7 +12,7 @@ require 'net/ping/external'
|
|
12
12
|
|
13
13
|
class TC_Net_Ping_External < Test::Unit::TestCase
|
14
14
|
def setup
|
15
|
-
@host = '
|
15
|
+
@host = 'localhost'
|
16
16
|
@bogus = 'foo.bar.baz'
|
17
17
|
@pe = Net::Ping::External.new(@host)
|
18
18
|
@bad = Net::Ping::External.new(@bogus)
|
@@ -68,7 +68,7 @@ class TC_Net_Ping_External < Test::Unit::TestCase
|
|
68
68
|
|
69
69
|
test "host getter basic functionality" do
|
70
70
|
assert_respond_to(@pe, :host)
|
71
|
-
assert_equal('
|
71
|
+
assert_equal('localhost', @pe.host)
|
72
72
|
end
|
73
73
|
|
74
74
|
test "host setter basic functionality" do
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: net-ping
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 1
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 1.5.
|
9
|
+
- 1
|
10
|
+
version: 1.5.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Daniel J. Berger
|
@@ -15,8 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
19
|
-
default_executable:
|
18
|
+
date: 2011-09-15 00:00:00 Z
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
22
21
|
name: net-ldap
|
@@ -93,35 +92,34 @@ extra_rdoc_files:
|
|
93
92
|
- CHANGES
|
94
93
|
- doc/ping.txt
|
95
94
|
files:
|
96
|
-
-
|
97
|
-
- README
|
95
|
+
- CHANGES
|
98
96
|
- doc/ping.txt
|
99
|
-
-
|
97
|
+
- examples/example_pingexternal.rb
|
98
|
+
- examples/example_pinghttp.rb
|
99
|
+
- examples/example_pingldap.rb
|
100
|
+
- examples/example_pingtcp.rb
|
101
|
+
- examples/example_pingudp.rb
|
100
102
|
- lib/net/ping/external.rb
|
103
|
+
- lib/net/ping/http.rb
|
101
104
|
- lib/net/ping/icmp.rb
|
102
|
-
- lib/net/ping/wmi.rb
|
103
|
-
- lib/net/ping/udp.rb
|
104
|
-
- lib/net/ping/ping.rb
|
105
105
|
- lib/net/ping/ldap.rb
|
106
|
-
- lib/net/ping/
|
106
|
+
- lib/net/ping/ping.rb
|
107
107
|
- lib/net/ping/tcp.rb
|
108
|
+
- lib/net/ping/udp.rb
|
109
|
+
- lib/net/ping/wmi.rb
|
110
|
+
- lib/net/ping.rb
|
111
|
+
- MANIFEST
|
108
112
|
- net-ping.gemspec
|
109
|
-
-
|
110
|
-
-
|
111
|
-
-
|
112
|
-
-
|
113
|
-
- examples/example_pingtcp.rb
|
114
|
-
- examples/example_pingudp.rb
|
115
|
-
- test/test_net_ping_ldap.rb
|
113
|
+
- Rakefile
|
114
|
+
- README
|
115
|
+
- test/test_net_ping.rb
|
116
|
+
- test/test_net_ping_external.rb
|
116
117
|
- test/test_net_ping_http.rb
|
117
118
|
- test/test_net_ping_icmp.rb
|
119
|
+
- test/test_net_ping_ldap.rb
|
120
|
+
- test/test_net_ping_tcp.rb
|
118
121
|
- test/test_net_ping_udp.rb
|
119
122
|
- test/test_net_ping_wmi.rb
|
120
|
-
- test/test_net_ping_external.rb
|
121
|
-
- test/test_net_ping_tcp.rb
|
122
|
-
- test/test_net_ping.rb
|
123
|
-
- MANIFEST
|
124
|
-
has_rdoc: true
|
125
123
|
homepage: http://www.rubyforge.org/projects/shards
|
126
124
|
licenses:
|
127
125
|
- Artistic 2.0
|
@@ -151,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
151
149
|
requirements: []
|
152
150
|
|
153
151
|
rubyforge_project: shards
|
154
|
-
rubygems_version: 1.
|
152
|
+
rubygems_version: 1.8.10
|
155
153
|
signing_key:
|
156
154
|
specification_version: 3
|
157
155
|
summary: A ping interface for Ruby.
|