diff --git a/Appraisals b/Appraisals index 700cf23..465a5c1 100644 --- a/Appraisals +++ b/Appraisals @@ -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 diff --git a/Gemfile.lock b/Gemfile.lock index 235ef17..a1354c6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -102,7 +102,6 @@ GEM tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (2.5.0) - wwtd (1.4.1) PLATFORMS ruby @@ -118,8 +117,7 @@ DEPENDENCIES rubocop rubocop-rake rubocop-rspec - sqlite3 - wwtd + sqlite3 (< 2) BUNDLED WITH 2.4.19 diff --git a/README.md b/README.md index da62069..ba49cb8 100644 --- a/README.md +++ b/README.md @@ -536,4 +536,4 @@ you can see them on the [releases page](../../releases). ## Copyright -Copyright (c) 2010-2023 Cássio Marques and Lucas Caton. See `LICENSE` file for details. +Copyright (c) 2010-2024 Cássio Marques and Lucas Caton. See `LICENSE` file for details. diff --git a/enumerate_it.gemspec b/enumerate_it.gemspec index a625f8b..cce98dd 100644 --- a/enumerate_it.gemspec +++ b/enumerate_it.gemspec @@ -31,6 +31,5 @@ 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' - gem.add_development_dependency 'wwtd' + gem.add_development_dependency 'sqlite3', '< 2' end diff --git a/gemfiles/rails_5.1.gemfile b/gemfiles/rails_5.1.gemfile index 3bae5cb..d619ee6 100644 --- a/gemfiles/rails_5.1.gemfile +++ b/gemfiles/rails_5.1.gemfile @@ -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: '../' diff --git a/gemfiles/rails_5.2.gemfile b/gemfiles/rails_5.2.gemfile index 05f7fb6..dc111f6 100644 --- a/gemfiles/rails_5.2.gemfile +++ b/gemfiles/rails_5.2.gemfile @@ -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: '../' diff --git a/gemfiles/rails_6.0.gemfile b/gemfiles/rails_6.0.gemfile index 07b6361..a18ab8a 100644 --- a/gemfiles/rails_6.0.gemfile +++ b/gemfiles/rails_6.0.gemfile @@ -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: '../' diff --git a/gemfiles/rails_6.1.gemfile b/gemfiles/rails_6.1.gemfile index 21a2bcb..8ccdedb 100644 --- a/gemfiles/rails_6.1.gemfile +++ b/gemfiles/rails_6.1.gemfile @@ -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: '../' diff --git a/gemfiles/rails_7.0.gemfile b/gemfiles/rails_7.0.gemfile index 6d92660..a33a316 100644 --- a/gemfiles/rails_7.0.gemfile +++ b/gemfiles/rails_7.0.gemfile @@ -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: '../' diff --git a/gemfiles/rails_7.1.gemfile b/gemfiles/rails_7.1.gemfile index 283f76b..efe656a 100644 --- a/gemfiles/rails_7.1.gemfile +++ b/gemfiles/rails_7.1.gemfile @@ -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: '../'