Merge updates from master

This commit is contained in:
Repository mirror & CI 2025-12-06 17:15:51 +00:00
commit 5ee286663f
No known key found for this signature in database
GPG Key ID: 7C2AC09CD98F2EDF
5 changed files with 0 additions and 375 deletions

View File

@ -1,27 +0,0 @@
From 67bdba4e63cad218c02dbb3171ddd53353cc0b48 Mon Sep 17 00:00:00 2001
From: Javier Jimenez <javiyu7@gmail.com>
Date: Thu, 5 Jan 2023 21:34:37 +0100
Subject: [PATCH] Backports ruby 3.2 compatibility fixes for rails 6.1
---
actionmailer/lib/action_mailer/base.rb | 2 +-
actionmailer/lib/action_mailer/rescuable.rb | 12 ++++++++----
actionpack/lib/abstract_controller/base.rb | 10 +++++++---
actionpack/lib/abstract_controller/callbacks.rb | 6 +++++-
actionview/lib/action_view/rendering.rb | 6 +++++-
activemodel/lib/active_model/attribute_methods.rb | 2 +-
activerecord/lib/active_record/relation.rb | 8 ++++++--
7 files changed, 33 insertions(+), 13 deletions(-)
diff --git a/activemodel/lib/active_model/attribute_methods.rb b/activemodel/lib/active_model/attribute_methods.rb
index 365b338d17af3..0c401f7aeb4d9 100644
--- a/lib/active_model/attribute_methods.rb
+++ b/lib/active_model/attribute_methods.rb
@@ -478,6 +478,7 @@ def method_missing(method, *args, &block)
def attribute_missing(match, *args, &block)
__send__(match.target, match.attr_name, *args, &block)
end
+ ruby2_keywords(:attribute_missing) if respond_to?(:ruby2_keywords, true)
# A +Person+ instance with a +name+ attribute can ask
# <tt>person.respond_to?(:name)</tt>, <tt>person.respond_to?(:name=)</tt>,

View File

@ -1,49 +0,0 @@
https://github.com/socketry/async/commit/8f590415c08943372e0227f01d3c32e92dbcbed0
https://github.com/socketry/async/issues/218
From 8f590415c08943372e0227f01d3c32e92dbcbed0 Mon Sep 17 00:00:00 2001
From: Samuel Williams <samuel.williams@oriontransfer.co.nz>
Date: Sun, 12 Mar 2023 20:33:48 +1300
Subject: [PATCH] Improve robustness of test, fixes #218.
--- a/spec/async/semaphore_spec.rb
+++ b/spec/async/semaphore_spec.rb
@@ -62,7 +62,7 @@
3.times.map do |i|
semaphore.async do |task|
order << i
- task.sleep(0.1)
+ task.yield
order << i
end
end.collect(&:result)
@@ -72,17 +72,22 @@
it 'allows tasks to execute concurrently' do
semaphore = Async::Semaphore.new(3)
- order = []
+ concurrency = 0
+ latch = Async::Condition.new
3.times.map do |i|
semaphore.async do |task|
- order << i
- task.sleep(0.1)
- order << i
+ concurrency += 1
+
+ if concurrency == 3
+ latch.signal
+ else
+ latch.wait
+ end
end
- end.collect(&:result)
+ end.each(&:wait)
- expect(order).to be == [0, 1, 2, 0, 1, 2]
+ expect(concurrency).to be == 3
end
end

View File

