The export
builds a CSV
the old way.
def to_csv(rows)
out = ""
rows.each { |r| out << r.join(",") << "\n" }
out
end
An empty string.
Append,
append,
append.
It has run
every night
for nine years.
Here is what is changing.
Ruby has been moving
towards frozen string literals
for a long time.
Most files in Rails apps
already start with:
frozen_string_literal: true
Files without it
have always been allowed
to change their literals.
Ruby 3.4
changed that quietly.
A literal
in a file without the comment
is now "chilled".
It still works.
But mutate it,
with << or gsub!,
and Ruby
records a deprecation:
warning: literal string will be frozen in the future
The plan is
that a later Ruby
freezes them for real.
Then the same line
raises FrozenError.
can't modify frozen String
Here is the trap.
Deprecation warnings
are off by default.
So the nightly export
says nothing.
The test suite
says nothing.
Everything is green
until the version
where it stops.
Here is what to do…