Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RoR v8 and Ruby v3.3 support #1171

Draft
wants to merge 14 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 17 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,47 +11,48 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
ruby-version: [2.5.3, 2.6.0, 2.6.6, 2.7.2]
ruby-version: [2.5.9, 2.6.0, 2.6.10, 2.7.8]
gemfile:
- gemfiles/rails50.gemfile
- gemfiles/rails51.gemfile
- gemfiles/rails52.gemfile
- gemfiles/rails60.gemfile
- gemfiles/rails61.gemfile
include:
- gemfile: gemfiles/rails80.gemfile
ruby-version: 3.4.1
- gemfile: gemfiles/rails80.gemfile
ruby-version: 3.3.6
- gemfile: gemfiles/rails72.gemfile
ruby-version: 3.3.6
- gemfile: gemfiles/rails72.gemfile
ruby-version: 3.2.6
- gemfile: gemfiles/rails71.gemfile
ruby-version: 3.2.2
ruby-version: 3.2.6
- gemfile: gemfiles/rails71.gemfile
ruby-version: 3.1.1
ruby-version: 3.1.6
- gemfile: gemfiles/rails70.gemfile
ruby-version: 3.1.1
ruby-version: 3.1.6
- gemfile: gemfiles/rails70.gemfile
ruby-version: 3.0.3
ruby-version: 3.0.7
- gemfile: gemfiles/rails61.gemfile
ruby-version: 3.0.3
ruby-version: 3.0.7

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Start Redis
uses: supercharge/redis-github-action@1.1.0
uses: supercharge/redis-github-action@1.8.0
with:
redis-version: 4
redis-version: 6

- name: Setup Ruby > 2.0
uses: ruby/setup-ruby@v1
if: ${{ matrix.ruby-version != '2.0.0' }}
with:
ruby-version: ${{ matrix.ruby-version }}

- name: Rails 4.2 ensure bundler version
if: ${{ matrix.gemfile == 'gemfiles/rails42.gemfile' }}
run: |
gem uninstall bundler
gem install bundler -v '< 2.0.0'

