lib/page_rankr/site.rb in PageRankr-3.1.2 vs lib/page_rankr/site.rb in PageRankr-3.2.0
- old
+ new
@@ -5,9 +5,10 @@
module PageRankr
class Site
COMPONENTS = [:scheme, :subdomain, :domain, :port, :path, :query, :fragment]
def initialize(site)
+ site = "http://#{site}" unless site =~ /:\/\//
@uri = URI.parse(site)
@domain = PublicSuffix.parse(@uri.host || "")
@domain.valid? or raise DomainInvalid, "The domain provided is invalid.1"
rescue PublicSuffix::DomainInvalid, URI::InvalidURIError
\ No newline at end of file