airports 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/airports.gemspec +13 -0
- data/data/README.md +54 -0
- data/data/airports.dat +7733 -0
- data/data/airports.json +1 -0
- data/data/reformat.rb +21 -0
- data/lib/airports/version.rb +1 -1
- metadata +5 -1
data/data/reformat.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
require "csv"
|
2
|
+
require "json"
|
3
|
+
|
4
|
+
airport_data = {}
|
5
|
+
|
6
|
+
CSV.foreach("airports.dat") do |row|
|
7
|
+
airport_data[row[4]] = {
|
8
|
+
:name => row[1],
|
9
|
+
:city => row[2],
|
10
|
+
:country => row[3],
|
11
|
+
:iata => row[4],
|
12
|
+
:icao => row[5],
|
13
|
+
:latitude => row[6],
|
14
|
+
:longitude => row[7],
|
15
|
+
:altitude => row[8],
|
16
|
+
:timezone => row[9],
|
17
|
+
:dst => row[10]
|
18
|
+
}
|
19
|
+
end
|
20
|
+
|
21
|
+
File.open("airports.json", "w").puts JSON.generate(airport_data)
|
data/lib/airports/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: airports
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Rogers
|
@@ -123,6 +123,10 @@ files:
|
|
123
123
|
- airports.gemspec
|
124
124
|
- bin/console
|
125
125
|
- bin/setup
|
126
|
+
- data/README.md
|
127
|
+
- data/airports.dat
|
128
|
+
- data/airports.json
|
129
|
+
- data/reformat.rb
|
126
130
|
- lib/airports.rb
|
127
131
|
- lib/airports/airport.rb
|
128
132
|
- lib/airports/version.rb
|