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.
Files changed (3) hide show
  1. data/lib/dominion/domain_name.rb +2 -2
  2. data/var/tlds.dat +2299 -253
  3. metadata +19 -38
@@ -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/format/
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