Sha256: 17a44fe75cbc92be02c50f1f53dfe2df86db4d8c93319869bd5f9f1c6abb5b48
Contents?: true
Size: 385 Bytes
Versions: 16
Compression:
Stored size: 385 Bytes
Contents
class Pinger def self.http(uri) result = true begin RestClient.get uri rescue RestClient::Forbidden rescue Exception => e result = e.to_s end result end def self.external(host) result = false ping = `ping -q -c 1 #{host}` result = ping.split("\n").last.split("=").last.split('/')[1] if $?.exitstatus == 0 result end end
Version data entries
16 entries across 16 versions & 1 rubygems