Skip to content

Commit e4b5471

Browse files
committed
Add Ruby 3.3/3.4/4.0, drop EOL 2.7
- Drop Ruby 2.7 (EOL; fabrication 2.31 already requires >= 3.0) - Add Ruby 3.3, 3.4, 4.0 to CI matrix - Bump required_ruby_version to >= 3.0 in all four gemspecs - Update .ruby-version to 3.4 Ruby 3.4 changed Hash#inspect to use the new hash syntax for symbol keys: {regex: /foo/} instead of {:regex=>/foo/}. The validation error message includes hash params via #inspect, so the spec regex needs to match both formats for compatibility across Ruby versions.
1 parent 0bf9279 commit e4b5471

11 files changed

Lines changed: 27 additions & 22 deletions

.github/workflows/ci.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
ruby:
18+
- "4.0"
19+
- "3.4"
20+
- "3.3"
1821
- "3.2"
1922
- "3.1"
2023
- "3.0"
21-
- "2.7"
2224
rails:
2325
- "8.1"
2426
- "8.0"
@@ -29,19 +31,13 @@ jobs:
2931
- "none"
3032
exclude:
3133
# Rails 7.2+ requires Ruby >= 3.1
32-
- ruby: "2.7"
33-
rails: "7.2"
3434
- ruby: "3.0"
3535
rails: "7.2"
3636
# Rails 8.0+ requires Ruby >= 3.2
37-
- ruby: "2.7"
38-
rails: "8.0"
3937
- ruby: "3.0"
4038
rails: "8.0"
4139
- ruby: "3.1"
4240
rails: "8.0"
43-
- ruby: "2.7"
44-
rails: "8.1"
4541
- ruby: "3.0"
4642
rails: "8.1"
4743
- ruby: "3.1"

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ plugins:
33
- rubocop-rake
44

55
AllCops:
6-
TargetRubyVersion: 2.7
6+
TargetRubyVersion: 3.0
77
NewCops: enable
88
SuggestExtensions: false
99
Exclude:

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.2
1+
3.4

Gemfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ group :development do
3232
gem "pry-byebug"
3333

3434
# documentation
35-
gem "yard", require: false
35+
gem "rdoc", require: false
36+
gem "yard", require: false
3637

3738
# rails needs this for development
3839
gem "listen"

Gemfile.lock

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ PATH
22
remote: .
33
specs:
44
diaspora_federation (1.1.0)
5+
base64
56
faraday (>= 1.0, < 3)
67
faraday-follow_redirects (~> 0.3)
78
nokogiri (~> 1.6, >= 1.6.8)
@@ -310,6 +311,7 @@ DEPENDENCIES
310311
pry
311312
pry-byebug
312313
rake
314+
rdoc
313315
rspec (~> 3.13.0)
314316
rspec-collection_matchers (~> 1.2.0)
315317
rspec-json_expectations (~> 2.1)

Rakefile

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,18 @@ rescue LoadError
66
puts "You must `gem install bundler` and `bundle install` to run rake tasks"
77
end
88

9-
require "rdoc/task"
10-
11-
RDoc::Task.new(:rdoc) do |rdoc|
12-
rdoc.rdoc_dir = "rdoc"
13-
rdoc.title = "DiasporaFederation"
14-
rdoc.options << "--line-numbers"
15-
rdoc.rdoc_files.include("lib/**/*.rb")
9+
begin
10+
require "rdoc/task"
11+
RDoc::Task.new(:rdoc) do |rdoc|
12+
rdoc.rdoc_dir = "rdoc"
13+
rdoc.title = "DiasporaFederation"
14+
rdoc.options << "--line-numbers"
15+
rdoc.rdoc_files.include("lib/**/*.rb")
16+
end
17+
rescue LoadError
18+
# rdoc is not part of the default gems since Ruby 4.0 and is only
19+
# installed in the :development bundle group; gracefully skip the
20+
# task in CI where BUNDLE_WITHOUT=development is set.
1621
end
1722

1823
if defined?(Rails)

diaspora_federation-json_schema.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ Gem::Specification.new do |s|
2222

2323
s.files = Dir["lib/diaspora_federation/schemas.rb", "lib/diaspora_federation/schemas/*.json"]
2424

25-
s.required_ruby_version = ">= 2.7"
25+
s.required_ruby_version = ">= 3.0"
2626
end

diaspora_federation-rails.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
2222
s.files = Dir["app/**/*", "config/routes.rb", "config/initializers/*",
2323
"lib/diaspora_federation/{engine,rails}.rb", "LICENSE", "README.md", "Changelog.md"]
2424

25-
s.required_ruby_version = ">= 2.7"
25+
s.required_ruby_version = ">= 3.0"
2626

2727
s.add_dependency "actionpack", ">= 6.1", "< 9"
2828

diaspora_federation-test.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
2222

2323
s.files = Dir["lib/diaspora_federation/test.rb", "lib/diaspora_federation/test/*"]
2424

25-
s.required_ruby_version = ">= 2.7"
25+
s.required_ruby_version = ">= 3.0"
2626

2727
s.add_dependency "diaspora_federation", DiasporaFederation::VERSION
2828
s.add_dependency "fabrication", "~> 2.29"

diaspora_federation.gemspec

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ Gem::Specification.new do |s|
2727
"lib/diaspora_federation/test/*",
2828
"lib/tasks/*.rake"]
2929

30-
s.required_ruby_version = ">= 2.7"
30+
s.required_ruby_version = ">= 3.0"
3131

32+
s.add_dependency "base64"
3233
s.add_dependency "faraday", ">= 1.0", "< 3"
3334
s.add_dependency "faraday-follow_redirects", "~> 0.3"
3435
s.add_dependency "nokogiri", "~> 1.6", ">= 1.6.8"

0 commit comments

Comments
 (0)