Skip to content

Commit

Permalink
Gemfile compatible versions of ruby, activerecord, sqlite
Browse files Browse the repository at this point in the history
hideous
  • Loading branch information
notEthan committed Nov 24, 2024
1 parent e12f78d commit ca9f25b
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,27 @@ group(:test) do
gem('rack-test')
gem('webrick')
gem('api_hammer')
activerecord_version =
RUBY_ENGINE == 'jruby' ? '< 7.1' : # TODO rm. some incompatibility with activerecord-jdbc-adapter at 7.1
nil
gem('activerecord', *activerecord_version)
platform(:mri, :truffleruby) do
gem('sqlite3', '~> 1.4') # loosen this in accordance with active_record/connection_adapters/sqlite3_adapter.rb

ruby_version = RUBY_VERSION.split('.').map(&:to_i)
# sqlite3 version is in accordance with active_record/connection_adapters/sqlite3_adapter.rb
[
{activerecord: '~> 8.0', ruby: [3, 2, 0], sqlite: '>= 2.1'},
{activerecord: '~> 7.2', ruby: [3, 1, 0], sqlite: '>= 1.4'},
{activerecord: '~> 7.0', ruby: [2, 7, 0], sqlite: '>= 1.4'},
{activerecord: '~> 6.0', ruby: [2, 5, 0], sqlite: '~> 1.4'},
].map(&:values).each do |activerecord, ruby, sqlite|
if (ruby_version <=> ruby) >= 0
if RUBY_ENGINE == 'jruby'
# override. update this per released version of activerecord-jdbc-adapter, current latest 70.x corresponding to Rails 7.0.x
activerecord = '< 7.1'
end
gem('activerecord', activerecord)

platform(:mri, :truffleruby) do
gem('sqlite3', sqlite)
end
break
end
end
platform(:jruby) do
gem('activerecord-jdbcsqlite3-adapter')
Expand Down

0 comments on commit ca9f25b

Please sign in to comment.