Skip to content

Commit 5a15539

Browse files
committed
Update Gemfile and CI configuration for Ruby 3.4 compatibility
1 parent 02bd64b commit 5a15539

File tree

7 files changed

+40
-19
lines changed

7 files changed

+40
-19
lines changed

.github/workflows/ci.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,20 @@ jobs:
2727
fail-fast: false
2828
matrix:
2929
ruby:
30+
- '3.4'
3031
- '3.3'
3132
- '3.2'
3233
- '3.1'
33-
- '3.0'
3434
include:
35-
- ruby: '3.3'
35+
- ruby: '3.4'
3636
use_dry_transformer_master: 'true'
37-
use_use_rom_sql_master: 'true'
37+
use_dry_initializer_main: 'true'
3838
env:
3939
COVERAGE: "${{matrix.coverage}}"
4040
COVERAGE_TOKEN: "${{secrets.CODACY_PROJECT_TOKEN}}"
4141
BASE_DB_URI: localhost/rom_repository
4242
USE_DRY_TRANSFORMER_MASTER: "${{matrix.use_dry_transformer_master}}"
43-
USE_ROM_SQL_MASTER: "${{matrix.use_rom_sql_master}}"
43+
USE_DRY_INITIALIZER_MAIN: "${{matrix.use_dry_initializer_main}}"
4444
CODACY_RUN_LOCAL: "${{matrix.coverage}}"
4545
CODACY_PROJECT_TOKEN: "${{secrets.CODACY_PROJECT_TOKEN}}"
4646
APT_DEPS: libpq-dev libsqlite3-dev

Gemfile

+10-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ if ENV['USE_TRANSPROC_MASTER'].eql?('true')
1616
gem 'transproc', github: 'solnic/transproc', branch: 'master'
1717
end
1818

19+
if ENV['USE_DRY_INITIALIZER_MAIN'].eql?('true')
20+
gem 'dry-initializer', github: 'dry-rb/dry-initializer', branch: 'main'
21+
end
22+
1923
group :sql do
2024
gem 'sequel', '~> 5.0'
2125
gem 'sqlite3', platforms: :ruby
@@ -49,8 +53,12 @@ group :docs do
4953
end
5054

5155
group :tools do
52-
gem 'pry'
53-
gem 'pry-byebug', platforms: :ruby
56+
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.4.0')
57+
gem 'debug', platforms: :ruby
58+
else
59+
gem 'pry'
60+
gem 'pry-byebug', platforms: :ruby
61+
end
5462
end
5563

5664
group :benchmarks do

bin/console

+7-2
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,17 @@ require 'bundler'
55

66
Bundler.setup
77

8-
require 'pry'
98
require 'rom-repository'
109
require 'rom-changeset'
11-
require 'pry-byebug'
1210
require 'dry/monitor'
1311

12+
%w[pry-byebug debug pry].each do |gem|
13+
require gem
14+
rescue LoadError
15+
else
16+
break
17+
end
18+
1419
config = ROM::Configuration.new(:sql, 'postgres://localhost/rom_console')
1520
notifications = Dry::Monitor::Notifications.new(:console)
1621

changeset/spec/spec_helper.rb

+4-3
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@
1818
Warning.ignore(/__LINE__/)
1919
Warning.process { |w| raise w } if ENV['FAIL_ON_WARNINGS'].eql?('true')
2020

21-
begin
22-
require 'pry'
23-
require 'pry-byebug'
21+
%w[pry-byebug debug pry].each do |gem|
22+
require gem
2423
rescue LoadError
24+
else
25+
break
2526
end
2627

2728
require 'rom-changeset'

changeset/spec/unit/changeset_spec.rb

+7-2
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,13 @@
171171
subject(:changeset) { ROM::Changeset::Create.new(relation).data(name: 'Jane') }
172172

173173
specify do
174-
expect(changeset.inspect)
175-
.to eql('#<ROM::Changeset::Create relation=:users data={:name=>"Jane"}>')
174+
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.4.0')
175+
expect(changeset.inspect)
176+
.to eql('#<ROM::Changeset::Create relation=:users data={name: "Jane"}>')
177+
else
178+
expect(changeset.inspect)
179+
.to eql('#<ROM::Changeset::Create relation=:users data={:name=>"Jane"}>')
180+
end
176181
end
177182
end
178183

core/spec/spec_helper.rb

+4-3
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@
1818

1919
Dry::Core::Deprecations.set_logger!(SPEC_ROOT.join('../log/deprecations.log'))
2020

21-
begin
22-
require 'pry'
23-
require 'pry-byebug'
21+
%w[pry-byebug debug pry].each do |gem|
22+
require gem
2423
rescue LoadError
24+
else
25+
break
2526
end
2627

2728
module SpecProfiler

repository/spec/spec_helper.rb

+4-3
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@
2121
require 'rom-sql'
2222
require 'rom-repository'
2323

24-
begin
25-
require 'pry'
26-
require 'pry-byebug'
24+
%w[pry-byebug debug pry].each do |gem|
25+
require gem
2726
rescue LoadError
27+
else
28+
break
2829
end
2930

3031
LOGGER = Logger.new(File.open('./log/test.log', 'a'))

0 commit comments

Comments
 (0)