domainatrix 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/domainatrix.rb +1 -1
- data/lib/domainatrix/domain_parser.rb +8 -1
- metadata +1 -1
data/lib/domainatrix.rb
CHANGED
@@ -10,7 +10,14 @@ module Domainatrix
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def read_dat_file(file_name)
|
13
|
-
|
13
|
+
# If we're in 1.9, make sure we're opening it in UTF-8
|
14
|
+
if RUBY_VERSION >= '1.9'
|
15
|
+
dat_file = File.open(file_name, "r:UTF-8")
|
16
|
+
else
|
17
|
+
dat_file = File.open(file_name)
|
18
|
+
end
|
19
|
+
|
20
|
+
dat_file.each_line do |line|
|
14
21
|
line = line.strip
|
15
22
|
unless (line =~ /\/\//) || line.empty?
|
16
23
|
parts = line.split(".").reverse
|