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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ba21a9f7cde4fa200492f482e3aab03087cbd811
4
- data.tar.gz: 128a715727189a83ef4c2fc2b3f7a64e60428f28
3
+ metadata.gz: 6982f098ca03f3ea9b9dfabccf241054ece9b28c
4
+ data.tar.gz: a7b48b7c0a8e9563b16ee2718103b6ad20ad4a15
5
5
  SHA512:
6
- metadata.gz: 0e0b26dc0661745d75c6a44bfca4501ede8f0e3c64844fa4c5dd3b843eef6a334ac1dcf7efd78a86f9f0c4e4de6a6ce86e6151aa29ede72a9e9c6da5e186c8fc
7
- data.tar.gz: f2ed8387a908ae6068ac6bc6a25acab02665568ccfa6f605985610ab7ff966dd9cccf01eb55a514c1bcac9e08c799e0cb3adadf9f73e70e0d2e98a265a8a018e
6
+ metadata.gz: f1e5a6fae2f1f3d1d2c9ec88c01303e3431072e5cdb9d4ab88063794b0904a98df5946037ec413c776eb41da47946002c8443cc6c4a20a84883e421871cd13c4
7
+ data.tar.gz: c0d70113be60c2aac59878e2205d0808da5c3d0fecf44b385f1a18e4942715562d51aae691f9afc524515ce8824cbc3813c6d17e5f4229bd7b0b88cad4762cdd
@@ -1,7 +1,13 @@
1
1
  require "website/status/version"
2
-
2
+ require "net/http"
3
3
  module Website
4
4
  module Status
5
- # Your code goes here...
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
@@ -1,5 +1,5 @@
1
1
  module Website
2
2
  module Status
3
- VERSION = "0.1.0"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  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.1.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: