Skip to content

Commit 26f45dd

Browse files
authored
Housekeeping for the gem: require Ruby3, updates to newest Rubocop with rubocop-rake and rubocop-rspec plugins (#85)
* implements rubocop-rake and rubocop-rspec * most recent rubocop * minimum ruby version >= 3.0 * rebase on upstream/master * adds entry to UPGRADING.md * settle version on v2.2.0 * add the missing `bundle install` step to the RELEASING doc
1 parent 67c724b commit 26f45dd

File tree

70 files changed

+333
-146
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+333
-146
lines changed

.github/workflows/rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ jobs:
88
- name: Set up Ruby
99
uses: ruby/setup-ruby@v1
1010
with:
11-
ruby-version: 2.7
11+
ruby-version: 3.0
1212
bundler-cache: true
1313
- run: bundle exec rubocop

.github/workflows/test.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ jobs:
66
strategy:
77
matrix:
88
ruby-version:
9-
- "2.7"
109
- "3.0"
1110
- "3.1"
11+
- "3.2"
12+
- "3.3"
13+
- "jruby-9.4"
1214
steps:
1315
- uses: actions/checkout@v2
1416
- name: Set up Ruby

.rubocop.yml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1+
inherit_from: .rubocop_todo.yml
2+
3+
require:
4+
- rubocop-rake
5+
- rubocop-rspec
6+
17
AllCops:
2-
TargetRubyVersion: 2.7
8+
TargetRubyVersion: 3.0
39
NewCops: enable
410
Exclude:
511
- vendor/**/*
@@ -25,4 +31,22 @@ Layout/LineLength:
2531

2632
Style/MultilineBlockChain:
2733
Exclude:
28-
- spec/**/*
34+
- spec/**/*
35+
36+
RSpec/MultipleExpectations:
37+
Enabled: false
38+
39+
RSpec/SpecFilePathFormat:
40+
Exclude:
41+
- "spec/strava/version_spec.rb"
42+
- "spec/strava/oauth/client_spec.rb"
43+
- "spec/strava/oauth/config_spec.rb"
44+
- "spec/strava/models/activities/ride_spec.rb"
45+
- "spec/strava/models/activities/swim_spec.rb"
46+
- "spec/strava/models/activities/run_spec.rb"
47+
48+
RSpec/ExampleLength:
49+
Enabled: false
50+
51+
RSpec/DescribeClass:
52+
Enabled: false

.rubocop_todo.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# This configuration was generated by
2+
# `rubocop --auto-gen-config`
3+
# on 2024-03-30 08:58:43 UTC using RuboCop version 1.56.0.
4+
# The point is for the user to remove these configuration records
5+
# one by one as the offenses are removed from the code base.
6+
# Note that changes in the inspected code, or installation of new
7+
# versions of RuboCop, may require this file to be generated again.
8+
9+
# Offense count: 13
10+
# This cop supports unsafe autocorrection (--autocorrect-all).
11+
# Configuration parameters: SkipBlocks, EnforcedStyle.
12+
# SupportedStyles: described_class, explicit
13+
RSpec/DescribedClass:
14+
Exclude:
15+
- 'spec/strava/models/athlete_spec.rb'
16+
- 'spec/strava/oauth/client_spec.rb'
17+
- 'spec/strava/webhooks/client_spec.rb'
18+
19+
# Offense count: 1
20+
RSpec/MultipleDescribes:
21+
Exclude:
22+
- 'spec/strava/api/client/endpoints/activities/activity_spec.rb'
23+
24+
# Offense count: 5
25+
# Configuration parameters: AllowedGroups.
26+
RSpec/NestedGroups:
27+
Max: 4

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
### 2.1.1 (Next)
1+
### 2.2.0 (Next)
22

3-
* [#84](https://github.com/dblock/strava-ruby-client/pull/84): Adds back activity photos (finished PR #83) - [@simonneutert](https://github.com/simonneutert).
43
* [#83](https://github.com/dblock/strava-ruby-client/pull/83): Adds back activity photos - [@dillon-co](https://github.com/dillon-co).
4+
* [#84](https://github.com/dblock/strava-ruby-client/pull/84): Adds back activity photos (finished PR #83) - [@simonneutert](https://github.com/simonneutert).
5+
* [#85](https://github.com/dblock/strava-ruby-client/pull/85): Lays groundwork to v3.0.0 of the gem (ruby3, newest rubocop, rubocop-rake and rubocop-rspec) - [@simonneutert](https://github.com/simonneutert).
56
* Your contribution here.
67

78
### 2.1.0 (2024/3/20)

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ group :development, :test do
1313
gem 'pry'
1414
gem 'rake'
1515
gem 'rspec'
16-
gem 'rubocop', '1.30.0' # Lock to specific version to avoid breaking cops/changes
16+
gem 'rubocop', '1.66.1'
1717
gem 'rubocop-rake'
1818
gem 'rubocop-rspec'
1919
gem 'vcr'

RELEASING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ Add the next release to [CHANGELOG.md](CHANGELOG.md).
5252

5353
Increment the third version number in [lib/strava/version.rb](lib/strava/version.rb).
5454

55+
Run `bundle install` to update the Gemfile.lock.
56+
5557
Commit your changes.
5658

5759
```

UPGRADING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Upgrading Strava-Ruby-Client
22

3+
### Upgrading to >= 2.2.0
4+
5+
Support for Ruby 2.x has been dropped. The minimum required Ruby version is now 3.0.0.
6+
37
### Upgrading to >= 2.1.0
48

59
The change in [#80](https://github.com/dblock/strava-ruby-client/pull/80) removes default values for Faraday's SSL settings `ca_file` and `ca_path`.

bin/strava-webhooks

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ require 'dotenv/load'
55
require 'webrick'
66
require 'strava-ruby-client'
77

8-
logger = ::Logger.new($stdout)
8+
logger = Logger.new($stdout)
99
logger.level = Logger::INFO
1010

1111
client = Strava::Webhooks::Client.new(

lib/strava/api/pagination.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ def each
4848

4949
private
5050

51-
def method_missing(method_symbol, *args, &block)
52-
@collection.send(method_symbol, *args, &block)
51+
def method_missing(method_symbol, ...)
52+
@collection.send(method_symbol, ...)
5353
end
5454

5555
def respond_to_missing?(method_name, include_private = false)

0 commit comments

Comments
 (0)