lib/validators/tld.rb in validators-3.0.1 vs lib/validators/tld.rb in validators-3.0.2

- old
+ new

@@ -7,10 +7,12 @@ def self.all @all ||= JSON.parse(File.read(FILE_PATH)) end def self.host_with_valid_tld?(host) - return false if host.to_s.split(".").size == 1 + host = host.to_s + + return false if host.split(".").size == 1 valid?(host[/\.([^.]+)$/, 1].to_s.downcase) end def self.valid?(tld)