Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

version-file docs update #1512

Merged
merged 3 commits into from
Jul 11, 2023
Merged

Conversation

richiethomas
Copy link
Contributor

@richiethomas richiethomas commented Jul 2, 2023

The job of the rbenv-version-file command is to print the filepath for the file which sets the current Ruby version. It searches for a .ruby-version file, traversing upward if such a file is not found until it reaches the root directory.

  • If a directory is passed as an argument, the command uses that directory as a starting point.
  • If no directory is passed as an argument:
    • The command first searches in RBENV_DIR.
    • If no .ruby-version file is found, it searches again in the current directory (provided that RBENV_DIR is different from the current directory).
    • If both of those attempts fail to find a .ruby-version file, it prints the path to RBENV's global version file ("${RBENV_ROOT}/version").

This global version file may not actually exist, for example in the following cases:

  • If a user has not yet set a global version via rbenv global <version_number>.
  • If they have not set a local project version, either via rbenv local <version_number> or by manually creating a .ruby-version file.

In the case where the filepath returned by rbenv-version-file doesn't actually exist, the result might be confusion on the user's part. This PR attempts to address that confusion, by updating the output of rbenv help version-file to specify that this command's output is the filepath which would set the Ruby version, if it exists.

@richiethomas richiethomas changed the title Version file docs update version-file docs update Jul 2, 2023
@@ -1,6 +1,10 @@
#!/usr/bin/env bash
# Usage: rbenv version-file [<dir>]
# Summary: Detect the file that sets the current rbenv version
# Summary: Detect the file that sets the current rbenv version.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: the summaries of other commands don't end in periods, so this one shouldn't either.

Copy link
Member

@mislav mislav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I have pushed amendments to the text for more clarity.

@mislav mislav merged commit 906a6ac into rbenv:master Jul 11, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants