ping-rb 0.2.2 → 0.2.3
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.
- checksums.yaml +4 -4
- data/lib/ping-rb.rb +64 -40
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9d360ddbe9b6d5b06ca72a8645a469e8b3a5803e8cd03e087295b0b7243396b
|
4
|
+
data.tar.gz: 21b13a2c0588618f94408028f6b7432da881f9bb5145e54bc3d092dba664f200
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f958f32d88a5d2bf8e7f5def7a9a1d18af32e3bcbcd3dbf7674d8e88230a69138979808a81748b69228dff9fc3b06378c55d2d7d16e9d9910c40894b0c7c6d3
|
7
|
+
data.tar.gz: a89d4f542c845268dbed564453ff19789c3cb8c0d4404fb1f931476ed822757c28cbfa98db4116e1194ec7def2e407afab9076d9014ee7f297a0372b2bef39e3
|
data/lib/ping-rb.rb
CHANGED
@@ -14,9 +14,11 @@ OptionParser.new do |opts|
|
|
14
14
|
4.times do
|
15
15
|
check = Net::Ping::External.new(host_external_option)
|
16
16
|
if check.ping? == true
|
17
|
-
puts "
|
17
|
+
puts "\aADDRESS IS " + host_external_option.to_s.colorize(:light_blue) + "| STATUS IS " + "UP".colorize(:green)
|
18
|
+
sleep 1
|
18
19
|
else
|
19
|
-
puts "
|
20
|
+
puts "\aADDRESS IS " + host_external_option.to_s.colorize(:light_blue) + "| STATUS IS " + "DOWN".colorize(:red)
|
21
|
+
sleep 1
|
20
22
|
end
|
21
23
|
end
|
22
24
|
end
|
@@ -27,9 +29,11 @@ OptionParser.new do |opts|
|
|
27
29
|
4.times do
|
28
30
|
check = Net::Ping::External.new(host_http_option)
|
29
31
|
if check.ping? == true
|
30
|
-
puts "
|
32
|
+
puts "\aADDRESS IS " + host_http_option.to_s.colorize(:light_blue) + "| STATUS IS " + "UP".colorize(:green)
|
33
|
+
sleep 1
|
31
34
|
else
|
32
|
-
puts "
|
35
|
+
puts "\aADDRESS IS " + host_http_option.to_s.colorize(:light_blue) + "| STATUS IS " + "DOWN".colorize(:red)
|
36
|
+
sleep 1
|
33
37
|
end
|
34
38
|
end
|
35
39
|
end
|
@@ -40,9 +44,11 @@ OptionParser.new do |opts|
|
|
40
44
|
4.to_i.times do
|
41
45
|
check = Net::Ping::External.new(host_tcp_option)
|
42
46
|
if check.ping? == true
|
43
|
-
puts "
|
47
|
+
puts "\aADDRESS IS " + host_tcp_option.to_s.colorize(:light_blue) + "| STATUS IS " + "UP".colorize(:green)
|
48
|
+
sleep 1
|
44
49
|
else
|
45
|
-
puts "
|
50
|
+
puts "\aADDRESS IS " + host_tcp_option.to_s.colorize(:light_blue) + "| STATUS IS " + "DOWN".colorize(:red)
|
51
|
+
sleep 1
|
46
52
|
end
|
47
53
|
end
|
48
54
|
end
|
@@ -53,9 +59,11 @@ OptionParser.new do |opts|
|
|
53
59
|
4.to_i.times do
|
54
60
|
check = Net::Ping::External.new(host_udp_option)
|
55
61
|
if check.ping? == true
|
56
|
-
puts "
|
62
|
+
puts "\aADDRESS IS " + host_udp_option.to_s.colorize(:light_blue) + "| STATUS IS " + "UP".colorize(:green)
|
63
|
+
sleep 1
|
57
64
|
else
|
58
|
-
puts "
|
65
|
+
puts "\aADDRESS IS " + host_udp_option.to_s.colorize(:light_blue) + "| STATUS IS " + "DOWN".colorize(:red)
|
66
|
+
sleep 1
|
59
67
|
end
|
60
68
|
end
|
61
69
|
end
|
@@ -67,8 +75,10 @@ OptionParser.new do |opts|
|
|
67
75
|
check = Net::Ping::External.new(host_external_loop_option)
|
68
76
|
if check.ping? == true
|
69
77
|
puts "ADDRESS IS " + host_external_loop_option.to_s.colorize(:light_blue) + "| STATUS IS " + "UP".colorize(:green)
|
78
|
+
sleep 1
|
70
79
|
else
|
71
80
|
puts "ADDRESS IS " + host_external_loop_option.to_s.colorize(:light_blue) + "| STATUS IS " + "DOWN".colorize(:red)
|
81
|
+
sleep 1
|
72
82
|
end
|
73
83
|
end
|
74
84
|
end
|
@@ -80,8 +90,10 @@ OptionParser.new do |opts|
|
|
80
90
|
check = Net::Ping::External.new(host_http_loop_option)
|
81
91
|
if check.ping? == true
|
82
92
|
puts "ADDRESS IS " + host_http_loop_option.to_s.colorize(:light_blue) + "| STATUS IS " + "UP".colorize(:green)
|
93
|
+
sleep 1
|
83
94
|
else
|
84
95
|
puts "ADDRESS IS " + host_http_loop_option.to_s.colorize(:light_blue) + "| STATUS IS " + "DOWN".colorize(:red)
|
96
|
+
sleep 1
|
85
97
|
end
|
86
98
|
end
|
87
99
|
end
|
@@ -93,8 +105,10 @@ OptionParser.new do |opts|
|
|
93
105
|
check = Net::Ping::External.new(host_tcp_loop_option)
|
94
106
|
if check.ping? == true
|
95
107
|
puts "ADDRESS IS " + host_tcp_loop_option.to_s.colorize(:light_blue) + "| STATUS IS " + "UP".colorize(:green)
|
108
|
+
sleep 1
|
96
109
|
else
|
97
110
|
puts "ADDRESS IS " + host_tcp_loop_option.to_s.colorize(:light_blue) + "| STATUS IS " + "DOWN".colorize(:red)
|
111
|
+
sleep 1
|
98
112
|
end
|
99
113
|
end
|
100
114
|
end
|
@@ -106,8 +120,10 @@ OptionParser.new do |opts|
|
|
106
120
|
check = Net::Ping::External.new(host_udp_loop_option)
|
107
121
|
if check.ping? == true
|
108
122
|
puts "ADDRESS IS " + host_udp_loop_option.to_s.colorize(:light_blue) + "| STATUS IS " + "UP".colorize(:green)
|
123
|
+
sleep 1
|
109
124
|
else
|
110
125
|
puts "ADDRESS IS " + host_udp_loop_option.to_s.colorize(:light_blue) + "| STATUS IS " + "DOWN".colorize(:red)
|
126
|
+
sleep 1
|
111
127
|
end
|
112
128
|
end
|
113
129
|
end
|
@@ -116,24 +132,26 @@ OptionParser.new do |opts|
|
|
116
132
|
opts.on('--verbose-e NAME', 'Verbose output for External ping') do |host_verbose_external_option|
|
117
133
|
check = Net::Ping::External.new(host_verbose_external_option)
|
118
134
|
if check.ping? == true
|
119
|
-
puts host_verbose_external_option.to_s.colorize(:light_blue)
|
120
|
-
|
135
|
+
puts "Address: " + host_verbose_external_option.to_s.colorize(:light_blue)
|
136
|
+
puts "Status: " + "UP".colorize(:green)
|
137
|
+
print 'Timeout: '
|
121
138
|
p check.timeout
|
122
|
-
print 'Duration:'
|
139
|
+
print 'Duration: '
|
123
140
|
p check.duration
|
124
|
-
print 'Port:'
|
141
|
+
print 'Port: '
|
125
142
|
p check.port
|
126
143
|
print 'warning: '
|
127
144
|
p check.warning
|
128
145
|
print 'Exception: '
|
129
146
|
p check.exception
|
130
147
|
else
|
131
|
-
puts host_verbose_external_option.to_s.colorize(:light_blue)
|
132
|
-
|
148
|
+
puts "Address: " + host_verbose_external_option.to_s.colorize(:light_blue)
|
149
|
+
puts "Status: " + "DOWN".colorize(:red)
|
150
|
+
print 'Timeout: '
|
133
151
|
p check.timeout
|
134
|
-
print 'Duration:'
|
152
|
+
print 'Duration: '
|
135
153
|
p check.duration
|
136
|
-
print 'Port:'
|
154
|
+
print 'Port: '
|
137
155
|
p check.port
|
138
156
|
print 'warning: '
|
139
157
|
p check.warning
|
@@ -146,24 +164,26 @@ OptionParser.new do |opts|
|
|
146
164
|
opts.on('--verbose-h NAME', 'Verbose output for HTTP ping') do |host_verbose_http_option|
|
147
165
|
check = Net::Ping::HTTP.new(host_verbose_http_option)
|
148
166
|
if check.ping? == true
|
149
|
-
puts host_verbose_http_option.to_s.colorize(:light_blue)
|
150
|
-
|
167
|
+
puts "Address: " + host_verbose_http_option.to_s.colorize(:light_blue)
|
168
|
+
puts "Status: " + "UP".colorize(:green)
|
169
|
+
print 'Timeout: '
|
151
170
|
p check.timeout
|
152
|
-
print 'Duration:'
|
171
|
+
print 'Duration: '
|
153
172
|
p check.duration
|
154
|
-
print 'Port:'
|
173
|
+
print 'Port: '
|
155
174
|
p check.port
|
156
175
|
print 'warning: '
|
157
176
|
p check.warning
|
158
177
|
print 'Exception: '
|
159
178
|
p check.exception
|
160
179
|
else
|
161
|
-
puts host_verbose_http_option.to_s.colorize(:light_blue)
|
162
|
-
|
180
|
+
puts "Address: " + host_verbose_http_option.to_s.colorize(:light_blue)
|
181
|
+
puts "Status: " + "DOWN".colorize(:red)
|
182
|
+
print 'Timeout: '
|
163
183
|
p check.timeout
|
164
|
-
print 'Duration:'
|
184
|
+
print 'Duration: '
|
165
185
|
p check.duration
|
166
|
-
print 'Port:'
|
186
|
+
print 'Port: '
|
167
187
|
p check.port
|
168
188
|
print 'warning: '
|
169
189
|
p check.warning
|
@@ -176,24 +196,26 @@ OptionParser.new do |opts|
|
|
176
196
|
opts.on('--verbose-t NAME', 'Verbose output for TCP ping') do |host_verbose_tcp_option|
|
177
197
|
check = Net::Ping::TCP.new(host_verbose_tcp_option)
|
178
198
|
if check.ping? == true
|
179
|
-
puts host_verbose_tcp_option.to_s.colorize(:light_blue)
|
180
|
-
|
199
|
+
puts "Address: " + host_verbose_tcp_option.to_s.colorize(:light_blue)
|
200
|
+
puts "Status: " + "UP".colorize(:green)
|
201
|
+
print 'Timeout: '
|
181
202
|
p check.timeout
|
182
|
-
print 'Duration:'
|
203
|
+
print 'Duration: '
|
183
204
|
p check.duration
|
184
|
-
print 'Port:'
|
205
|
+
print 'Port: '
|
185
206
|
p check.port
|
186
207
|
print 'warning: '
|
187
208
|
p check.warning
|
188
209
|
print 'Exception: '
|
189
210
|
p check.exception
|
190
211
|
else
|
191
|
-
puts host_verbose_tcp_option.to_s.colorize(:light_blue)
|
192
|
-
|
212
|
+
puts "Address: " + host_verbose_tcp_option.to_s.colorize(:light_blue)
|
213
|
+
puts "Status: " + "DOWN".colorize(:red)
|
214
|
+
print 'Timeout: '
|
193
215
|
p check.timeout
|
194
|
-
print 'Duration:'
|
216
|
+
print 'Duration: '
|
195
217
|
p check.duration
|
196
|
-
print 'Port:'
|
218
|
+
print 'Port: '
|
197
219
|
p check.port
|
198
220
|
print 'warning: '
|
199
221
|
p check.warning
|
@@ -206,24 +228,26 @@ OptionParser.new do |opts|
|
|
206
228
|
opts.on('--verbose-u NAME', 'Verbose output for UDP ping') do |host_verbose_udp_option|
|
207
229
|
check = Net::Ping::TCP.new(host_verbose_udp_option)
|
208
230
|
if check.ping? == true
|
209
|
-
puts host_verbose_udp_option.to_s.colorize(:light_blue)
|
210
|
-
|
231
|
+
puts "Address: " + host_verbose_udp_option.to_s.colorize(:light_blue)
|
232
|
+
puts "Status: " + "UP".colorize(:green)
|
233
|
+
print 'Timeout: '
|
211
234
|
p check.timeout
|
212
|
-
print 'Duration:'
|
235
|
+
print 'Duration: '
|
213
236
|
p check.duration
|
214
|
-
print 'Port:'
|
237
|
+
print 'Port: '
|
215
238
|
p check.port
|
216
239
|
print 'warning: '
|
217
240
|
p check.warning
|
218
241
|
print 'Exception: '
|
219
242
|
p check.exception
|
220
243
|
else
|
221
|
-
puts host_verbose_udp_option.to_s.colorize(:light_blue)
|
222
|
-
|
244
|
+
puts "Address: " + host_verbose_udp_option.to_s.colorize(:light_blue)
|
245
|
+
puts "Status: " + "DOWN".colorize(:red)
|
246
|
+
print 'Timeout: '
|
223
247
|
p check.timeout
|
224
|
-
print 'Duration:'
|
248
|
+
print 'Duration: '
|
225
249
|
p check.duration
|
226
|
-
print 'Port:'
|
250
|
+
print 'Port: '
|
227
251
|
p check.port
|
228
252
|
print 'warning: '
|
229
253
|
p check.warning
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ping-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Meisam Heidari
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-ping
|
@@ -72,7 +72,7 @@ homepage: https://github.com/Mr-Fox-h/Ping-rb
|
|
72
72
|
licenses:
|
73
73
|
- MIT
|
74
74
|
metadata: {}
|
75
|
-
post_install_message:
|
75
|
+
post_install_message:
|
76
76
|
rdoc_options: []
|
77
77
|
require_paths:
|
78
78
|
- lib
|
@@ -87,8 +87,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
87
87
|
- !ruby/object:Gem::Version
|
88
88
|
version: 1.8.11
|
89
89
|
requirements: []
|
90
|
-
rubygems_version: 3.3.
|
91
|
-
signing_key:
|
90
|
+
rubygems_version: 3.3.15
|
91
|
+
signing_key:
|
92
92
|
specification_version: 4
|
93
93
|
summary: Ping with Ruby!
|
94
94
|
test_files: []
|