kch-dominion 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/dominion/domain_name.rb +2 -2
- data/var/tlds.dat +2299 -253
- metadata +19 -38
data/lib/dominion/domain_name.rb
CHANGED
@@ -11,9 +11,9 @@ module Dominion
|
|
11
11
|
@rules
|
12
12
|
end
|
13
13
|
|
14
|
-
# takes the path to a rule file in the format defined in http://publicsuffix.org/
|
14
|
+
# takes the path to a rule file in the format defined in http://publicsuffix.org/list/
|
15
15
|
def self.load_rules_from_file(path)
|
16
|
-
rules open(path).lines.reject { |s| s =~ %r[\A\s*(//.*)?\Z\n?] }.map { |s| DomainSuffixRule.new(s) }.sort << DomainSuffixRule.new("*")
|
16
|
+
rules open(path, "r:UTF-8").lines.reject { |s| s =~ %r[\A\s*(//.*)?\Z\n?] }.map { |s| DomainSuffixRule.new(s) }.sort << DomainSuffixRule.new("*")
|
17
17
|
end
|
18
18
|
|
19
19
|
# takes a domain string as argument; i.e. the hostname part of a URL
|