Closed luizkowalski closed 9 months ago
I can't see exactly the failure, and locally the tests are passing (individually)
Pushed the missing change, thanks!
I'm not enthusiastic about copying a file because it might be referenced by the Gemfile. By default, new Rails 7.1 applications will have a .ruby-version file but it won't be referenced by the Gemfile.
Perhaps add something along the lines of && IO.read('Gemfile').include?('.ruby-version')
to ruby_version_exists?
Just to be clear: I'm not seeking perfection. If you were to pick a new Rails project at random, it likely will have a .ruby-version file but not referenced in the Gemfile. If the Gemfile itself contains the string ".ruby-version" it likely references that file, but only a full fledged parser would be able to determine if it actually does.
That actually makes sense, since, IIRC, this file is ignored by default.
I will amend the PR
edit: amended. I don't think we need actually to check for the file presence anymore since if the Gemfile references it, it HAS to exist, otherwise the application won't even boot
For posterity, bundler is including a mechanism to read the .ruby-version from the Gemfile. It looks like this:
ruby file: ".ruby-version"
Fixes #76