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

add support for rails 7.0 #14

Merged
merged 3 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
- Gemfile
- gemfiles/rails_6_0.gemfile
- gemfiles/rails_6_1.gemfile
- gemfiles/rails_7_0.gemfile
env:
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

require "appraisal/matrix"

appraisal_matrix(rails: "~> 6.0")
appraisal_matrix(rails: [">= 6.0", "< 7.1"])
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ Inspired by [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

Note: this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.1.0] - Unreleased
### Added
- Support for Rails 7.0

## [1.0.1] - 2024-08-19
### Fixed
- Fixed issues in Rails 6.1+
Expand Down
16 changes: 8 additions & 8 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
PATH
remote: .
specs:
fibered_mysql2 (1.0.1)
fibered_mysql2 (1.1.0)
async
rails (>= 6, < 7)
rails (>= 6, < 7.1)

GEM
remote: https://rubygems.org/
specs:
actioncable (6.1.7.8)

Check failure on line 11 in Gemfile.lock

View check run for this annotation

Security Scanner as a Service / Bundle Audit

Gemfile.lock#L11

actionpack Warning Message: https://github.com/rails/rails/security/advisories/GHSA-x76w-6vjr-8xgj CVE: CVE-2024-41128 Severity:

Check failure on line 11 in Gemfile.lock

View check run for this annotation

Security Scanner as a Service / Bundle Audit

Gemfile.lock#L11

actionpack Warning Message: https://github.com/rails/rails/security/advisories/GHSA-vfg9-r3fq-jvx4 CVE: CVE-2024-47887 Severity:
actionpack (= 6.1.7.8)
activesupport (= 6.1.7.8)
nio4r (~> 2.0)
Expand All @@ -19,7 +19,7 @@
activerecord (= 6.1.7.8)
activestorage (= 6.1.7.8)
activesupport (= 6.1.7.8)
mail (>= 2.7.1)

Check failure on line 22 in Gemfile.lock

View check run for this annotation

Security Scanner as a Service / Bundle Audit

Gemfile.lock#L22

actionmailer Warning Message: https://github.com/rails/rails/security/advisories/GHSA-h47h-mwp9-c6q6 CVE: CVE-2024-47889 Severity:
actionmailer (6.1.7.8)
actionpack (= 6.1.7.8)
actionview (= 6.1.7.8)
Expand All @@ -33,7 +33,7 @@
rack (~> 2.0, >= 2.0.9)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)

Check failure on line 36 in Gemfile.lock

View check run for this annotation

Security Scanner as a Service / Bundle Audit

Gemfile.lock#L36

actiontext Warning Message: https://github.com/rails/rails/security/advisories/GHSA-wwhv-wxv9-rpgw CVE: CVE-2024-47888 Severity:
actiontext (6.1.7.8)
actionpack (= 6.1.7.8)
activerecord (= 6.1.7.8)
Expand Down Expand Up @@ -73,7 +73,7 @@
thor (>= 0.14.0)
appraisal-matrix (0.3.0)
appraisal (~> 2.2)
async (2.15.3)
async (2.17.0)
console (~> 1.26)
fiber-annotation
io-event (~> 1.6, >= 1.6.5)
Expand Down Expand Up @@ -103,9 +103,9 @@
fiber-storage (1.0.0)
globalid (1.2.1)
activesupport (>= 6.1)
i18n (1.14.5)
i18n (1.14.6)
concurrent-ruby (~> 1.0)
io-event (1.6.5)
io-event (1.7.3)
json (2.7.2)
loofah (2.22.0)
crass (~> 1.0.2)
Expand All @@ -121,7 +121,7 @@
mini_portile2 (2.8.7)
minitest (5.25.1)
mysql2 (0.5.6)
net-imap (0.4.14)
net-imap (0.5.0)
date
net-protocol
net-pop (0.1.2)
Expand All @@ -141,7 +141,7 @@
byebug (~> 11.0)
pry (>= 0.13, < 0.15)
racc (1.8.1)
rack (2.2.9)
rack (2.2.10)
rack-test (2.1.0)
rack (>= 1.3)
rails (6.1.7.8)
Expand Down Expand Up @@ -211,7 +211,7 @@
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
zeitwerk (2.6.17)
zeitwerk (2.6.18)

PLATFORMS
ruby
Expand Down
2 changes: 1 addition & 1 deletion fibered_mysql2.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ Gem::Specification.new do |spec|
spec.require_paths = ["lib"]

spec.add_dependency 'async'
spec.add_dependency 'rails', '>= 6', '< 7'
spec.add_dependency 'rails', '>= 6', '< 7.1'
end
16 changes: 16 additions & 0 deletions gemfiles/rails_7_0.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "appraisal"
gem "appraisal-matrix"
gem "coveralls", require: false
gem "mysql2", "~> 0.5"
gem "nokogiri"
gem "pry"
gem "pry-byebug"
gem "rake"
gem "rspec"
gem "rails", "~> 7.0.0"

gemspec path: "../"
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ def owner_fiber
end

class FiberedMysql2Adapter < ::ActiveRecord::ConnectionAdapters::Mysql2Adapter
ActiveRecord::VERSION::MAJOR == 6 or raise ArgumentError, "unexpected Rails version #{ActiveRecord::VERSION::MAJOR}"

include FiberedMysql2Adapter_6

def initialize(*args)
Expand Down
2 changes: 0 additions & 2 deletions lib/fibered_mysql2/fibered_database_connection_pool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

module FiberedMysql2
module FiberedDatabaseConnectionPool
ActiveRecord::VERSION::MAJOR == 6 or raise ArgumentError, "unexpected Rails version #{ActiveRecord::VERSION::MAJOR}"

def cached_connections
@thread_cached_conns
end
Expand Down
2 changes: 1 addition & 1 deletion lib/fibered_mysql2/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module FiberedMysql2
VERSION = "1.0.1"
VERSION = "1.1.0"
end
4 changes: 3 additions & 1 deletion spec/unit/fibered_database_connection_pool_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,10 @@ def wait(task)
let(:spec) do
if ActiveRecord.gem_version < "6.1"
ActiveRecord::ConnectionAdapters::ConnectionSpecification.new(name, config, adapter_method)
else
elsif ActiveRecord.gem_version < "7.0"
ActiveRecord::ConnectionAdapters::PoolConfig.new(name, ActiveRecord::DatabaseConfigurations::HashConfig.new("staging", "staging", config))
else
ActiveRecord::ConnectionAdapters::PoolConfig.new(name, ActiveRecord::DatabaseConfigurations::HashConfig.new("staging", "staging", config), "primary", nil)
end
end

Expand Down
Loading