airports 1.8.2 → 1.10.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: 150845add0469561f31778e949997cdeff5de81db171dccddb2142bd6c2e11fe
4
- data.tar.gz: a21e2f1d762e66d887c49f58f4e8352ddbca885ec56783932093f7b07d8cdbe5
3
+ metadata.gz: 4318bd0001af245b4b0c19659efdcbda2742ef783fc88547e2ac19d720ac767d
4
+ data.tar.gz: 72c652162dd1cd99ca6471047cb3d889dcd3491b2042fa0e7827e27890972048
5
5
  SHA512:
6
- metadata.gz: ad9d6c479a67d99fd1a408356ce5299f3b6ab70b879851631ca849dba4aa961428fa46534752452badad1bbecb9a6ed141d60c7f8bfe215835276e27e275c23f
7
- data.tar.gz: 821c81755af5347543ab6e6b915f7cf231748d16da94691ca9ebb4f1e9004b77187dbb4e3d8fbe048fa110b324935184343858341e63ea0207de0d17351ce6d7
6
+ metadata.gz: aa15a27740d154683066524a01bfe79d9125effbbfb79331f385facfa96e5d3806b232928ea32d98cdf0936675ad2eea0d70cdc22e476fb353f03fbdaa9116ce
7
+ data.tar.gz: 281dd128587cf18d024702c197055d3952541c518ab7ae268d1b210428f92edc020b379a490e85d31cb4ec7a1de170e92d5cf4fe990628a4b18bc61851bf12d6
@@ -1,4 +1,4 @@
1
- name: 'Test and lint'
1
+ name: "Test and lint"
2
2
  on:
3
3
  push:
4
4
  branches: [main]
@@ -9,7 +9,7 @@ jobs:
9
9
  runs-on: ubuntu-latest
10
10
  strategy:
11
11
  matrix:
12
- ruby-version: ['2.6', '2.7', '3.0', '3.1', '3.2.0-preview1']
12
+ ruby-version: ["2.6", "2.7", "3.0", "3.1", "3.2", "3.3"]
13
13
  steps:
14
14
  - name: Checkout code
15
15
  uses: actions/checkout@v4
@@ -23,4 +23,4 @@ jobs:
23
23
  - name: Lint Ruby files
24
24
  run: bundle exec rubocop
25
25
  - name: Run RSpec tests
26
- run: bundle exec rspec
26
+ run: bundle exec rspec
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.1.2
1
+ 3.3.6
data/.tool-versions CHANGED
@@ -1 +1 @@
1
- ruby 3.1.2
1
+ ruby 3.3.6
data/CHANGELOG.md CHANGED
@@ -1,60 +1,72 @@
1
+ ## v1.10.0 (29 November, 2024)
2
+
3
+ - Add new `.icao_codes` method (@FinnLawrence)
4
+
5
+ ## v1.9.0 (4 May, 2024)
6
+
7
+ - Add new `.find_all_by_country_name` method (@wilburhimself)
8
+
9
+ ## v1.8.3 (31 March, 2024)
10
+
11
+ - Add Kertajati International Airport (KJT) (@chakraskun)
12
+
1
13
  ## v1.8.2 (22 March, 2024)
2
14
 
3
- * Add the new Tulum Airport (TQO) (@rmm5t)
15
+ - Add the new Tulum Airport (TQO) (@rmm5t)
4
16
 
5
17
  ## v1.8.1 (17 February 2023)
6
18
 
7
- * Fix the name of Tromsø Airport (TOS) (@pcothenet)
19
+ - Fix the name of Tromsø Airport (TOS) (@pcothenet)
8
20
 
9
21
  ## v1.8.0 (13 March 2022)
10
22
 
11
- * Add support for Ruby 3.1 (@timrogers)
12
- * Fix the names of Ningbo (NGB) and Changsha (CSX) airports in China (@ratazzi)
23
+ - Add support for Ruby 3.1 (@timrogers)
24
+ - Fix the names of Ningbo (NGB) and Changsha (CSX) airports in China (@ratazzi)
13
25
 
14
26
  # v1.7.0 (25 August 2021)
15
27
 
16
- * Add support for Ruby 3.0 (@timrogers, with thanks to @kleinjm)
17
- * Add Misrata Airport (`MRA`) in Libya (@timrogers, with thanks to @a21-kevin)
18
- * Drop support for Ruby 2.4 and 2.5, which are no longer officially supported (@timrogers)
19
- * Remove unnecessary dependencies from the gemspec, moving them to the `Gemfile` (@timrogers)
28
+ - Add support for Ruby 3.0 (@timrogers, with thanks to @kleinjm)
29
+ - Add Misrata Airport (`MRA`) in Libya (@timrogers, with thanks to @a21-kevin)
30
+ - Drop support for Ruby 2.4 and 2.5, which are no longer officially supported (@timrogers)
31
+ - Remove unnecessary dependencies from the gemspec, moving them to the `Gemfile` (@timrogers)
20
32
 