- name: Bundle Install
run: |
export BUNDLE_GEMFILE=${{ matrix.gemfile }}
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ lib/bundler/man
vendor/bundle
pkg
rdoc
spec/dummyapp/db/*.sqlite3-*
spec/reports
test/tmp
test/version_tmp
Expand All @@ -25,4 +26,4 @@ tmp

gemfiles/vendor

vendor
vendor
19 changes: 0 additions & 19 deletions Appraisals

This file was deleted.

34 changes: 18 additions & 16 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This Gemfile is compatible with Ruby 2.5.0 or greater. To test with
# earlier Rubies, use the appropriate Gemfile from the ./gemfiles/ dir.
ruby '3.2.2'
ruby '3.3.6'

source 'https://rubygems.org'

Expand All @@ -13,12 +13,12 @@ ENV['CURRENT_GEMFILE'] ||= __FILE__

is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby')

GEMFILE_RAILS_VERSION = '~> 7.1.0'.freeze
gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby
gem 'appraisal'
gem 'jruby-openssl', :platform => :jruby
GEMFILE_RAILS_VERSION = '~> 8.0.0'.freeze
gem 'activerecord-jdbcsqlite3-adapter', platform: :jruby
gem 'jruby-openssl', platform: :jruby
gem 'rails', GEMFILE_RAILS_VERSION
gem 'rake'

if GEMFILE_RAILS_VERSION < '6.0'
gem 'rspec-rails', '~> 3.4'
elsif GEMFILE_RAILS_VERSION < '7.0'
Expand All @@ -27,10 +27,12 @@ else
gem 'rspec-rails', '~> 6.0.3'
end

if GEMFILE_RAILS_VERSION < '6.0'
gem 'sqlite3', '< 1.4.0', :platform => [:ruby, :mswin, :mingw]
if GEMFILE_RAILS_VERSION >= '8.0'
gem 'sqlite3', '~> 2.0', platform: [:ruby, :mswin, :mingw]
elsif GEMFILE_RAILS_VERSION < '6.0'
gem 'sqlite3', '< 1.4.0', platform: [:ruby, :mswin, :mingw]
else
gem 'sqlite3', '~> 1.4', :platform => [:ruby, :mswin, :mingw]
gem 'sqlite3', '~> 1.4', platform: [:ruby, :mswin, :mingw]
end

gem 'sidekiq', '>= 6.4.0'
Expand All @@ -39,10 +41,9 @@ platforms :rbx do
gem 'minitest'
gem 'racc'
gem 'rubinius-developer_tools'
gem 'rubysl', '~> 2.0' if RUBY_VERSION.start_with?('2')
end

gem 'capistrano', :require => false
gem 'capistrano', require: false
gem 'shoryuken'
gem 'simplecov'
gem 'sucker_punch', '~> 2.0'
Expand All @@ -63,16 +64,17 @@ elsif GEMFILE_RAILS_VERSION < '5.0'
end

if GEMFILE_RAILS_VERSION < '6.0'
gem 'delayed_job', :require => false
gem 'delayed_job', require: false
else
gem 'delayed_job', '~> 4.1', :require => false
gem 'delayed_job', '~> 4.1', require: false
end

gem 'generator_spec'
gem 'redis', '<= 4.8.0'
gem 'resque', '< 2.0.0'
gem 'rubocop', '1.15.0', :require => false # pin specific version, update manually
gem 'rubocop-performance', :require => false
gem 'secure_headers', '~> 6.3.2', :require => false
gem 'rubocop', '1.15.0', require: false # pin specific version, update manually
gem 'rubocop-performance', require: false
gem 'secure_headers', '~> 6.3.2', require: false
gem 'sinatra'
gem 'webmock', :require => false
gem 'webmock', require: false
gemspec
1 change: 0 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ require 'rubygems'
require 'bundler/setup'
require 'bundler/gem_tasks'
require 'rspec/core/rake_task'
require 'appraisal'

RSpec::Core::RakeTask.new(:spec)

Expand Down
50 changes: 50 additions & 0 deletions gemfiles/rails72.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
require 'rubygems/version'

source 'https://rubygems.org'

is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby')

gem 'activerecord-jdbcsqlite3-adapter', platform: :jruby
gem 'jruby-openssl', platform: :jruby
gem 'rails', '~> 7.2.2'
gem 'sqlite3', platform: [:ruby, :mswin, :mingw]

gem 'rspec-rails'

gem 'rake'

gem 'sidekiq'

platforms :rbx do
gem 'minitest'
gem 'racc'
gem 'rubinius-developer_tools'
end

gem 'sucker_punch'

gem 'sinatra'

gem 'database_cleaner'
gem 'delayed_job', '~> 4.1.13', require: false
gem 'generator_spec'
gem 'redis'
gem 'resque'
gem 'secure_headers', require: false
gem 'simplecov'

unless is_jruby
# JRuby doesn't support fork, which is required for this test helper.
gem 'rspec-command'
end

gem 'mime-types'

gem 'webmock', require: false

gem 'aws-sdk-sqs'
gem 'shoryuken'

gem 'capistrano', require: false

gemspec path: '../'
50 changes: 50 additions & 0 deletions gemfiles/rails80.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
require 'rubygems/version'

source 'https://rubygems.org'

is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby')

gem 'activerecord-jdbcsqlite3-adapter', platform: :jruby
gem 'jruby-openssl', platform: :jruby
gem 'rails', '~> 8.0.1'
gem 'sqlite3', platform: [:ruby, :mswin, :mingw]

gem 'rspec-rails'

gem 'rake'

gem 'sidekiq'

platforms :rbx do
gem 'minitest'
gem 'racc'
gem 'rubinius-developer_tools'
end

gem 'sucker_punch'

gem 'sinatra'

gem 'database_cleaner'
gem 'delayed_job', '~> 4.1.13', require: false
gem 'generator_spec'
gem 'redis'
gem 'resque'
gem 'secure_headers', require: false
gem 'simplecov'

unless is_jruby
# JRuby doesn't support fork, which is required for this test helper.
gem 'rspec-command'
end

gem 'mime-types'

gem 'webmock', require: false

gem 'aws-sdk-sqs'
gem 'shoryuken'

gem 'capistrano', require: false

gemspec path: '../'
2 changes: 1 addition & 1 deletion spec/dummyapp/app/controllers/home_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,6 @@ def custom_current_user
end

def recursive_current_user
Rollbar.error('Recurisve call to rollbar')
Rollbar.error('Recursive call to rollbar')
end
end
1 change: 1 addition & 0 deletions spec/dummyapp/config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
config.eager_load = false

# Log error messages when you accidentally call methods on nil.
config.whiny_nils = true
Expand Down
1 change: 1 addition & 0 deletions spec/dummyapp/config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

# Code is not reloaded between requests
config.cache_classes = true
config.eager_load = true

# Full error reports are disabled and caching is turned on
config.consider_all_requests_local = false
Expand Down
7 changes: 6 additions & 1 deletion spec/dummyapp/config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# your test database is "scratch space" for the test suite and is wiped
# and recreated between test runs. Don't rely on the data there!
config.cache_classes = true
config.eager_load = false

# Configure static asset server for tests with Cache-Control for performance
config.serve_static_assets = true
Expand All @@ -19,7 +20,11 @@
config.action_controller.perform_caching = false

# Raise exceptions instead of rendering exception templates
config.action_dispatch.show_exceptions = false
if Gem::Version.new(Rails.version) < Gem::Version.new('7.2.0')
config.action_dispatch.show_exceptions = false
else
config.action_dispatch.show_exceptions = :none
end

# Disable request forgery protection in test environment
config.action_controller.allow_forgery_protection = false
Expand Down
11 changes: 3 additions & 8 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
begin
require 'simplecov'

SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
SimpleCov::Formatter::HTMLFormatter
]
SimpleCov.formatter =
SimpleCov::Formatter::MultiFormatter.new([SimpleCov::Formatter::HTMLFormatter])

SimpleCov.start do
add_filter '/spec/'
Expand Down Expand Up @@ -38,11 +37,7 @@
Rollbar::Configuration::DEFAULT_ENDPOINT = 'https://api-alt.rollbar.com/api/1/item/'.freeze
end

if Gem::Version.new(Rails.version) < Gem::Version.new('5.0')
Rake::Task['dummy:db:setup'].invoke
else
Rake::Task['dummy:db:test:prepare'].invoke
end
Rake::Task['dummy:db:test:prepare'].invoke

Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].sort.each { |f| require f }

Expand Down