Sha256: 6e293eef40e1fc2845f8aa4b3a6f1bf528576c96699210d61b4af71291b104a0
Contents?: true
Size: 552 Bytes
Versions: 12
Compression:
Stored size: 552 Bytes
Contents
# encoding: utf-8 require "uri" require "net/http" require "ostruct" module SocialProfile class Utils def self.head(url, options = {}) uri = URI.parse(url) response = nil Net::HTTP.start(uri.host, uri.port) do |http| http.open_timeout = 2 http.read_timeout = 2 response = http.head(uri.request_uri) end Response.new(uri, response, options) end def self.blank?(value) value.nil? || value.to_s.empty? end def self.exists?(value) !blank?(value) end end end
Version data entries
12 entries across 12 versions & 1 rubygems