Skip to content

Commit a3aabe3

Browse files
committed
README: we forgot to update classname of excetptions
1 parent e825637 commit a3aabe3

File tree

8 files changed

+97
-49
lines changed

8 files changed

+97
-49
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
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

.rubocop.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
require:
2-
- rubocop-rake
32
- rubocop-rspec
3+
- rubocop-performance
44
AllCops:
55
TargetRubyVersion: 3.0
66
NewCops: disable
7+
SuggestExtensions: false
78
Metrics/BlockLength:
89
Max: 100
910
Layout/LineLength:
@@ -19,4 +20,4 @@ Style/HashTransformKeys:
1920
Style/HashTransformValues:
2021
Enabled: true
2122
RSpec/MultipleExpectations:
22-
Max: 10
23+
Max: 10

CHANGES.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
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+
- various Ruby gem updates
6+
17
3.2.0 - Mon Jun 10 2024
28
===============================================================
39
- Ruby 2.x no longer supported

Gemfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@ group :development, :test do
77
gem 'rake'
88
gem 'rspec'
99
gem 'rubocop'
10-
gem 'rubocop-rake'
10+
gem 'rubocop-capybara'
11+
gem 'rubocop-factory_bot'
12+
gem 'rubocop-performance'
13+
gem 'rubocop-rails' # shouldn't be needed, https://github.com/rubocop/rubocop/issues/10893
1114
gem 'rubocop-rspec'
15+
gem 'rubocop-rspec_rails'
1216
gem 'vcr'
1317
gem 'webmock'
1418
end

Gemfile.lock

