airports 1.8.3 → 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: 4749aa453e765581488b9d30e95a5f3059f5beeca8bddc08a9b190af4efa24f8
4
- data.tar.gz: 1c9df0662c1c55724578d4b72c38d692b33464a3a36029e9d4c629e96f4dd51e
3
+ metadata.gz: 4318bd0001af245b4b0c19659efdcbda2742ef783fc88547e2ac19d720ac767d
4
+ data.tar.gz: 72c652162dd1cd99ca6471047cb3d889dcd3491b2042fa0e7827e27890972048
5
5
  SHA512:
6
- metadata.gz: b58446ff9059f6b9ccb96d53cb4c75ddbd2a4e36001f0fa2729dab0e62caae7c31ad38813ad9ebcfdf8cabbbd9018f5158f7be946d188c24b3d3f98885c344a4
7
- data.tar.gz: c79288d2173432b8bd8c6dc05bbefff8c0ba519d76b0eec3659820313232f0ac3fecec3fd1a34cc1d79d475ec01f5ab5d3b6a6757211c89fc22cc882c18212a7
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,64 +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
+
1
9
  ## v1.8.3 (31 March, 2024)
2
10
 
3
- * Add Kertajati International Airport (KJT) (@chakraskun)
11
+ - Add Kertajati International Airport (KJT) (@chakraskun)
4
12
 
5
13
  ## v1.8.2 (22 March, 2024)
6
14
 
7
- * Add the new Tulum Airport (TQO) (@rmm5t)
15
+ - Add the new Tulum Airport (TQO) (@rmm5t)
8
16
 
9
17
  ## v1.8.1 (17 February 2023)
10
18
 
11
- * Fix the name of Tromsø Airport (TOS) (@pcothenet)
19
+ - Fix the name of Tromsø Airport (TOS) (@pcothenet)
12
20
 
13
21
  ## v1.8.0 (13 March 2022)
14
22
 
15
- * Add support for Ruby 3.1 (@timrogers)
16
- * 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)
17
25
 
18
26
  # v1.7.0 (25 August 2021)
19
27
 
20
- * Add support for Ruby 3.0 (@timrogers, with thanks to @kleinjm)
21
- * Add Misrata Airport (`MRA`) in Libya (@timrogers, with thanks to @a21-kevin)
22
- * Drop support for Ruby 2.4 and 2.5, which are no longer officially supported (@timrogers)
23
- * 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)
24
32
 
25
33
  # v1.6.1 (9 May 2020)
26
34
 
27
- * Add an entry for Berlin Brandenburg Airport (`BER`), which is missing from [OpenFlights](http://openflights.org) (@PavelWeSki)
28
- * 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)
29
37
 
30
38
  # v1.6.0 (25 January 2020)
31
39
 
32
- * Update airport data with the latest from [OpenFlights](http://openflights.org)
33
- * 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)
34
42
 
35
43
  # v1.5.0 (5 December 2019)
36
44
 
37
- * Support looking up airports by the name of the city they
38
- are located in with `Airports.find_all_by_city_name` (@viral810, @timrogers)
39
- * Refactor `Airports` so `Airport` objects are only generated once
40
- 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)
41
49
 
42
50
  # v1.4.1 (14 November 2019)
43
51
 
44
- * Correct the time zone of Istanbul Airport (`IST`) (@aliismayilov)
45
- * 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)
46
54
 
47
55
  # v1.4.0 (30 June 2019)
48
56
 
49
- * Drop support for Ruby 2.2 and 2.3, which are no longer officially supported (@timrogers)
50
- * Test against Ruby 2.6 (@timrogers)
51
- * 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)
52
60
 
53
61
  # v1.3.0 (26 June 2019)
54
62
 
55
- * 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)
56
64
 
57
65
  # v1.2.0 (11 March 2018)
58
66
 
59
- * Drop support for Ruby 2.2, which has reached end-of-life and no longer receives security updates (@timrogers)
60
- * 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)
61
69
 
62
70
  # v1.1.0 (11 March 2018)
63
71
 
64
- * 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.3"
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]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Airports
4
- VERSION = "1.8.3"
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.3
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-31 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