Now that we require Ruby 3.1, we can assume `Process._fork` is
defined on MRI, hence we can trust that our decorator will
reliably detect forks so we no longer need to check the if
the pid changed in critical spots.
* Remove pidfile in production
* Update changelog
* Update activestorage/test/dummy/config/puma.rb
Co-authored-by: Rafael Mendonça França <rafael@franca.dev>
* Update template and other dummy files
---------
Co-authored-by: Rafael Mendonça França <rafael@franca.dev>
This is currently causing an issue in 6-1-stable CI due to a chain of
dependencies: minitest-bisect -> minitest-server -> drb. The last
working version of Drb for Ruby 2.5 and 2.6 includes usage of
ruby2_keywords but does not declare a dependency on the shim gem
(meaning that version of Drb actual does not work on those Ruby
versions).
ruby2_keywords was [added][1] to the 6-1-stable Active Support gemspec
to address the issue with Drb, but this only fixes cases where Drb is
required by Rails. However, there are still failing tests on 6-1-stable
due to Drb being loaded in integration tests where a dummy Rails
application calls Bundler.require and the above dependency chain is
required.
To address those test failures, this commit prevents minitest-bisect
from being automatically required when the whole bundle is required. It
is not strictly necessary for main or any stable branches other than
6-1-stable, but it seems more correct since minitest_bisect is ran as an
external command anyways.
[1]: 5a54e2f36a
Using Symbol#name allows to hit two birds with one stone.
First it will return a pre-existing string, so will save
one allocation per key.
Second, that string will be already interned, so it will
save the internal `Hash` implementation the work of looking
up the interned strings table to deduplicate the key.
```
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-darwin21]
Warming up --------------------------------------
to_s 17.768k i/100ms
cond 23.703k i/100ms
Calculating -------------------------------------
to_s 169.830k (±10.4%) i/s - 852.864k in 5.088377s
cond 236.803k (± 7.9%) i/s - 1.185M in 5.040945s
Comparison:
to_s: 169830.3 i/s
cond: 236803.4 i/s - 1.39x faster
```
```ruby
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'benchmark-ips', require: false
end
HASH = {
first_name: nil,
last_name: nil,
country: nil,
profession: nil,
language: nil,
hobby: nil,
pet: nil,
longer_name: nil,
occupation: nil,
mailing_address: nil,
}.freeze
require 'benchmark/ips'
Benchmark.ips do |x|
x.report("to_s") { HASH.transform_keys(&:to_s) }
x.report("cond") { HASH.transform_keys { |k| Symbol === k ? k.name : k.to_s } }
x.compare!(order: :baseline)
end
```
Collection associations point to an array target, where singular
associations will point to a single object. An "empty" (or "reset")
association has different meaning depending on whether it's single or a
collection. This commit changes the reset method to be specific to the
type of association.
This is related to #48671
RDoc treats consecutive indented lines as a single code block. For code
examples that span multiple files / languages, this confuses the syntax
highlighter and makes the examples harder to read. Unfortunately, RDoc
doesn't provide syntax to prevent this, and it ignores multiple
consecutive blank lines. However, by inserting an empty tag such as
`<code></code>`, we can force RDoc to recognize separate code blocks.
The introduction of the block argument means that `Object#with` can now
accept a `Symbol#to_proc` as the block argument:
```ruby
client.with(timeout: 5_000) do |c|
c.get("/commits")
end
```
We recently had [two][1] [PRs][2] to update these types of links, so
this commit does all of the rest (remaining links to master branches
were checked and still exist).
[1]: e76c52a939
[2]: a2ed3437e3