domain_prefix 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.2
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "domain_prefix"
8
- s.version = "0.2.1"
8
+ s.version = "0.2.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["tadman"]
12
- s.date = "2012-12-12"
12
+ s.date = "2012-12-20"
13
13
  s.description = "A library to extract information about top-level domain and registered name from generic and international domain names"
14
14
  s.email = "github@tadman.ca"
15
15
  s.extra_rdoc_files = [
data/lib/domain_prefix.rb CHANGED
@@ -62,9 +62,13 @@ module DomainPrefix
62
62
 
63
63
  TLDIFIER_SOURCE_FILE = File.expand_path(File.join('..', 'data', 'effective_tld_names.dat'), File.dirname(__FILE__))
64
64
 
65
- TLD_SET = File.read(TLDIFIER_SOURCE_FILE).split(/\n/).collect do |line|
66
- line.sub(%r[//.*], '').sub(/\s+$/, '')
67
- end.reject(&:empty?).freeze
65
+ TLD_SET = begin
66
+ File.open(TLDIFIER_SOURCE_FILE, 'r:UTF-8') do |f|
67
+ f.read.split(/\n/).collect do |line|
68
+ line.sub(%r[//.*], '').sub(/\s+$/, '')
69
+ end.reject(&:empty?).freeze
70
+ end
71
+ end
68
72
 
69
73
  TLD_NAMES = TLD_SET.sort_by do |d|
70
74
  [ -d.length, d ]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: domain_prefix
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-12 00:00:00.000000000 Z
12
+ date: 2012-12-20 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: A library to extract information about top-level domain and registered
15
15
  name from generic and international domain names