website-status 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/website/status.rb +8 -2
- data/lib/website/status/version.rb +1 -1
- data/website-status-0.1.0.gem +0 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6982f098ca03f3ea9b9dfabccf241054ece9b28c
|
4
|
+
data.tar.gz: a7b48b7c0a8e9563b16ee2718103b6ad20ad4a15
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1e5a6fae2f1f3d1d2c9ec88c01303e3431072e5cdb9d4ab88063794b0904a98df5946037ec413c776eb41da47946002c8443cc6c4a20a84883e421871cd13c4
|
7
|
+
data.tar.gz: c0d70113be60c2aac59878e2205d0808da5c3d0fecf44b385f1a18e4942715562d51aae691f9afc524515ce8824cbc3813c6d17e5f4229bd7b0b88cad4762cdd
|
data/lib/website/status.rb
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
require "website/status/version"
|
2
|
-
|
2
|
+
require "net/http"
|
3
3
|
module Website
|
4
4
|
module Status
|
5
|
-
|
5
|
+
def website_up?(host, port=80)
|
6
|
+
http = Net::HTTP.start(host, port, { open_timeout: 5, read_timeout: 5})
|
7
|
+
response = http.head("/")
|
8
|
+
response.code == "200"
|
9
|
+
rescue Timeout::Error, SocketError
|
10
|
+
false
|
11
|
+
end
|
6
12
|
end
|
7
13
|
end
|
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: website-status
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lalith
|
@@ -71,6 +71,7 @@ files:
|
|
71
71
|
- bin/setup
|
72
72
|
- lib/website/status.rb
|
73
73
|
- lib/website/status/version.rb
|
74
|
+
- website-status-0.1.0.gem
|
74
75
|
- website-status.gemspec
|
75
76
|
homepage: https://github.com/lalithr95/website-status
|
76
77
|
licenses:
|