Module: Website::Status
- Defined in:
- lib/website/status.rb,
lib/website/status/version.rb
Constant Summary collapse
- VERSION =
"0.2.0"
Instance Method Summary collapse
Instance Method Details
#website_up?(host, port = 80) ⇒ Boolean
5 6 7 8 9 10 11 |
# File 'lib/website/status.rb', line 5 def website_up?(host, port=80) http = Net::HTTP.start(host, port, { open_timeout: 5, read_timeout: 5}) response = http.head("/") response.code == "200" rescue Timeout::Error, SocketError false end |