@ -1,120 +0,0 @@
https://github.com/egonSchiele/contracts.ruby/issues/300
https://github.com/egonSchiele/contracts.ruby/commit/88fd1d841615e59c873d7da64d050d3a251634dd
From 88fd1d841615e59c873d7da64d050d3a251634dd Mon Sep 17 00:00:00 2001
From: PikachuEXE <pikachuexe@gmail.com>
Date: Wed, 5 Oct 2022 10:27:41 +0800
Subject: [PATCH] * Update all references to Fixnum to Integer
Deprecated in ruby 2.4
--- a/lib/contracts/builtin_contracts.rb
+++ b/lib/contracts/builtin_contracts.rb
@@ -95,7 +95,7 @@ def self.[](*vals)
# Takes a variable number of contracts.
# The contract passes if any of the contracts pass.
- # Example: <tt>Or[Fixnum, Float]</tt>
+ # Example: <tt>Or[Integer, Float]</tt>
class Or < CallableClass
def initialize(*vals)
super()
@@ -120,7 +120,7 @@ def to_s
# Takes a variable number of contracts.
# The contract passes if exactly one of those contracts pass.
- # Example: <tt>Xor[Fixnum, Float]</tt>
+ # Example: <tt>Xor[Integer, Float]</tt>
class Xor < CallableClass
def initialize(*vals)
super()
@@ -146,7 +146,7 @@ def to_s
# Takes a variable number of contracts.
# The contract passes if all contracts pass.
- # Example: <tt>And[Fixnum, Float]</tt>
+ # Example: <tt>And[Integer, Float]</tt>
class And < CallableClass
def initialize(*vals)
super()
--- a/spec/builtin_contracts_spec.rb
+++ b/spec/builtin_contracts_spec.rb
@@ -30,7 +30,7 @@ def passes(&some)
end
describe "Num:" do
- it "should pass for Fixnums" do
+ it "should pass for Integers" do
passes { @o.double(2) }
end
--- a/spec/fixtures/fixtures.rb
+++ b/spec/fixtures/fixtures.rb
@@ -100,11 +100,11 @@ def sum_three(vals)
end
end
- Contract ({ :name => String, :age => Fixnum }) => nil
+ Contract ({ :name => String, :age => Integer }) => nil
def person(data)
end
- Contract C::StrictHash[{ :name => String, :age => Fixnum }] => nil
+ Contract C::StrictHash[{ :name => String, :age => Integer }] => nil
def strict_person(data)
end
@@ -119,7 +119,7 @@ def hash_complex_contracts(data)
def nested_hash_complex_contracts(data)
end
- Contract C::KeywordArgs[:name => String, :age => Fixnum] => nil
+ Contract C::KeywordArgs[:name => String, :age => Integer] => nil
def person_keywordargs(name: "name", age: 10)
end
@@ -529,30 +529,30 @@ def initialize(day, month)
@month = month
end
- Contract C::None => Fixnum
+ Contract C::None => Integer
def silly_next_day!
self.day += 1
end
- Contract C::None => Fixnum
+ Contract C::None => Integer
def silly_next_month!
self.month += 1
end
- Contract C::None => Fixnum
+ Contract C::None => Integer
def clever_next_day!
return clever_next_month! if day == 31
self.day += 1
end
- Contract C::None => Fixnum
+ Contract C::None => Integer
def clever_next_month!
return next_year! if month == 12
self.month += 1
self.day = 1
end
- Contract C::None => Fixnum
+ Contract C::None => Integer
def next_year!
self.month = 1
self.day = 1
@@ -610,7 +610,7 @@ def on_response(status, body)
body + "!"
end
- Contract Fixnum, String => String
+ Contract Integer, String => String
def on_response(status, body)
"error #{status}: #{body}"
end

View File

