Skip to content

Commit

Permalink
Add support to sqlite3 v2
Browse files Browse the repository at this point in the history
  • Loading branch information
lucascaton committed Apr 21, 2024
1 parent cf3ae63 commit 0ca6f01
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,21 @@ require 'json'
rails_versions = JSON.parse(Net::HTTP.get(URI('https://rubygems.org/api/v1/versions/rails.json')))
.group_by { |version| version['number'] }.keys.grep_v(/rc|racecar|beta|pre/)

%w[5.0 5.1 5.2 6.0 6.1 7.0 7.1].each do |version|
appraise "rails_#{version}" do
%w[5.0 5.1 5.2 6.0 6.1 7.0 7.1].each do |rails_version|
appraise "rails_#{rails_version}" do
current_version = rails_versions
.select { |key| key.match(/\A#{version}/) }
.select { |key| key.match(/\A#{rails_version}/) }
.max { |a, b| Gem::Version.new(a) <=> Gem::Version.new(b) }

gem 'activesupport', "~> #{current_version}"
gem 'activerecord', "~> #{current_version}"

if Gem::Version.new(version) > Gem::Version.new(5.0)
gem 'sqlite3'
else
if Gem::Version.new(rails_version) <= Gem::Version.new(5.0)
gem 'sqlite3', '< 1.4'
elsif Gem::Version.new(RUBY_VERSION) < '3'
gem 'sqlite3', '< 2'
else
gem 'sqlite3'
end
end
end

0 comments on commit 0ca6f01

Please sign in to comment.