lib/validators/tld.rb in validators-3.2.1 vs lib/validators/tld.rb in validators-3.3.0

- old
+ new

@@ -1,12 +1,12 @@ # frozen_string_literal: true module Validators class TLD - FILE_PATH = File.expand_path("../../data/tld.json", __dir__) + FILE_PATH = File.expand_path("../../data/tld.txt", __dir__) def self.all - @all ||= JSON.parse(File.read(FILE_PATH)) + @all ||= File.read(FILE_PATH).lines.map(&:chomp) end def self.host_with_valid_tld?(host) host = host.to_s