airports 1.5.0 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cd6eb797344db6298be1e177fe7a24372708f3656965a549a2bc363ecc8028f9
4
- data.tar.gz: bb94c1025b93602d478a2babadcc38f6f03b28578428ea3d2bfd1246adb7fd66
3
+ metadata.gz: '08d410984de2627c314c3d3877b8bc0c147beeb3ed4ea0d5e7549b1c41056689'
4
+ data.tar.gz: 847c2e075036a377d72205d792ca4b35f6584a249c09d5ba36e638962364748b
5
5
  SHA512:
6
- metadata.gz: e27d0d368ade101807f015ac7271f3b556d66d9e67aa96c2f325697c1fcd75e6bfb1b03e58a51996326fab224aa99d4c57169b0801534d5ed2df4eaee08eaac8
7
- data.tar.gz: d28ea2d9e45464493eb7bdbfeb75a9ee1d4426bdc737160a7e430dc3da69a67ec76af30830a49b0d5faa13697eb7eda12782a6a954cff0bbaf8f0025bb83b013
6
+ metadata.gz: 85a959b5bbbf9228989831e4a18e2b9d73d95a1d82f79e04172e826bb59ede7f4beb92f4b96de838a1b638b078f7d0234015748f99a55035c216457c8d9d8748
7
+ data.tar.gz: 6a4799b976ba23e67231ad44da1263295e2694e8293ed34e7ce2baf7cae5166cf2b8c29a3711f5d91ce22a534a4591af1218112676b7d4530882d15291235790
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ # v1.6.0 (25 January 2020)
2
+
3
+ * Update airport data with the latest from [OpenFlights](http://openflights.org)
4
+ * Refactor how incorrect or missing data from OpenFlights is patched (@MatjazKavcic)
5
+
1
6
  # v1.5.0 (5 December 2019)
2
7
 
3
8
  * Support looking up airports by the name of the city they
data/Rakefile CHANGED
@@ -20,12 +20,12 @@ end
20
20
 
21
21
  task :update do
22
22
  raw_data = open("https://raw.githubusercontent.com/jpatokal/openflights/master/data/" \
23
- "airports.dat").read
23
+ "airports.dat").read + File.read("./data/patches.dat")
24
+
24
25
  cleaned_data = raw_data.gsub(/\\"/, '""')
25
26
 
26
27
  cleaned_data = CSV.parse(cleaned_data).each_with_object({}) do |row, accumulator|
27
- # Doha is missing its IATA code, for some reason 🙄
28
- iata_code = row[5] == "OTBD" ? "DOH" : row[4]
28
+ iata_code = row[4]
29
29
 
30
30
  # We'll skip other airports which don't have IATA codes
31
31
  next unless iata_code != "\\N"
@@ -45,27 +45,6 @@ task :update do
45
45
  }
46
46
  end
47
47
 
48
- # Istanbul (IST) is missing its time zone, so add it in
49
- cleaned_data["IST"][:tz_name] = "Europe/Istanbul"
50
-
51
- # `CPC` has an abbreviation in its name ("C. Campos"), so expand it
52
- cleaned_data["CPC"][:name] = "Aviador Carlos Campos Airport"
53
-
54
- # Hyderabad (HYD) is missing, so add it in
55
- cleaned_data["HYD"] = {
56
- name: "Rajiv Gandhi International Airport",
57
- city: "Hyderabad",
58
- country: "India",
59
- iata: "HYD",
60
- icao: "VOHS",
61
- latitude: "17.2403",
62
- longitude: "78.4294",
63
- altitude: nil,
64
- timezone: "N",
65
- dst: "5.5",
66
- tz_name: "Asia/Calcutta",
67
- }
68
-
69
48
  File.open("data/airports.json", "w").puts JSON.generate(cleaned_data)
70
49
  end
71
50
 
data/airports.gemspec CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
24
24
 
25
25
  spec.required_ruby_version = ">= 2.4"
26
26
 
27
- spec.add_development_dependency "gc_ruboconfig", "~> 2.8.0"
27
+ spec.add_development_dependency "gc_ruboconfig", "~> 2.9.0"
28
28
  spec.add_development_dependency "pry", "~> 0.12.2"
29
29
  spec.add_development_dependency "rake", "~> 13.0"
30
30
  spec.add_development_dependency "rspec", "~> 3.9.0"