From ebf895a2829c48d00fc5af131d07f81cc8b7f039 Mon Sep 17 00:00:00 2001 From: Prosenjit Saha Date: Mon, 23 Dec 2024 16:26:56 +0530 Subject: [PATCH] added support for rails 8 --- .github/workflows/rspec_mysql_8_0.yml | 1 + .github/workflows/rspec_pg_14.yml | 1 + .github/workflows/rspec_pg_15.yml | 1 + .github/workflows/rspec_pg_16.yml | 1 + .github/workflows/rspec_pg_17.yml | 1 + .github/workflows/rspec_sqlite_3.yml | 1 + Appraisals | 42 ++++++++++++++++++++++ Rakefile | 2 +- gemfiles/rails_8_0_jdbc_mysql.gemfile | 27 ++++++++++++++ gemfiles/rails_8_0_jdbc_postgresql.gemfile | 27 ++++++++++++++ gemfiles/rails_8_0_jdbc_sqlite3.gemfile | 27 ++++++++++++++ gemfiles/rails_8_0_mysql.gemfile | 22 ++++++++++++ gemfiles/rails_8_0_postgresql.gemfile | 22 ++++++++++++ gemfiles/rails_8_0_sqlite3.gemfile | 22 ++++++++++++ 14 files changed, 196 insertions(+), 1 deletion(-) create mode 100644 gemfiles/rails_8_0_jdbc_mysql.gemfile create mode 100644 gemfiles/rails_8_0_jdbc_postgresql.gemfile create mode 100644 gemfiles/rails_8_0_jdbc_sqlite3.gemfile create mode 100644 gemfiles/rails_8_0_mysql.gemfile create mode 100644 gemfiles/rails_8_0_postgresql.gemfile create mode 100644 gemfiles/rails_8_0_sqlite3.gemfile diff --git a/.github/workflows/rspec_mysql_8_0.yml b/.github/workflows/rspec_mysql_8_0.yml index c24909e6..acf4fff0 100644 --- a/.github/workflows/rspec_mysql_8_0.yml +++ b/.github/workflows/rspec_mysql_8_0.yml @@ -26,6 +26,7 @@ jobs: - 7_0 - 7_1 - 7_2 + - 8_0 # - master # versions failing exclude: - ruby_version: jruby diff --git a/.github/workflows/rspec_pg_14.yml b/.github/workflows/rspec_pg_14.yml index dc9029ac..9e0996b2 100644 --- a/.github/workflows/rspec_pg_14.yml +++ b/.github/workflows/rspec_pg_14.yml @@ -26,6 +26,7 @@ jobs: - 7_0 - 7_1 - 7_2 + - 8_0 # - master # versions failing exclude: - ruby_version: jruby diff --git a/.github/workflows/rspec_pg_15.yml b/.github/workflows/rspec_pg_15.yml index a6d2c41d..d70f0fd9 100644 --- a/.github/workflows/rspec_pg_15.yml +++ b/.github/workflows/rspec_pg_15.yml @@ -26,6 +26,7 @@ jobs: - 7_0 - 7_1 - 7_2 + - 8_0 # - master # versions failing exclude: - ruby_version: jruby diff --git a/.github/workflows/rspec_pg_16.yml b/.github/workflows/rspec_pg_16.yml index 9fd2071f..c9a90b4c 100644 --- a/.github/workflows/rspec_pg_16.yml +++ b/.github/workflows/rspec_pg_16.yml @@ -26,6 +26,7 @@ jobs: - 7_0 - 7_1 - 7_2 + - 8_0 # - master # versions failing exclude: - ruby_version: jruby diff --git a/.github/workflows/rspec_pg_17.yml b/.github/workflows/rspec_pg_17.yml index 349a5fe7..440b4e46 100644 --- a/.github/workflows/rspec_pg_17.yml +++ b/.github/workflows/rspec_pg_17.yml @@ -26,6 +26,7 @@ jobs: - 7_0 - 7_1 - 7_2 + - 8_0 # - master # versions failing exclude: - ruby_version: jruby diff --git a/.github/workflows/rspec_sqlite_3.yml b/.github/workflows/rspec_sqlite_3.yml index 964e96e4..686dbf61 100644 --- a/.github/workflows/rspec_sqlite_3.yml +++ b/.github/workflows/rspec_sqlite_3.yml @@ -26,6 +26,7 @@ jobs: - 7_0 - 7_1 - 7_2 + - 8_0 # - master # versions failing exclude: - ruby_version: jruby diff --git a/Appraisals b/Appraisals index 7f97187f..a8efbe1d 100644 --- a/Appraisals +++ b/Appraisals @@ -168,6 +168,48 @@ appraise 'rails-7-2-jdbc-sqlite3' do end end +appraise 'rails-8-0-postgresql' do + gem 'rails', '~> 8.0.0' + gem 'pg', '~> 1.5' +end + +appraise 'rails-8-0-mysql' do + gem 'rails', '~> 8.0.0' + gem 'mysql2', '~> 0.5' +end + +appraise 'rails-8-0-sqlite3' do + gem 'rails', '~> 8.0.0' + gem 'sqlite3', '~> 2.1' +end + +appraise 'rails-8-0-jdbc-postgresql' do + gem 'rails', '~> 8.0.0' + platforms :jruby do + gem 'activerecord-jdbc-adapter', '~> 70.0' + gem 'activerecord-jdbcpostgresql-adapter', '~> 70.0' + gem 'jdbc-postgres' + end +end + +appraise 'rails-8-0-jdbc-mysql' do + gem 'rails', '~> 8.0.0' + platforms :jruby do + gem 'activerecord-jdbc-adapter', '~> 70.0' + gem 'activerecord-jdbcmysql-adapter', '~> 70.0' + gem 'jdbc-mysql' + end +end + +appraise 'rails-8-0-jdbc-sqlite3' do + gem 'rails', '~> 8.0.0' + platforms :jruby do + gem 'activerecord-jdbc-adapter', '~> 70.0' + gem 'activerecord-jdbcsqlite3-adapter', '~> 70.0' + gem 'jdbc-sqlite3' + end +end + # Install Rails from the main branch are failing # appraise 'rails-master' do # gem 'rails', git: 'https://github.com/rails/rails.git' diff --git a/Rakefile b/Rakefile index 0be50f8e..040e5e72 100644 --- a/Rakefile +++ b/Rakefile @@ -149,7 +149,7 @@ def my_config end def migrate - if ActiveRecord.version.release < Gem::Version.new('7.1') + if ActiveRecord.version.release < Gem::Version.new('8.1') ActiveRecord::MigrationContext.new('spec/dummy/db/migrate', ActiveRecord::SchemaMigration).migrate else ActiveRecord::MigrationContext.new('spec/dummy/db/migrate').migrate diff --git a/gemfiles/rails_8_0_jdbc_mysql.gemfile b/gemfiles/rails_8_0_jdbc_mysql.gemfile new file mode 100644 index 00000000..3dd3197f --- /dev/null +++ b/gemfiles/rails_8_0_jdbc_mysql.gemfile @@ -0,0 +1,27 @@ +# This file was generated by Appraisal + +source "http://rubygems.org" + +gem "appraisal", "~> 2.3" +gem "bundler", "< 3.0" +gem "pry", "~> 0.13" +gem "rake", "< 14.0" +gem "rspec", "~> 3.10" +gem "rspec_junit_formatter", "~> 0.4" +gem "rspec-rails", ">= 6.1.0", "< 8.1" +gem "rubocop", "~> 1.12" +gem "rubocop-performance", "~> 1.10" +gem "rubocop-rails", "~> 2.10" +gem "rubocop-rake", "~> 0.5" +gem "rubocop-rspec", "~> 3.1" +gem "rubocop-thread_safety", "~> 0.4" +gem "simplecov", require: false +gem "rails", "~> 8.0.0" + +platforms :jruby do + gem "activerecord-jdbc-adapter", "~> 70.0" + gem "activerecord-jdbcmysql-adapter", "~> 70.0" + gem "jdbc-mysql" +end + +gemspec path: "../" diff --git a/gemfiles/rails_8_0_jdbc_postgresql.gemfile b/gemfiles/rails_8_0_jdbc_postgresql.gemfile new file mode 100644 index 00000000..4422533d --- /dev/null +++ b/gemfiles/rails_8_0_jdbc_postgresql.gemfile @@ -0,0 +1,27 @@ +# This file was generated by Appraisal + +source "http://rubygems.org" + +gem "appraisal", "~> 2.3" +gem "bundler", "< 3.0" +gem "pry", "~> 0.13" +gem "rake", "< 14.0" +gem "rspec", "~> 3.10" +gem "rspec_junit_formatter", "~> 0.4" +gem "rspec-rails", ">= 6.1.0", "< 8.1" +gem "rubocop", "~> 1.12" +gem "rubocop-performance", "~> 1.10" +gem "rubocop-rails", "~> 2.10" +gem "rubocop-rake", "~> 0.5" +gem "rubocop-rspec", "~> 3.1" +gem "rubocop-thread_safety", "~> 0.4" +gem "simplecov", require: false +gem "rails", "~> 8.0.0" + +platforms :jruby do + gem "activerecord-jdbc-adapter", "~> 70.0" + gem "activerecord-jdbcpostgresql-adapter", "~> 70.0" + gem "jdbc-postgres" +end + +gemspec path: "../" diff --git a/gemfiles/rails_8_0_jdbc_sqlite3.gemfile b/gemfiles/rails_8_0_jdbc_sqlite3.gemfile new file mode 100644 index 00000000..763842e5 --- /dev/null +++ b/gemfiles/rails_8_0_jdbc_sqlite3.gemfile @@ -0,0 +1,27 @@ +# This file was generated by Appraisal + +source "http://rubygems.org" + +gem "appraisal", "~> 2.3" +gem "bundler", "< 3.0" +gem "pry", "~> 0.13" +gem "rake", "< 14.0" +gem "rspec", "~> 3.10" +gem "rspec_junit_formatter", "~> 0.4" +gem "rspec-rails", ">= 6.1.0", "< 8.1" +gem "rubocop", "~> 1.12" +gem "rubocop-performance", "~> 1.10" +gem "rubocop-rails", "~> 2.10" +gem "rubocop-rake", "~> 0.5" +gem "rubocop-rspec", "~> 3.1" +gem "rubocop-thread_safety", "~> 0.4" +gem "simplecov", require: false +gem "rails", "~> 8.0.0" + +platforms :jruby do + gem "activerecord-jdbc-adapter", "~> 70.0" + gem "activerecord-jdbcsqlite3-adapter", "~> 70.0" + gem "jdbc-sqlite3" +end + +gemspec path: "../" diff --git a/gemfiles/rails_8_0_mysql.gemfile b/gemfiles/rails_8_0_mysql.gemfile new file mode 100644 index 00000000..43b119cc --- /dev/null +++ b/gemfiles/rails_8_0_mysql.gemfile @@ -0,0 +1,22 @@ +# This file was generated by Appraisal + +source "http://rubygems.org" + +gem "appraisal", "~> 2.3" +gem "bundler", "< 3.0" +gem "pry", "~> 0.13" +gem "rake", "< 14.0" +gem "rspec", "~> 3.10" +gem "rspec_junit_formatter", "~> 0.4" +gem "rspec-rails", ">= 6.1.0", "< 8.1" +gem "rubocop", "~> 1.12" +gem "rubocop-performance", "~> 1.10" +gem "rubocop-rails", "~> 2.10" +gem "rubocop-rake", "~> 0.5" +gem "rubocop-rspec", "~> 3.1" +gem "rubocop-thread_safety", "~> 0.4" +gem "simplecov", require: false +gem "rails", "~> 8.0.0" +gem "mysql2", "~> 0.5" + +gemspec path: "../" diff --git a/gemfiles/rails_8_0_postgresql.gemfile b/gemfiles/rails_8_0_postgresql.gemfile new file mode 100644 index 00000000..f5b82c2f --- /dev/null +++ b/gemfiles/rails_8_0_postgresql.gemfile @@ -0,0 +1,22 @@ +# This file was generated by Appraisal + +source "http://rubygems.org" + +gem "appraisal", "~> 2.3" +gem "bundler", "< 3.0" +gem "pry", "~> 0.13" +gem "rake", "< 14.0" +gem "rspec", "~> 3.10" +gem "rspec_junit_formatter", "~> 0.4" +gem "rspec-rails", ">= 6.1.0", "< 8.1" +gem "rubocop", "~> 1.12" +gem "rubocop-performance", "~> 1.10" +gem "rubocop-rails", "~> 2.10" +gem "rubocop-rake", "~> 0.5" +gem "rubocop-rspec", "~> 3.1" +gem "rubocop-thread_safety", "~> 0.4" +gem "simplecov", require: false +gem "rails", "~> 8.0.0" +gem "pg", "~> 1.5" + +gemspec path: "../" diff --git a/gemfiles/rails_8_0_sqlite3.gemfile b/gemfiles/rails_8_0_sqlite3.gemfile new file mode 100644 index 00000000..b5b4fa5f --- /dev/null +++ b/gemfiles/rails_8_0_sqlite3.gemfile @@ -0,0 +1,22 @@ +# This file was generated by Appraisal + +source "http://rubygems.org" + +gem "appraisal", "~> 2.3" +gem "bundler", "< 3.0" +gem "pry", "~> 0.13" +gem "rake", "< 14.0" +gem "rspec", "~> 3.10" +gem "rspec_junit_formatter", "~> 0.4" +gem "rspec-rails", ">= 6.1.0", "< 8.1" +gem "rubocop", "~> 1.12" +gem "rubocop-performance", "~> 1.10" +gem "rubocop-rails", "~> 2.10" +gem "rubocop-rake", "~> 0.5" +gem "rubocop-rspec", "~> 3.1" +gem "rubocop-thread_safety", "~> 0.4" +gem "simplecov", require: false +gem "rails", "~> 8.0.0" +gem "sqlite3", "~> 2.1" + +gemspec path: "../"