lib/page_rankr/site.rb in PageRankr-3.0.0 vs lib/page_rankr/site.rb in PageRankr-3.0.1

- old
+ new

@@ -4,17 +4,20 @@ module PageRankr class Site < DelegateClass(PublicSuffixService::Domain) def initialize(site) super(PublicSuffixService.parse(clean(site))) valid? or raise DomainInvalid, "The domain provided is invalid." + rescue PublicSuffixService::DomainInvalid => e + raise DomainInvalid, "The domain provided is invalid." end private def clean(site) - site = site.split("://").last # remove protocol - site = site.split("/").first # remove path - site.split("?").first # remove params + site = site || '' + site = site.split("://").last || '' # remove protocol + site = site.split("/").first || '' # remove path + site.split("?").first || '' # remove params end end class << self def Site(site) \ No newline at end of file