checkhost 1.0.2 → 1.0.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 +7 -0
- data/lib/test.rb +21 -0
- metadata +20 -42
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: f52dfbc199987675e07ce587e5725160c8952fd4
|
4
|
+
data.tar.gz: 60df2c246b0208de98f4d4e5d71e34fbf507d523
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: afbe5b87b24d4e18587e9dfd6bc6d12b051e23a9c3ee1369126acfa40fc669251eb0400a309897fc00de9daeb817f951900876a09b83b5ac6f3802df1c6d5e13
|
7
|
+
data.tar.gz: ae00b5d76de267f9f35875a4b8802c74f0fb6729eac42bfb349d905f92efcd209eba0a7a3bb8afe77f67bdb9885957273b68a90cdb5e29a30a63caff282576aa
|
data/lib/test.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'checkhost'
|
3
|
+
res = {}
|
4
|
+
|
5
|
+
google = CheckHost.new('google.com', {:type => 'http', :max_nodes => 3})
|
6
|
+
google.run
|
7
|
+
res = google.check until !res.empty? && !res.has_value?(nil)
|
8
|
+
|
9
|
+
print 'Check nodes: '
|
10
|
+
google.nodes.each do |node|
|
11
|
+
node = google.node_info(node)
|
12
|
+
print "#{node[:country]}(#{node[:location]}) "
|
13
|
+
end
|
14
|
+
puts "\n\n"
|
15
|
+
res.each do |node, result|
|
16
|
+
country = google.node_info(node)[:country]
|
17
|
+
message = result[:message]
|
18
|
+
time = result[:time]
|
19
|
+
|
20
|
+
puts "#{country}: #{message} (in #{time}ms)"
|
21
|
+
end
|
metadata
CHANGED
@@ -1,67 +1,45 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: checkhost
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 0
|
9
|
-
- 2
|
10
|
-
version: 1.0.2
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.3
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
6
|
+
authors:
|
13
7
|
- Marco Giosa
|
14
8
|
autorequire:
|
15
9
|
bindir: bin
|
16
10
|
cert_chain: []
|
17
|
-
|
18
|
-
date: 2015-12-27 00:00:00 Z
|
11
|
+
date: 2015-12-30 00:00:00.000000000 Z
|
19
12
|
dependencies: []
|
20
|
-
|
21
13
|
description: Gem to check-host.net public API
|
22
|
-
email:
|
14
|
+
email: markkuit@protonmail.ch
|
23
15
|
executables: []
|
24
|
-
|
25
16
|
extensions: []
|
26
|
-
|
27
17
|
extra_rdoc_files: []
|
28
|
-
|
29
|
-
files:
|
18
|
+
files:
|
30
19
|
- lib/checkhost.rb
|
20
|
+
- lib/test.rb
|
31
21
|
homepage: https://github.com/markkuit/checkhost-ruby
|
32
|
-
licenses:
|
22
|
+
licenses:
|
33
23
|
- MIT
|
24
|
+
metadata: {}
|
34
25
|
post_install_message:
|
35
26
|
rdoc_options: []
|
36
|
-
|
37
|
-
require_paths:
|
27
|
+
require_paths:
|
38
28
|
- lib
|
39
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
40
|
-
|
41
|
-
requirements:
|
29
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
42
31
|
- - ">="
|
43
|
-
- !ruby/object:Gem::Version
|
44
|
-
hash: 49
|
45
|
-
segments:
|
46
|
-
- 1
|
47
|
-
- 9
|
48
|
-
- 1
|
32
|
+
- !ruby/object:Gem::Version
|
49
33
|
version: 1.9.1
|
50
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
51
|
-
|
52
|
-
requirements:
|
34
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
35
|
+
requirements:
|
53
36
|
- - ">="
|
54
|
-
- !ruby/object:Gem::Version
|
55
|
-
|
56
|
-
segments:
|
57
|
-
- 0
|
58
|
-
version: "0"
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: '0'
|
59
39
|
requirements: []
|
60
|
-
|
61
40
|
rubyforge_project:
|
62
|
-
rubygems_version:
|
41
|
+
rubygems_version: 2.4.6
|
63
42
|
signing_key:
|
64
|
-
specification_version:
|
43
|
+
specification_version: 4
|
65
44
|
summary: Ruby check-host.net API
|
66
45
|
test_files: []
|
67
|
-
|