ipgeobase_local 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
@@ -52,7 +52,9 @@ module IpgeobaseLocal
|
|
52
52
|
|
53
53
|
cidr_file = "#{IpgeobaseLocal.base_directory}cidr_optim.txt"
|
54
54
|
cities_file = "#{IpgeobaseLocal.base_directory}cities.txt"
|
55
|
-
|
55
|
+
unless File.exists?(cidr_file) && File.exists?(cities_file)
|
56
|
+
raise "Not exist ipgeobase files, pls run 'rake ipgeobase_local:update'"
|
57
|
+
end
|
56
58
|
CSV.foreach(cities_file, col_sep: "\t", quote_char:"'", encoding: "windows-1251:utf-8") do |line|
|
57
59
|
city_base[line[0]] = line[1..5]
|
58
60
|
end
|