From cc032bd7c34285ed7edc00e5fa7fcecb204f4866 Mon Sep 17 00:00:00 2001 From: Marc Tobias Date: Fri, 28 Jul 2023 18:43:29 +0200 Subject: [PATCH] version 3.1.1 --- .github/workflows/build.yml | 2 +- CHANGES.txt | 6 ++- Gemfile.lock | 49 ++++++++++++++---------- README.md | 4 +- lib/opencage/version.rb | 2 +- spec/open_cage/geocoder/location_spec.rb | 3 ++ 6 files changed, 40 insertions(+), 26 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 04c1a4a..bb3713e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,7 +12,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - # Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0' + # https://www.ruby-lang.org/en/downloads/branches/ ruby: ["2.7", "3.0", "3.1", "3.2"] runs-on: ${{ matrix.os }} steps: diff --git a/CHANGES.txt b/CHANGES.txt index 1b1c85e..49afc35 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,5 +1,9 @@ -unreleased +3.1.1 - Fri Jul 28 2023 +=============================================================== +- feature: add .latitude and .longitude accessor aliases (thanks @thestelz) - test suite: Switched from Travis-CI to Github Actions +- test suite: test against Ruby 3.2 +- various Ruby gem updates, newest Rubocop 3.1.0 - Mon Jan 16 2023 =============================================================== diff --git a/Gemfile.lock b/Gemfile.lock index bc8e8b8..4736ca0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,12 +1,12 @@ PATH remote: . specs: - opencage-geocoder (3.1.0) + opencage-geocoder (3.1.1) GEM remote: https://rubygems.org/ specs: - addressable (2.8.1) + addressable (2.8.4) public_suffix (>= 2.0.2, < 6.0) ast (2.4.2) crack (0.4.5) @@ -14,49 +14,56 @@ GEM diff-lcs (1.5.0) hashdiff (1.0.1) json (2.6.3) - parallel (1.22.1) - parser (3.2.0.0) + language_server-protocol (3.17.0.3) + parallel (1.23.0) + parser (3.2.2.3) ast (~> 2.4.1) - public_suffix (5.0.1) + racc + public_suffix (5.0.3) + racc (1.7.1) rainbow (3.1.1) rake (13.0.6) - regexp_parser (2.6.1) - rexml (3.2.5) + regexp_parser (2.8.1) + rexml (3.2.6) rspec (3.12.0) rspec-core (~> 3.12.0) rspec-expectations (~> 3.12.0) rspec-mocks (~> 3.12.0) - rspec-core (3.12.0) + rspec-core (3.12.2) rspec-support (~> 3.12.0) - rspec-expectations (3.12.2) + rspec-expectations (3.12.3) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) - rspec-mocks (3.12.2) + rspec-mocks (3.12.6) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) - rspec-support (3.12.0) - rubocop (1.43.0) + rspec-support (3.12.1) + rubocop (1.55.0) json (~> 2.3) + language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.2.0.0) + parser (>= 3.2.2.3) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.24.1, < 2.0) + rubocop-ast (>= 1.28.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.24.1) - parser (>= 3.1.1.0) - rubocop-capybara (2.17.0) + rubocop-ast (1.29.0) + parser (>= 3.2.1.0) + rubocop-capybara (2.18.0) rubocop (~> 1.41) + rubocop-factory_bot (2.23.1) + rubocop (~> 1.33) rubocop-rake (0.6.0) rubocop (~> 1.0) - rubocop-rspec (2.18.0) + rubocop-rspec (2.22.0) rubocop (~> 1.33) - rubocop-capybara - ruby-progressbar (1.11.0) + rubocop-capybara (~> 2.17) + rubocop-factory_bot (~> 2.22) + ruby-progressbar (1.13.0) unicode-display_width (2.4.2) - vcr (6.1.0) + vcr (6.2.0) webmock (3.18.1) addressable (>= 2.8.0) crack (>= 0.3.2) diff --git a/README.md b/README.md index a693e86..8d37210 100644 --- a/README.md +++ b/README.md @@ -141,11 +141,11 @@ geocoder = OpenCage::Geocoder.new(api_key: 'your-api-key-here') results = [] File.foreach('queries.txt') do |line| - lat, lng = line.chomp.split(',') + latitude, longitude = line.chomp.split(',') # Use Float() rather than #to_f because it will throw an ArgumentError if # there is an invalid line in the queries.txt file - result = geocoder.reverse_geocode(Float(lat), Float(lng)) + result = geocoder.reverse_geocode(Float(latitude), Float(longitude)) results.push(result) rescue ArgumentError, OpenCage::Geocoder::GeocodingError => error # Stop looping through the queries if there is an error diff --git a/lib/opencage/version.rb b/lib/opencage/version.rb index 246945e..4c3cd7f 100644 --- a/lib/opencage/version.rb +++ b/lib/opencage/version.rb @@ -1,3 +1,3 @@ module OpenCage - VERSION = '3.1.0'.freeze + VERSION = '3.1.1'.freeze end diff --git a/spec/open_cage/geocoder/location_spec.rb b/spec/open_cage/geocoder/location_spec.rb index 67f5ad3..a9e724b 100644 --- a/spec/open_cage/geocoder/location_spec.rb +++ b/spec/open_cage/geocoder/location_spec.rb @@ -25,6 +25,9 @@ expect(reverse_result.lat).to eq(-22.6791826) expect(reverse_result.lng).to eq(14.5268016) + + expect(reverse_result.latitude).to eq(-22.6791826) + expect(reverse_result.longitude).to eq(14.5268016) end it 'has bounds', :vcr do