Class: Twingly::PublicSuffixList
- Inherits:
-
Object
- Object
- Twingly::PublicSuffixList
- Defined in:
- lib/twingly/public_suffix_list.rb
Class Method Summary collapse
-
.with_punycoded_names(encoding: Encoding::UTF_8) ⇒ Object
Extend the PSL with ASCII form of all internationalized domain names.
Class Method Details
.with_punycoded_names(encoding: Encoding::UTF_8) ⇒ Object
Extend the PSL with ASCII form of all internationalized domain names
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/twingly/public_suffix_list.rb', line 13 def self.with_punycoded_names(encoding: Encoding::UTF_8) list_path = PublicSuffix::List::DEFAULT_LIST_PATH list_data = File.read(list_path, encoding: encoding) list = PublicSuffix::List.parse(list_data, private_domains: false) punycoded_names(list).each do |punycoded_name| new_rule = PublicSuffix::Rule.factory(punycoded_name) list.add(new_rule) end list end |