21
33
  # v1.6.1 (9 May 2020)
22
34
 
23
- * Add an entry for Berlin Brandenburg Airport (`BER`), which is missing from [OpenFlights](http://openflights.org) (@PavelWeSki)
24
- * Update airport data with the latest from [OpenFlights](http://openflights.org)
35
+ - Add an entry for Berlin Brandenburg Airport (`BER`), which is missing from [OpenFlights](http://openflights.org) (@PavelWeSki)
36
+ - Update airport data with the latest from [OpenFlights](http://openflights.org)
25
37
 
26
38
  # v1.6.0 (25 January 2020)
27
39
 
28
- * Update airport data with the latest from [OpenFlights](http://openflights.org)
29
- * Refactor how incorrect or missing data from OpenFlights is patched (@MatjazKavcic)
40
+ - Update airport data with the latest from [OpenFlights](http://openflights.org)
41
+ - Refactor how incorrect or missing data from OpenFlights is patched (@MatjazKavcic)
30
42
 
31
43
  # v1.5.0 (5 December 2019)
32
44
 
33
- * Support looking up airports by the name of the city they
34
- are located in with `Airports.find_all_by_city_name` (@viral810, @timrogers)
35
- * Refactor `Airports` so `Airport` objects are only generated once
36
- and the code is cleaner (@timrogers)
45
+ - Support looking up airports by the name of the city they
46
+ are located in with `Airports.find_all_by_city_name` (@viral810, @timrogers)
47
+ - Refactor `Airports` so `Airport` objects are only generated once
48
+ and the code is cleaner (@timrogers)
37
49
 
38
50
  # v1.4.1 (14 November 2019)
39
51
 
40
- * Correct the time zone of Istanbul Airport (`IST`) (@aliismayilov)
41
- * Correct the name of Aviador Carlos Campos Airport (`CPC`) (@jpgarritano)
52
+ - Correct the time zone of Istanbul Airport (`IST`) (@aliismayilov)
53
+ - Correct the name of Aviador Carlos Campos Airport (`CPC`) (@jpgarritano)
42
54
 
43
55
  # v1.4.0 (30 June 2019)
44
56
 
45
- * Drop support for Ruby 2.2 and 2.3, which are no longer officially supported (@timrogers)
46
- * Test against Ruby 2.6 (@timrogers)
47
- * Convert "nulls" in the source data, expressed as "\\N", to Ruby `nil`s (@gabebw)
57
+ - Drop support for Ruby 2.2 and 2.3, which are no longer officially supported (@timrogers)
58
+ - Test against Ruby 2.6 (@timrogers)
59
+ - Convert "nulls" in the source data, expressed as "\\N", to Ruby `nil`s (@gabebw)
48
60
 
49
61
  # v1.3.0 (26 June 2019)
50
62
 
51
- * Expose the time zone that an airport is located in with `#tz_name` (@gabebw)
63
+ - Expose the time zone that an airport is located in with `#tz_name` (@gabebw)
52
64
 
53
65
  # v1.2.0 (11 March 2018)
54
66
 
55
- * Drop support for Ruby 2.2, which has reached end-of-life and no longer receives security updates (@timrogers)
56
- * Enforce code style using Rubocop (@timrogers)
67
+ - Drop support for Ruby 2.2, which has reached end-of-life and no longer receives security updates (@timrogers)
68
+ - Enforce code style using Rubocop (@timrogers)
57
69
 
58
70
  # v1.1.0 (11 March 2018)
59
71
 
60
- * Add new `.find_by_icao_code` for finding airports by their ICAO code (@ryanburnette)
72
+ - Add new `.find_by_icao_code` for finding airports by their ICAO code (@ryanburnette)
data/Gemfile CHANGED
@@ -4,11 +4,11 @@ source 'https://rubygems.org'
4
4
 
5
5
  gemspec
6
6
 
7
- gem "gc_ruboconfig", "~> 3.6.0"
8
- gem "pry", "~> 0.14.1"
7
+ gem "gc_ruboconfig", "~> 5.0.2"
8
+ gem "pry", "~> 0.15.0"
9
9
  gem "rake", "~> 13.0"
10
10
  gem "rspec", "~> 3.13.0"
11
11
  gem "rspec-its", "~> 1.3.0"
12
12
  gem "rspec_junit_formatter", "~> 0.6.0"
13
- gem "rubocop", "~> 1.50.1"
13
+ gem "rubocop", "~> 1.69.0"
14
14
  gem "rubocop-rake", "~> 0.6.0", require: false
data/README.md CHANGED
@@ -11,7 +11,7 @@ It's based on data from [OpenFlights](http://openflights.org), with a bit of mas
11
11
  Install the gem by adding it to your Gemfile:
12
12
 
13
13
  ```ruby
14
- gem "airports", "~> 1.8.2"
14
+ gem "airports", "~> 1.10.0"
15
15
  ```
16
16
 
17
17
  You can then look up an airport by its IATA code (e.g. `LHR` for London Heathrow) using `Airports.find_by_iata_code`, which returns an object with a bunch of accessors like `name` and `city`:
@@ -48,7 +48,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
48
48
 
49
49
  To update the data included in the gem, just run `bundle exec rake update` and make a pull request with the changes. This will pull the latest data from [OpenFlights](http://openflights.org).
50
50
 
51
- Bug reports and pull requests are welcome on GitHub at https://github.com/timrogers/airports. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
51
+ Bug reports and pull requests are welcome on GitHub at https://github.com/timrogers/airports. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](https://contributor-covenant.org) code of conduct.
52
52
 
53
53
  ## Acknowledgements
54
54
 
@@ -57,4 +57,3 @@ Big thanks to [OpenFlights](http://openflights.org) for collecting and making th
57
57
  ## License
58
58
 
59
59
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
60
-
data/Rakefile CHANGED
@@ -23,7 +23,7 @@ task :update do
23
23
  raw_data = URI.open("https://raw.githubusercontent.com/jpatokal/openflights/master/" \
24
24
  "data/airports.dat").read + File.read("./data/patches.dat")
25
25
 
26
- cleaned_data = raw_data.gsub(/\\"/, '""')
26
+ cleaned_data = raw_data.gsub('\"', '""')
27
27
 
28
28
  cleaned_data = CSV.parse(cleaned_data).each_with_object({}) do |row, accumulator|
29
29
  iata_code = row[4]
data/data/patches.dat CHANGED
@@ -6,4 +6,5 @@
6
6
  14112,"Misrata Airport","Misrata","Libya","MRA","HLMS",32.3219,15.0574,18,2,"N","Africa/Tripoli","airport","OurAirports"
7
7
  3371,"Changsha Huanghua International Airport","Changsha","China","CSX","ZGHA",28.189199447599997,113.220001221,217,8,"U","Asia/Shanghai","airport","OurAirports"
8
8
  3387,"Ningbo Lishe International Airport","Ningbo","China","NGB","ZSNB",29.82670021057129,121.46199798583984,13,8,"U","Asia/Shanghai","airport","OurAirports"
9
+ 99998,"Kertajati International Airport","Majalengka","Indonesia","KJT","WICA",-6.6519467,108.1551111,36,7,"N","Asia/Jakarta","airport","OurAirports"
9
10
  99999,"Felipe Carrillo Puerto International Airport","Tulum","Mexico","TQO","MMTL",20.1662,-87.6592,66,"S","America/Cancun","airport","OurAirports"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Airports
4
- VERSION = "1.8.2"
4
+ VERSION = "1.10.0"
5
5
  end
data/lib/airports.rb CHANGED
@@ -21,10 +21,18 @@ module Airports
21
21
  all.select { |airport| airport.city.casecmp(city_name).zero? }
22
22
  end
23
23
 
24
+ def self.find_all_by_country_name(country_name)
25
+ all.select { |airport| airport.country.casecmp(country_name).zero? }
26
+ end
27
+
24
28
  def self.iata_codes
25
29
  parsed_data.keys
26
30
  end
27
31
 
32
+ def self.icao_codes
33
+ parsed_data.values.map { |airport_data| airport_data["icao"] }
34
+ end
35
+
28
36
  def self.all
29
37
  @all ||= parsed_data.values.map do |airport_data|
30
38
  airport_from_parsed_data_element(airport_data)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: airports
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.2
4
+ version: 1.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Rogers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-22 00:00:00.000000000 Z
11
+ date: 2024-11-29 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Access data on airports from around the world
14
14
  email:
@@ -59,7 +59,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
59
59
  - !ruby/object:Gem::Version
60
60
  version: '0'
61
61
  requirements: []
62
- rubygems_version: 3.3.7
62
+ rubygems_version: 3.5.22
63
63
  signing_key:
64
64
  specification_version: 4
65
65
  summary: Access data on airports from around the world