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.
What was the end-user problem that led to this PR?
eval_gemfile
is a useful method used across many projects, but it is not explicitly documented. On the other hand, it isn't explicitly marked as undocumented via something like# :nodoc:
. This leads to confusion as to whether it should be used or not, as in rails/rails#47033What was your diagnosis of the problem?
We should clearly mark the method as part of the public API, or private API.
What is your fix for the problem, implemented in this PR?
This adds documentation for
eval_gemfile
and how it can be used in one'sGemfile
.Why did you choose this fix out of the possible options?
The alternative is to mark it as private using something a magic comment:
However, as this is in use by many projects, my personal preference is to see it become public. Searching GitHub for usage turns up examples such as the following:
eval_gemfile
to read .Gemfile rails/rails#47033 & Revert "Useeval_gemfile
to read .Gemfile" rails/rails#47098)This PR serves to start the discussion, so we can take a clear stance one way or the other. I've also opened rubygems/rubygems#6292, if we prefer to mark it as
:nodoc:
instead, although I personally would prefer to document it.