Skip to content

Commit 5a72eaf

Browse files
authored
Documentation update (#30)
* README: we forgot to update classname of excepttions * prepare version 3.2.1
1 parent e825637 commit 5a72eaf

File tree

9 files changed

+103
-53
lines changed

9 files changed

+103
-53
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ jobs:
1111
strategy:
1212
fail-fast: false
1313
matrix:
14-
os: [ubuntu-latest]
14+
os: [ubuntu-24.04]
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: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
3.2.1 - Wed Jan 22 2025
2+
===============================================================
3+
- Documentation: With 3.0 we changed the classname of exceptions
4+
- test suite: update rubocop
5+
- test suite: alsotest against Ruby 3.4
6+
- various Ruby gem updates
7+
18
3.2.0 - Mon Jun 10 2024
29
===============================================================
310
- Ruby 2.x no longer supported

Gemfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,17 @@ source 'https://rubygems.org'
33
gemspec
44

55
group :development, :test do
6+
gem 'activesupport', '~> 7.2' # 8.x requires Ruby 3.2
67
gem 'async'
78
gem 'rake'
89
gem 'rspec'
910
gem 'rubocop'
10-
gem 'rubocop-rake'
11+
gem 'rubocop-capybara'
12+
gem 'rubocop-factory_bot'
13+
gem 'rubocop-performance'
14+
gem 'rubocop-rails' # shouldn't be needed, https://github.com/rubocop/rubocop/issues/10893
1115
gem 'rubocop-rspec'
16+
gem 'rubocop-rspec_rails'
1217
gem 'vcr'
1318
gem 'webmock'
1419
end

Gemfile.lock

Lines changed: 78 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,140 @@
11
PATH
22
remote: .
33
specs:
4-
opencage-geocoder (3.2.0)
4+
opencage-geocoder (3.2.1)
55

66
GEM
77
remote: https://rubygems.org/
88
specs:
9-
addressable (2.8.6)
10-
public_suffix (>= 2.0.2, < 6.0)
9+
activesupport (7.2.2.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+
addressable (2.8.7)
22+
public_suffix (>= 2.0.2, < 7.0)
1123
ast (2.4.2)
12-
async (2.19.0)
24+
async (2.21.1)
1325
console (~> 1.29)
1426
fiber-annotation
1527
io-event (~> 1.6, >= 1.6.5)
16-
bigdecimal (3.1.8)
17-
console (1.29.0)
28+
base64 (0.2.0)
29+
benchmark (0.4.0)
30+
bigdecimal (3.1.9)
31+
concurrent-ruby (1.3.5)
32+
connection_pool (2.5.0)
33+
console (1.29.2)
1834
fiber-annotation
1935
fiber-local (~> 1.1)
2036
json
2137
crack (1.0.0)
2238
bigdecimal
2339
rexml
2440
diff-lcs (1.5.1)
41+
drb (2.2.1)
2542
fiber-annotation (0.2.0)
2643
fiber-local (1.1.0)
2744
fiber-storage
2845
fiber-storage (1.0.0)
29-
hashdiff (1.1.0)
30-
io-event (1.7.3)
31-
json (2.7.2)
46+
hashdiff (1.1.2)
47+
i18n (1.14.7)
48+
concurrent-ruby (~> 1.0)
49+
io-event (1.7.5)
50+
json (2.9.1)
3251
language_server-protocol (3.17.0.3)
33-
parallel (1.25.1)
34-
parser (3.3.2.0)
52+
logger (1.6.5)
53+
minitest (5.25.4)
54+
parallel (1.26.3)
55+
parser (3.3.7.0)
3556
ast (~> 2.4.1)
3657
racc
37-
public_suffix (5.0.5)
38-
racc (1.8.0)
58+
public_suffix (6.0.1)
59+
racc (1.8.1)
60+
rack (3.1.8)
3961
rainbow (3.1.1)
4062
rake (13.2.1)
41-
regexp_parser (2.9.2)
42-
rexml (3.3.9)
63+
regexp_parser (2.10.0)
64+
rexml (3.4.0)
4365
rspec (3.13.0)
4466
rspec-core (~> 3.13.0)
4567
rspec-expectations (~> 3.13.0)
4668
rspec-mocks (~> 3.13.0)
47-
rspec-core (3.13.0)
69+
rspec-core (3.13.2)
4870
rspec-support (~> 3.13.0)
49-
rspec-expectations (3.13.0)
71+
rspec-expectations (3.13.3)
5072
diff-lcs (>= 1.2.0, < 2.0)
5173
rspec-support (~> 3.13.0)
52-
rspec-mocks (3.13.1)
74+
rspec-mocks (3.13.2)
5375
diff-lcs (>= 1.2.0, < 2.0)
5476
rspec-support (~> 3.13.0)
55-
rspec-support (3.13.1)
56-
rubocop (1.64.1)
77+
rspec-support (3.13.2)
78+
rubocop (1.70.0)
5779
json (~> 2.3)
5880
language_server-protocol (>= 3.17.0)
5981
parallel (~> 1.10)
6082
parser (>= 3.3.0.2)
6183
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)
84+
regexp_parser (>= 2.9.3, < 3.0)
85+
rubocop-ast (>= 1.36.2, < 2.0)
6586
ruby-progressbar (~> 1.7)
66-
unicode-display_width (>= 2.4.0, < 3.0)
67-
rubocop-ast (1.31.3)
87+
unicode-display_width (>= 2.4.0, < 4.0)
88+
rubocop-ast (1.37.0)
6889
parser (>= 3.3.1.0)
6990
rubocop-capybara (2.21.0)
7091
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)
92+
rubocop-factory_bot (2.26.1)
93+
rubocop (~> 1.61)
94+
rubocop-performance (1.23.1)
95+
rubocop (>= 1.48.1, < 2.0)
96+
rubocop-ast (>= 1.31.1, < 2.0)
97+
rubocop-rails (2.29.0)
98+
activesupport (>= 4.2.0)
99+
rack (>= 1.1)
100+
rubocop (>= 1.52.0, < 2.0)
101+
rubocop-ast (>= 1.31.1, < 2.0)
102+
rubocop-rspec (3.4.0)
103+
rubocop (~> 1.61)
104+
rubocop-rspec_rails (2.30.0)
105+
rubocop (~> 1.61)
106+
rubocop-rspec (~> 3, >= 3.0.1)
82107
ruby-progressbar (1.13.0)
83-
unicode-display_width (2.5.0)
84-
vcr (6.2.0)
85-
webmock (3.23.1)
108+
securerandom (0.4.1)
109+
tzinfo (2.0.6)
110+
concurrent-ruby (~> 1.0)
111+
unicode-display_width (3.1.4)
112+
unicode-emoji (~> 4.0, >= 4.0.4)
113+
unicode-emoji (4.0.4)
114+
vcr (6.3.1)
115+
base64
116+
webmock (3.24.0)
86117
addressable (>= 2.8.0)
87118
crack (>= 0.3.2)
88119
hashdiff (>= 0.4.0, < 2.0.0)
89120

90121
PLATFORMS
91-
ruby
122+
arm64-darwin-24
123+
x86_64-linux
92124

93125
DEPENDENCIES
126+
activesupport (~> 7.2)
94127
async
95128
opencage-geocoder!
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

lib/opencage/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module OpenCage
2-
VERSION = '3.2.0'.freeze
2+
VERSION = '3.2.1'.freeze
33
end

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)