diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 451fc9867..8cea3e2f0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/Gemfile b/Gemfile index bb5d1a382..b1ed56757 100644 --- a/Gemfile +++ b/Gemfile @@ -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 @@ -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 diff --git a/bin/console b/bin/console index f46e6a271..6050d4b84 100755 --- a/bin/console +++ b/bin/console @@ -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) diff --git a/changeset/spec/spec_helper.rb b/changeset/spec/spec_helper.rb index a80ea9c97..37451db46 100644 --- a/changeset/spec/spec_helper.rb +++ b/changeset/spec/spec_helper.rb @@ -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' diff --git a/changeset/spec/unit/changeset_spec.rb b/changeset/spec/unit/changeset_spec.rb index 5b01e6662..f68b5ae72 100644 --- a/changeset/spec/unit/changeset_spec.rb +++ b/changeset/spec/unit/changeset_spec.rb @@ -171,8 +171,13 @@ subject(:changeset) { ROM::Changeset::Create.new(relation).data(name: 'Jane') } specify do - expect(changeset.inspect) - .to eql('#"Jane"}>') + if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.4.0') + expect(changeset.inspect) + .to eql('#') + else + expect(changeset.inspect) + .to eql('#"Jane"}>') + end end end diff --git a/core/spec/spec_helper.rb b/core/spec/spec_helper.rb index f7fad14e9..b1509a48a 100644 --- a/core/spec/spec_helper.rb +++ b/core/spec/spec_helper.rb @@ -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 diff --git a/repository/spec/spec_helper.rb b/repository/spec/spec_helper.rb index 0d88ef263..69993f7b7 100644 --- a/repository/spec/spec_helper.rb +++ b/repository/spec/spec_helper.rb @@ -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'))