Skip to content

Fix choice of main page #284

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

Merged
merged 1 commit into from
Aug 17, 2023

Conversation

jonathanhefner
Copy link
Member

Prior to this commit, RDoc::Generator::SDoc#index exhibited the following incorrect behaviors:

  1. When --main was not specified, index would choose the alphabetically-first file as the main page, instead of the first file in the list of files.

  2. When --main was specified but was prefixed with --root, and --root did not start with "rails/", index would choose the alphabetically-first file. (Such as when --root was an absolute path, or a deeply nested relative path, or simply a path for a non-Rails project.)

  3. When --main was specified but was not in the list of files, index would choose the alphabetically-first file.

This commit fixes RDoc::Generator::SDoc#index such that it:

  1. Chooses the first file in the list of files as the default main page.

  2. Handles any kind of --main path.

  3. Raises an error when --main isn't among the rendered files.

Prior to this commit, `RDoc::Generator::SDoc#index` exhibited the
following incorrect behaviors:

1. When `--main` was not specified, `index` would choose the
   alphabetically-first file as the main page, instead of the first file
   in the list of files.

2. When `--main` was specified but was prefixed with `--root`, and
   `--root` did not start with "rails/", `index` would choose the
   alphabetically-first file.  (Such as when `--root` was an absolute
   path, or a deeply nested relative path, or simply a path for a
   non-Rails project.)

3. When `--main` was specified but was not in the list of files, `index`
   would choose the alphabetically-first file.

This commit fixes `RDoc::Generator::SDoc#index` such that it:

1. Chooses the first file in the list of files as the default main page.

2. Handles any kind of `--main` path.

3. Raises an error when `--main` isn't among the rendered files.
@jonathanhefner jonathanhefner merged commit b9786d4 into rails:main Aug 17, 2023
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.

1 participant