@ -1,22 +0,0 @@
https://bugs.gentoo.org/939544
https://github.com/grpc/grpc/issues/37731
https://github.com/grpc/grpc/pull/37741
From 18a89be44d54e8c8bd614f1cee626d1db598a45a Mon Sep 17 00:00:00 2001
From: alto-ruby <altorubys@gmail.com>
Date: Mon, 16 Sep 2024 17:33:04 -0700
Subject: [PATCH] fix incompatible pointer type of
grpc_compression_algorithm_name
--- a/src/ruby/ext/grpc/rb_compression_options.c
+++ b/src/ruby/ext/grpc/rb_compression_options.c
@@ -296,7 +296,7 @@ VALUE grpc_rb_compression_options_level_value_to_name_internal(
* Fails if the enum value is invalid. */
VALUE grpc_rb_compression_options_algorithm_value_to_name_internal(
grpc_compression_algorithm internal_value) {
- char* algorithm_name = NULL;
+ const char* algorithm_name = NULL;
if (!grpc_compression_algorithm_name(internal_value, &algorithm_name)) {
rb_raise(rb_eArgError, "Failed to convert algorithm value to name");

View File

@ -1,157 +0,0 @@
From c2ffc28e97a08534e003eaf25abfa35279274263 Mon Sep 17 00:00:00 2001
From: Samuel Williams <samuel.williams@oriontransfer.co.nz>
Date: Wed, 4 Sep 2024 20:53:04 +1200
Subject: [PATCH] Update test before/after hooks.
---
test/io/event/selector.rb | 12 ++++--------
test/io/event/selector/buffered_io.rb | 4 ++--
test/io/event/selector/cancellable.rb | 7 +++----
test/io/event/selector/file_io.rb | 4 ++--
test/io/event/selector/process_io.rb | 4 ++--
test/io/event/selector/queue.rb | 4 ++--
6 files changed, 15 insertions(+), 20 deletions(-)
diff --git a/test/io/event/selector.rb b/test/io/event/selector.rb
index 760369a6..ee1a53f8 100644
--- a/test/io/event/selector.rb
+++ b/test/io/event/selector.rb
@@ -622,14 +622,12 @@ def transfer
end
with 'an instance' do
- def before
+ before do
@loop = Fiber.current
@selector = subject.new(@loop)
- super
end
- def after
- super
+ after do
@selector&.close
end
@@ -642,14 +640,12 @@ def after
end
describe IO::Event::Debug::Selector do
- def before
+ before do
@loop = Fiber.current
@selector = subject.new(IO::Event::Selector.new(loop))
- super
end
- def after
- super
+ after do
@selector&.close
end
diff --git a/test/io/event/selector/buffered_io.rb b/test/io/event/selector/buffered_io.rb
index 3659d717..3b74d569 100644
--- a/test/io/event/selector/buffered_io.rb
+++ b/test/io/event/selector/buffered_io.rb
@@ -80,12 +80,12 @@
next unless klass.instance_methods.include?(:io_read)
describe(klass, unique: name) do
- def before
+ before do
@loop = Fiber.current
@selector = subject.new(@loop)
end
- def after
+ after do
@selector&.close
end
diff --git a/test/io/event/selector/cancellable.rb b/test/io/event/selector/cancellable.rb
index 2dfa2bae..cb6c1f2a 100644
--- a/test/io/event/selector/cancellable.rb
+++ b/test/io/event/selector/cancellable.rb
@@ -15,8 +15,7 @@
let(:input) {pipe.first}
let(:output) {pipe.last}
- def after
- super
+ after do
input.close
output.close
end
@@ -70,12 +69,12 @@ def after
next unless klass.instance_methods.include?(:io_read)
describe(klass, unique: name) do
- def before
+ before do
@loop = Fiber.current
@selector = subject.new(@loop)
end
- def after
+ after do
@selector&.close
end
diff --git a/test/io/event/selector/file_io.rb b/test/io/event/selector/file_io.rb
index 70a2c962..395a45e3 100644
--- a/test/io/event/selector/file_io.rb
+++ b/test/io/event/selector/file_io.rb
@@ -49,12 +49,12 @@
next unless klass.instance_methods.include?(:io_read)
describe(klass, unique: name) do
- def before
+ before do
@loop = Fiber.current
@selector = subject.new(@loop)
end
- def after
+ after do
@selector&.close
end
diff --git a/test/io/event/selector/process_io.rb b/test/io/event/selector/process_io.rb
index cb8c73de..1ccff956 100644
--- a/test/io/event/selector/process_io.rb
+++ b/test/io/event/selector/process_io.rb
@@ -43,12 +43,12 @@
klass = IO::Event::Selector.const_get(name)
describe(klass, unique: name) do
- def before
+ before do
@loop = Fiber.current
@selector = subject.new(@loop)
end
- def after
+ after do
@selector&.close
end
diff --git a/test/io/event/selector/queue.rb b/test/io/event/selector/queue.rb
index e62af5c4..8017dc36 100644
--- a/test/io/event/selector/queue.rb
+++ b/test/io/event/selector/queue.rb
@@ -198,12 +198,12 @@ def object.transfer
klass = IO::Event::Selector.const_get(name)
describe(klass, unique: name) do
- def before
+ before do
@loop = Fiber.current
@selector = subject.new(@loop)
end
- def after
+ after do
@selector&.close
end