Lines changed: 76 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -6,83 +6,116 @@ PATH
66
GEM
77
remote: https://rubygems.org/
88
specs:
9-
addressable (2.8.6)
10-
public_suffix (>= 2.0.2, < 6.0)
9+
activesupport (8.0.1)
10+
base64
11+
benchmark (>= 0.3)
12+
bigdecimal
13+
concurrent-ruby (~> 1.0, >= 1.3.1)
14+
connection_pool (>= 2.2.5)
15+
drb
16+
i18n (>= 1.6, < 2)
17+
logger (>= 1.4.2)
18+
minitest (>= 5.1)
19+
securerandom (>= 0.3)
20+
tzinfo (~> 2.0, >= 2.0.5)
21+
uri (>= 0.13.1)
22+
addressable (2.8.7)
23+
public_suffix (>= 2.0.2, < 7.0)
1124
ast (2.4.2)
12-
async (2.19.0)
25+
async (2.21.1)
1326
console (~> 1.29)
1427
fiber-annotation
1528
io-event (~> 1.6, >= 1.6.5)
16-
bigdecimal (3.1.8)
17-
console (1.29.0)
29+
base64 (0.2.0)
30+
benchmark (0.4.0)
31+
bigdecimal (3.1.9)
32+
concurrent-ruby (1.3.5)
33+
connection_pool (2.5.0)
34+
console (1.29.2)
1835
fiber-annotation
1936
fiber-local (~> 1.1)
2037
json
2138
crack (1.0.0)
2239
bigdecimal
2340
rexml
2441
diff-lcs (1.5.1)
42+
drb (2.2.1)
2543
fiber-annotation (0.2.0)
2644
fiber-local (1.1.0)
2745
fiber-storage
2846
fiber-storage (1.0.0)
29-
hashdiff (1.1.0)
30-
io-event (1.7.3)
31-
json (2.7.2)
47+
hashdiff (1.1.2)
48+
i18n (1.14.7)
49+
concurrent-ruby (~> 1.0)
50+
io-event (1.7.5)
51+
json (2.9.1)
3252
language_server-protocol (3.17.0.3)
33-
parallel (1.25.1)
34-
parser (3.3.2.0)
53+
logger (1.6.5)
54+
minitest (5.25.4)
55+
parallel (1.26.3)
56+
parser (3.3.7.0)
3557
ast (~> 2.4.1)
3658
racc
37-
public_suffix (5.0.5)
38-
racc (1.8.0)
59+
public_suffix (6.0.1)
60+
racc (1.8.1)
61+
rack (3.1.8)
3962
rainbow (3.1.1)
4063
rake (13.2.1)
41-
regexp_parser (2.9.2)
42-
rexml (3.3.9)
64+
regexp_parser (2.10.0)
65+
rexml (3.4.0)
4366
rspec (3.13.0)
4467
rspec-core (~> 3.13.0)
4568
rspec-expectations (~> 3.13.0)
4669
rspec-mocks (~> 3.13.0)
47-
rspec-core (3.13.0)
70+
rspec-core (3.13.2)
4871
rspec-support (~> 3.13.0)
49-
rspec-expectations (3.13.0)
72+
rspec-expectations (3.13.3)
5073
diff-lcs (>= 1.2.0, < 2.0)
5174
rspec-support (~> 3.13.0)
52-
rspec-mocks (3.13.1)
75+
rspec-mocks (3.13.2)
5376
diff-lcs (>= 1.2.0, < 2.0)
5477
rspec-support (~> 3.13.0)
55-
rspec-support (3.13.1)
56-
rubocop (1.64.1)
78+
rspec-support (3.13.2)
79+
rubocop (1.70.0)
5780
json (~> 2.3)
5881
language_server-protocol (>= 3.17.0)
5982
parallel (~> 1.10)
6083
parser (>= 3.3.0.2)
6184
rainbow (>= 2.2.2, < 4.0)
62-
regexp_parser (>= 1.8, < 3.0)
63-
rexml (>= 3.2.5, < 4.0)
64-
rubocop-ast (>= 1.31.1, < 2.0)
85+
regexp_parser (>= 2.9.3, < 3.0)
86+
rubocop-ast (>= 1.36.2, < 2.0)
6587
ruby-progressbar (~> 1.7)
66-
unicode-display_width (>= 2.4.0, < 3.0)
67-
rubocop-ast (1.31.3)
88+
unicode-display_width (>= 2.4.0, < 4.0)
89+
rubocop-ast (1.37.0)
6890
parser (>= 3.3.1.0)
6991
rubocop-capybara (2.21.0)
7092
rubocop (~> 1.41)
71-
rubocop-factory_bot (2.26.0)
72-
rubocop (~> 1.41)
73-
rubocop-rake (0.6.0)
74-
rubocop (~> 1.0)
75-
rubocop-rspec (2.31.0)
76-
rubocop (~> 1.40)
77-
rubocop-capybara (~> 2.17)
78-
rubocop-factory_bot (~> 2.22)
79-
rubocop-rspec_rails (~> 2.28)
80-
rubocop-rspec_rails (2.29.0)
81-
rubocop (~> 1.40)
93+
rubocop-factory_bot (2.26.1)
94+
rubocop (~> 1.61)
95+
rubocop-performance (1.23.1)
96+
rubocop (>= 1.48.1, < 2.0)
97+
rubocop-ast (>= 1.31.1, < 2.0)
98+
rubocop-rails (2.29.0)
99+
activesupport (>= 4.2.0)
100+
rack (>= 1.1)
101+
rubocop (>= 1.52.0, < 2.0)
102+
rubocop-ast (>= 1.31.1, < 2.0)
103+
rubocop-rspec (3.4.0)
104+
rubocop (~> 1.61)
105+
rubocop-rspec_rails (2.30.0)
106+
rubocop (~> 1.61)
107+
rubocop-rspec (~> 3, >= 3.0.1)
82108
ruby-progressbar (1.13.0)
83-
unicode-display_width (2.5.0)
84-
vcr (6.2.0)
85-
webmock (3.23.1)
109+
securerandom (0.4.1)
110+
tzinfo (2.0.6)
111+
concurrent-ruby (~> 1.0)
112+
unicode-display_width (3.1.4)
113+
unicode-emoji (~> 4.0, >= 4.0.4)
114+
unicode-emoji (4.0.4)
115+
uri (1.0.2)
116+
vcr (6.3.1)
117+
base64
118+
webmock (3.24.0)
86119
addressable (>= 2.8.0)
87120
crack (>= 0.3.2)
88121
hashdiff (>= 0.4.0, < 2.0.0)
@@ -96,8 +129,12 @@ DEPENDENCIES
96129
rake
97130
rspec
98131
rubocop
99-
rubocop-rake
132+
rubocop-capybara
133+
rubocop-factory_bot
134+
rubocop-performance
135+
rubocop-rails
100136
rubocop-rspec
137+
rubocop-rspec_rails
101138
vcr
102139
webmock
103140

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff 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'
114114
rescue StandardError => e
115115
p 'other error: ' + e.message
116116
end
117117

118118
# Using strings instead of numbers for reverse geocoding
119119
geocoder.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

122122
begin
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

spec/open_cage/geocoder/request_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
let(:api_key) { '1111222233334444' }
55

66
it 'creates a URI instance' do
7-
expect(described_class.new(api_key, 'New York').url).to be_kind_of(URI::HTTPS)
7+
expect(described_class.new(api_key, 'New York').url).to be_a(URI::HTTPS)
88
end
99

1010
it 'forward' do

spec/rubocop_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
describe 'Ruby linting', type: :feature do
44
it 'run rubocop' do
55
expect do
6-
system('bundle exec rubocop --format simple 2>&1')
6+
system('bundle exec rubocop --no-color --format simple 2>&1')
77
end.to output(/no offenses detect/).to_stdout_from_any_process
88
end
99
end

0 commit comments

Comments
 (0)