uv-rays 2.4.2 → 2.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/handsoap/http/drivers/libuv_driver.rb +2 -1
- data/lib/uv-rays/abstract_tokenizer.rb +2 -1
- data/lib/uv-rays/buffered_tokenizer.rb +2 -1
- data/lib/uv-rays/http/encoding.rb +2 -1
- data/lib/uv-rays/http/request.rb +2 -1
- data/lib/uv-rays/ping.rb +9 -10
- data/lib/uv-rays/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ac99b3a330ca5bfc8fe016bc54964d44d08d99b
|
4
|
+
data.tar.gz: 627e6c91f709177583e5b6765818bdc5a26e421a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bbdece8b735398ad284e1fc0b276499182fe29385c4ddf88006c30556a3559ebad4a5891746878067c48f3662f45614c19f346a1c8a5358414b3b43185bd65bb
|
7
|
+
data.tar.gz: b52f64f717ee012a47e52b20a4d5936f06ded055fe6f1bc1d6deb70efa52023076d57ddfab6e261af1af89fa615bdc06e2f9ffa414ba8a866bb9868e8b7afa5f
|
data/lib/uv-rays/http/request.rb
CHANGED
data/lib/uv-rays/ping.rb
CHANGED
@@ -11,11 +11,10 @@ class UV::Ping
|
|
11
11
|
def initialize(host, count: 1, interval: 1, timeout: 5)
|
12
12
|
@host = host
|
13
13
|
@count = count
|
14
|
-
@interval = interval
|
15
14
|
@timeout = timeout
|
16
15
|
end
|
17
16
|
|
18
|
-
attr_reader :host, :ip, :count, :
|
17
|
+
attr_reader :host, :ip, :count, :timeout, :exception, :warning, :duration, :pingable
|
19
18
|
|
20
19
|
def ping
|
21
20
|
@ip = if IPAddress.valid?(@host)
|
@@ -32,9 +31,9 @@ class UV::Ping
|
|
32
31
|
|
33
32
|
ipaddr = IPAddr.new @ip
|
34
33
|
if ipaddr.ipv4?
|
35
|
-
ping4(@ip, @count, @
|
34
|
+
ping4(@ip, @count, @timeout)
|
36
35
|
else
|
37
|
-
ping6(@ip, @count, @
|
36
|
+
ping6(@ip, @count, @timeout)
|
38
37
|
end
|
39
38
|
end
|
40
39
|
|
@@ -55,13 +54,13 @@ class UV::Ping
|
|
55
54
|
value
|
56
55
|
end
|
57
56
|
|
58
|
-
def ping4(host, count,
|
57
|
+
def ping4(host, count, timeout)
|
59
58
|
pargs = nil
|
60
59
|
bool = false
|
61
60
|
|
62
61
|
case ::RbConfig::CONFIG['host_os']
|
63
62
|
when /linux/i
|
64
|
-
pargs = ['-c', count.to_s, '-W', timeout.to_s, host
|
63
|
+
pargs = ['-c', count.to_s, '-W', timeout.to_s, host]
|
65
64
|
when /aix/i
|
66
65
|
pargs = ['-c', count.to_s, '-w', timeout.to_s, host]
|
67
66
|
when /bsd|osx|mach|darwin/i
|
@@ -100,7 +99,7 @@ class UV::Ping
|
|
100
99
|
@exception = err.chomp
|
101
100
|
else
|
102
101
|
info.each_line do |line|
|
103
|
-
if line =~ /(timed out|could not find host|packet loss)/i
|
102
|
+
if line =~ /(timed out|could not find host|bad address|packet loss)/i
|
104
103
|
@exception = line.chomp
|
105
104
|
break
|
106
105
|
end
|
@@ -113,13 +112,13 @@ class UV::Ping
|
|
113
112
|
bool
|
114
113
|
end
|
115
114
|
|
116
|
-
def ping6(host, count,
|
115
|
+
def ping6(host, count, timeout)
|
117
116
|
pargs = nil
|
118
117
|
bool = false
|
119
118
|
|
120
119
|
case RbConfig::CONFIG['host_os']
|
121
120
|
when /linux/i
|
122
|
-
pargs =['-c', count.to_s, '-W', timeout.to_s,
|
121
|
+
pargs =['-c', count.to_s, '-W', timeout.to_s, host]
|
123
122
|
when /aix/i
|
124
123
|
pargs =['-c', count.to_s, '-w', timeout.to_s, host]
|
125
124
|
when /bsd|osx|mach|darwin/i
|
@@ -158,7 +157,7 @@ class UV::Ping
|
|
158
157
|
@exception = err.chomp
|
159
158
|
else
|
160
159
|
info.each_line do |line|
|
161
|
-
if line =~ /(timed out|could not find host|packet loss)/i
|
160
|
+
if line =~ /(timed out|could not find host|bad address|packet loss)/i
|
162
161
|
@exception = line.chomp
|
163
162
|
break
|
164
163
|
end
|
data/lib/uv-rays/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uv-rays
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen von Takach
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-05-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: libuv
|