So it turns out that gsub_file does not actually check if it matched anything and so we have a few misc. changes silently not being applied due to changes in Rails 7.1.
This addresses that by switching us to use gsub_file! which reads the file into memory before it's gsub'd and then compares the results to make sure it actually changed.
So it turns out that
gsub_file
does not actually check if it matched anything and so we have a few misc. changes silently not being applied due to changes in Rails 7.1.This addresses that by switching us to use
gsub_file!
which reads the file into memory before it's gsub'd and then compares the results to make sure it actually changed.I've opened https://github.com/rails/thor/issues/874 to add this to Thor itself