Skip to content

Commit

Permalink
Merge pull request #110 from lucascaton/add-support-to-sqlite3-v2
Browse files Browse the repository at this point in the history
Skip `sqlite3` v2 for now
  • Loading branch information
lucascaton authored Apr 21, 2024
2 parents cf3ae63 + 184da01 commit 07d5fbf
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 18 deletions.
19 changes: 13 additions & 6 deletions Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,26 @@ 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'
else
# v2.x isn't yet working. See: https://github.com/sparklemotion/sqlite3-ruby/issues/529
gem 'sqlite3', '< 2'
end

# elsif Gem::Version.new(RUBY_VERSION) < '3'
# gem 'sqlite3', '< 2'
# else
# gem 'sqlite3'
# end
end
end
4 changes: 4 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ GEM
json (2.6.3)
language_server-protocol (3.17.0.3)
method_source (1.0.0)
mini_portile2 (2.8.6)
minitest (5.20.0)
mutex_m (0.1.2)
parallel (1.23.0)
Expand Down Expand Up @@ -88,6 +89,8 @@ GEM
rubocop-factory_bot (~> 2.22)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
sqlite3 (1.7.3)
mini_portile2 (~> 2.8.0)
thor (1.2.2)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
Expand All @@ -107,6 +110,7 @@ DEPENDENCIES
rubocop
rubocop-rake
rubocop-rspec
sqlite3 (< 2)
wwtd

BUNDLED WITH
Expand Down
1 change: 1 addition & 0 deletions enumerate_it.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@ Gem::Specification.new do |gem|
gem.add_development_dependency 'rubocop'
gem.add_development_dependency 'rubocop-rake'
gem.add_development_dependency 'rubocop-rspec'
gem.add_development_dependency 'sqlite3', '< 2'
gem.add_development_dependency 'wwtd'
end
2 changes: 1 addition & 1 deletion gemfiles/rails_5.1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ source 'https://rubygems.org'

gem 'activerecord', '~> 5.1.7'
gem 'activesupport', '~> 5.1.7'
gem 'sqlite3'
gem 'sqlite3', '< 2'

gemspec path: '../'
2 changes: 1 addition & 1 deletion gemfiles/rails_5.2.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ source 'https://rubygems.org'

gem 'activerecord', '~> 5.2.8.1'
gem 'activesupport', '~> 5.2.8.1'
gem 'sqlite3'
gem 'sqlite3', '< 2'

gemspec path: '../'
2 changes: 1 addition & 1 deletion gemfiles/rails_6.0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ source 'https://rubygems.org'

gem 'activerecord', '~> 6.0.6.1'
gem 'activesupport', '~> 6.0.6.1'
gem 'sqlite3'
gem 'sqlite3', '< 2'

gemspec path: '../'
6 changes: 3 additions & 3 deletions gemfiles/rails_6.1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

source 'https://rubygems.org'

gem 'activerecord', '~> 6.1.7.6'
gem 'activesupport', '~> 6.1.7.6'
gem 'sqlite3'
gem 'activerecord', '~> 6.1.7.7'
gem 'activesupport', '~> 6.1.7.7'
gem 'sqlite3', '< 2'

gemspec path: '../'
6 changes: 3 additions & 3 deletions gemfiles/rails_7.0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

source 'https://rubygems.org'

gem 'activerecord', '~> 7.0.8'
gem 'activesupport', '~> 7.0.8'
gem 'sqlite3'
gem 'activerecord', '~> 7.0.8.1'
gem 'activesupport', '~> 7.0.8.1'
gem 'sqlite3', '< 2'

gemspec path: '../'
6 changes: 3 additions & 3 deletions gemfiles/rails_7.1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

source 'https://rubygems.org'

gem 'activerecord', '~> 7.1.1'
gem 'activesupport', '~> 7.1.1'
gem 'sqlite3'
gem 'activerecord', '~> 7.1.3.2'
gem 'activesupport', '~> 7.1.3.2'
gem 'sqlite3', '< 2'

gemspec path: '../'

0 comments on commit 07d5fbf

Please sign in to comment.