Add dependencies on gems that are no longer default in Ruby 3.5. #49
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Without this,
main
would fail to load those gems in Ruby 3.5. Resolves a warning in Ruby 3.3.5 and 3.4.When using Braid with Ruby 3.3.5, I got the warnings:
(The first line number refers to a line in Braid that says
require 'main'
. I don't know why the warning is blamed on that line rather than on therequire 'logger'
line inmain
.)So I added the explicit dependencies to the gemspec. Ideally, they would have meaningful minimum versions, but researching what the minimum versions should be looks like a time sink to me. If
main
declared a minimum Ruby version, then it would be reasonable to just take the gem versions from that Ruby version, but since it doesn't, the risk of allowing a too-old version oflogger
orostruct
doesn't seem fundamentally worse to me than the risk of allowing a too-old Ruby.The warnings are reported only when running under Bundler (edit 2024-11-04; I'll be happy to update the commit message if/when there's interest in merging this PR). The presence of the warnings for
logger
andostruct
in Ruby 3.3.5 is considered a bug, and those warnings will be removed in Ruby 3.3.6. But Ruby 3.4 is expected soon enough (2024-12-25) that I think it's reasonable to go ahead and make this change to reduce the annoyance on Ruby 3.3.5 too.I looked for documentation about these warnings and didn't find any; I only found the code in Ruby that generates them in case that's helpful.