geo2tz 0.0.1 → 0.0.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/lib/geo2tz.rb +1 -1
- data/lib/geo2tz/search.rb +1 -1
- data/lib/geo2tz/updater.rb +3 -1
- data/lib/geo2tz/version.rb +1 -1
- metadata +1 -1
data/lib/geo2tz.rb
CHANGED
data/lib/geo2tz/search.rb
CHANGED
@@ -14,7 +14,7 @@ module Geo2tz
|
|
14
14
|
|
15
15
|
def self.setup_tree
|
16
16
|
points = []
|
17
|
-
File.open(
|
17
|
+
File.open(File.join(Geo2tz.config[:writable_directory],Geo2tz.config[:filename])).each do |line|
|
18
18
|
data = line.split(',')
|
19
19
|
tz = data[2].strip
|
20
20
|
unless MAP.has_key? tz
|
data/lib/geo2tz/updater.rb
CHANGED
@@ -29,15 +29,17 @@ module Geo2tz
|
|
29
29
|
line_data = line.split("\t")
|
30
30
|
@parsed_cities << {:lat => line_data[4], :long => line_data[5], :tz => line_data[17]}
|
31
31
|
end
|
32
|
+
@unparsed_cities = nil # dont need it anymore, let's free up some memory
|
32
33
|
true
|
33
34
|
end
|
34
35
|
|
35
36
|
def write_file
|
36
|
-
File.open(
|
37
|
+
File.open(File.join(Geo2tz.config[:writable_directory],Geo2tz.config[:filename]), 'w') do |file|
|
37
38
|
@parsed_cities.each do |city|
|
38
39
|
file.write("#{city[:lat]},#{city[:long]},#{city[:tz]}\n")
|
39
40
|
end
|
40
41
|
end
|
42
|
+
@parsed_cities = nil# dont need it anymore, let's free up some memory
|
41
43
|
true
|
42
44
|
end
|
43
45
|
|
data/lib/geo2tz/version.rb
CHANGED