File tree Expand file tree Collapse file tree 3 files changed +10
-5
lines changed
Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 1313 matrix :
1414 os : [ubuntu-latest]
1515 # https://www.ruby-lang.org/en/downloads/branches/
16- ruby : ["3.1", "3.2", "3.3"]
16+ ruby : ["3.1", "3.2", "3.3", "3.4" ]
1717 runs-on : ${{ matrix.os }}
1818 steps :
1919 - uses : actions/checkout@v4
Original file line number Diff line number Diff line change 1+ 3.2.1 - Mon Jan 20 2025
2+ ===============================================================
3+ - Documentation: With 3.0 we changed the classname of exceptions
4+ - test suite: test against Ruby 3.4
5+
163.2.0 - Mon Jun 10 2024
27===============================================================
38- Ruby 2.x no longer supported
Original file line number Diff line number Diff line change @@ -107,17 +107,17 @@ begin
107107 # Invalid API key
108108 geocoder = OpenCage ::Geocoder .new (api_key: ' invalid-api-key' )
109109 geocoder.geocode(' Manchester' )
110- rescue OpenCage ::Geocoder ::AuthenticationError => e
110+ rescue OpenCage ::Error ::AuthenticationError => e
111111 p ' invalid apikey'
112- rescue OpenCage ::Geocoder ::QuotaExceeded => e
112+ rescue OpenCage ::Error ::QuotaExceeded => e
113113 p ' over quota'
114114rescue StandardError => e
115115 p ' other error: ' + e.message
116116end
117117
118118# Using strings instead of numbers for reverse geocoding
119119geocoder.reverse_geocode(' 51.5019951' , ' -0.0698806' )
120- # raises OpenCage::Geocoder ::InvalidRequest (not valid numeric coordinates: "51.5019951", "-0.0698806")
120+ # raises OpenCage::Error ::InvalidRequest (not valid numeric coordinates: "51.5019951", "-0.0698806")
121121
122122begin
123123
@@ -147,7 +147,7 @@ File.foreach('queries.txt') do |line|
147147 # there is an invalid line in the queries.txt file
148148 result = geocoder.reverse_geocode(Float (latitude), Float (longitude))
149149 results.push(result)
150- rescue ArgumentError , OpenCage ::Geocoder ::GeocodingError => error
150+ rescue ArgumentError , OpenCage ::Error ::GeocodingError => error
151151 # Stop looping through the queries if there is an error
152152 puts " Error: #{ error.message } "
153153 break
You can’t perform that action at this time.
0 commit comments