net-ping 1.7.5 → 1.7.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES +4 -0
- data/Rakefile +5 -1
- data/lib/net/ping.rb +6 -6
- data/lib/net/ping/ping.rb +1 -1
- data/lib/net/ping/tcp.rb +14 -8
- data/net-ping.gemspec +2 -2
- data/test/test_net_ping.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96c46fa2d17c2e28a06b71883b77a7a5a67f8ceb
|
4
|
+
data.tar.gz: 8866c7f3dd99b1206be6d1de5af8c1c55e6e046e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c74009e6ff5a7c497f7286260b7aa8570a669747943eb337f8850cbf111516a70bf8d74742bb697680c258c3dddc2f22e840dd5c2da3b23d6ff0e81d3db1022
|
7
|
+
data.tar.gz: a2735b50295f1d9e2a3f359341777f951dca9c6e4e415f4f816358d35e399f0fe771e4093ec57131e8720b18d93c0e4b5e9c9ed5ad993caf3f5e77be7a9189c2
|
data/CHANGES
CHANGED
data/Rakefile
CHANGED
@@ -20,7 +20,11 @@ namespace 'gem' do
|
|
20
20
|
desc 'Install the net-ping gem'
|
21
21
|
task :install => [:create] do
|
22
22
|
gem_file = Dir["*.gem"].first
|
23
|
-
|
23
|
+
if RUBY_PLATFORM == 'java'
|
24
|
+
sh "jruby -S gem install -l #{gem_file}"
|
25
|
+
else
|
26
|
+
sh "gem install -l #{gem_file}"
|
27
|
+
end
|
24
28
|
end
|
25
29
|
end
|
26
30
|
|
data/lib/net/ping.rb
CHANGED
@@ -4,14 +4,14 @@
|
|
4
4
|
#
|
5
5
|
require 'rbconfig'
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
7
|
+
require_relative 'ping/tcp'
|
8
|
+
require_relative 'ping/udp'
|
9
|
+
require_relative 'ping/icmp'
|
10
|
+
require_relative 'ping/external'
|
11
|
+
require_relative 'ping/http'
|
12
12
|
|
13
13
|
RbConfig = Config unless Object.const_defined?(:RbConfig)
|
14
14
|
|
15
15
|
if File::ALT_SEPARATOR
|
16
|
-
|
16
|
+
require_relative 'ping/wmi'
|
17
17
|
end
|
data/lib/net/ping/ping.rb
CHANGED
data/lib/net/ping/tcp.rb
CHANGED
@@ -68,17 +68,23 @@ module Net
|
|
68
68
|
|
69
69
|
resp = IO.select(nil, [sock], nil, timeout)
|
70
70
|
|
71
|
-
if
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
71
|
+
if resp.nil? # Assume ECONNREFUSED if nil
|
72
|
+
if @@service_check
|
73
|
+
bool = true
|
74
|
+
else
|
75
|
+
bool = false
|
76
|
+
@exception = Errno::ECONNREFUSED
|
77
|
+
end
|
76
78
|
else
|
77
79
|
sockopt = sock.getsockopt(Socket::SOL_SOCKET, Socket::SO_ERROR)
|
78
80
|
|
79
|
-
|
80
|
-
|
81
|
-
|
81
|
+
if sockopt.int != 0
|
82
|
+
if @@service_check && sockopt.int == Errno::ECONNREFUSED::Errno
|
83
|
+
bool = true
|
84
|
+
else
|
85
|
+
bool = false
|
86
|
+
@exception = SystemCallError.new(sockopt.int)
|
87
|
+
end
|
82
88
|
else
|
83
89
|
bool = true
|
84
90
|
end
|
data/net-ping.gemspec
CHANGED
@@ -3,7 +3,7 @@ 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.6'
|
7
7
|
spec.license = 'Artistic 2.0'
|
8
8
|
spec.author = 'Daniel J. Berger'
|
9
9
|
spec.email = 'djberg96@gmail.com'
|
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
|
|
23
23
|
|
24
24
|
if File::ALT_SEPARATOR
|
25
25
|
require 'rbconfig'
|
26
|
-
arch = RbConfig::CONFIG['build_os']
|
26
|
+
arch = RbConfig::CONFIG['build_os'] || 'mingw32' # JRuby
|
27
27
|
spec.platform = Gem::Platform.new(['universal', arch])
|
28
28
|
spec.platform.version = nil
|
29
29
|
|
data/test/test_net_ping.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel J. Berger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-12-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: test-unit
|
@@ -110,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
110
|
version: '0'
|
111
111
|
requirements: []
|
112
112
|
rubyforge_project:
|
113
|
-
rubygems_version: 2.
|
113
|
+
rubygems_version: 2.4.5
|
114
114
|
signing_key:
|
115
115
|
specification_version: 4
|
116
116
|
summary: A ping interface for Ruby.
|