Skip to content

Commit

Permalink
Update Gemfile and CI configuration for Ruby 3.4 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
flash-gordon committed Dec 30, 2024
1 parent 02bd64b commit 5a15539
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 19 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@ jobs:
fail-fast: false
matrix:
ruby:
- '3.4'
- '3.3'
- '3.2'
- '3.1'
- '3.0'
include:
- ruby: '3.3'
- ruby: '3.4'
use_dry_transformer_master: 'true'
use_use_rom_sql_master: 'true'
use_dry_initializer_main: 'true'
env:
COVERAGE: "${{matrix.coverage}}"
COVERAGE_TOKEN: "${{secrets.CODACY_PROJECT_TOKEN}}"
BASE_DB_URI: localhost/rom_repository
USE_DRY_TRANSFORMER_MASTER: "${{matrix.use_dry_transformer_master}}"
USE_ROM_SQL_MASTER: "${{matrix.use_rom_sql_master}}"
USE_DRY_INITIALIZER_MAIN: "${{matrix.use_dry_initializer_main}}"
CODACY_RUN_LOCAL: "${{matrix.coverage}}"
CODACY_PROJECT_TOKEN: "${{secrets.CODACY_PROJECT_TOKEN}}"
APT_DEPS: libpq-dev libsqlite3-dev
Expand Down
12 changes: 10 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ if ENV['USE_TRANSPROC_MASTER'].eql?('true')
gem 'transproc', github: 'solnic/transproc', branch: 'master'
end

if ENV['USE_DRY_INITIALIZER_MAIN'].eql?('true')
gem 'dry-initializer', github: 'dry-rb/dry-initializer', branch: 'main'
end

group :sql do
gem 'sequel', '~> 5.0'
gem 'sqlite3', platforms: :ruby
Expand Down Expand Up @@ -49,8 +53,12 @@ group :docs do
end

group :tools do
gem 'pry'
gem 'pry-byebug', platforms: :ruby
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.4.0')
gem 'debug', platforms: :ruby
else
gem 'pry'
gem 'pry-byebug', platforms: :ruby
end
end

group :benchmarks do
Expand Down
9 changes: 7 additions & 2 deletions bin/console
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,17 @@ require 'bundler'

Bundler.setup

require 'pry'
require 'rom-repository'
require 'rom-changeset'
require 'pry-byebug'
require 'dry/monitor'

%w[pry-byebug debug pry].each do |gem|
require gem
rescue LoadError
else
break
end

config = ROM::Configuration.new(:sql, 'postgres://localhost/rom_console')
notifications = Dry::Monitor::Notifications.new(:console)

Expand Down
7 changes: 4 additions & 3 deletions changeset/spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@
Warning.ignore(/__LINE__/)
Warning.process { |w| raise w } if ENV['FAIL_ON_WARNINGS'].eql?('true')

begin
require 'pry'
require 'pry-byebug'
%w[pry-byebug debug pry].each do |gem|
require gem
rescue LoadError
else
break
end

require 'rom-changeset'
Expand Down
9 changes: 7 additions & 2 deletions changeset/spec/unit/changeset_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,13 @@
subject(:changeset) { ROM::Changeset::Create.new(relation).data(name: 'Jane') }

specify do
expect(changeset.inspect)
.to eql('#<ROM::Changeset::Create relation=:users data={:name=>"Jane"}>')
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.4.0')
expect(changeset.inspect)
.to eql('#<ROM::Changeset::Create relation=:users data={name: "Jane"}>')
else
expect(changeset.inspect)
.to eql('#<ROM::Changeset::Create relation=:users data={:name=>"Jane"}>')
end
end
end

Expand Down
7 changes: 4 additions & 3 deletions core/spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@

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

begin
require 'pry'
require 'pry-byebug'
%w[pry-byebug debug pry].each do |gem|
require gem
rescue LoadError
else
break
end

module SpecProfiler
Expand Down
7 changes: 4 additions & 3 deletions repository/spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@
require 'rom-sql'
require 'rom-repository'

begin
require 'pry'
require 'pry-byebug'
%w[pry-byebug debug pry].each do |gem|
require gem
rescue LoadError
else
break
end

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

0 comments on commit 5a15539

Please sign in to comment.