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

[DOC] Pretty tables for Kernel#test doc #9751

Merged
merged 4 commits into from
Feb 1, 2024
Merged

[DOC] Pretty tables for Kernel#test doc #9751

merged 4 commits into from
Feb 1, 2024

Conversation

BurdetteLamar
Copy link
Member

I could not get that spacing following the tables the way I wanted them.

@BurdetteLamar BurdetteLamar added the Documentation Improvements to documentation. label Jan 29, 2024
file.c Outdated
* | <tt>'g'</tt> | Whether the entity's setgid bit is set. |
* | <tt>'G'</tt> | Like <tt>'g'</tt>, but also tests whether the ownership is equal to the caller's. |
* | <tt>'k'</tt> | Whether the entity's sticky bit is set. |
* | <tt>'l'</tt> | Whether the entry is a symbolic link. |
Copy link
Member

Choose a reason for hiding this comment

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

Should we use "entity" here for consistency?

Suggested change
* | <tt>'l'</tt> | Whether the entry is a symbolic link. |
* | <tt>'l'</tt> | Whether the entity is a symbolic link. |

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed. (I hated to say 'entity' throughout, but prefer it to 'thingy.')

file.c Outdated
Comment on lines 5337 to 5338
* - Each of these tests operates only on the entity at `path0`,
* and returns `true` or `false`:
Copy link
Member

Choose a reason for hiding this comment

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

We should be clear about the behaviour if the file does not exist.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

file.c Outdated
* | <tt>'k'</tt> | Whether the entity's sticky bit is set. |
* | <tt>'l'</tt> | Whether the entry is a symbolic link. |
* | <tt>'o'</tt> | Whether the entity is owned by the caller's effective uid. |
* | <tt>'O'</tt> | Like <tt>'o'</tt>, but uses the real uid/gid (not the effective uid/gid). |
Copy link
Member

Choose a reason for hiding this comment

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

It seems like this only checks the uid and not the gid.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

Copy link
Member

Choose a reason for hiding this comment

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

I think @peterzhu2118 meant 'O', not 'o'.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed (I think).

file.c Outdated
*
* | Character | Test |
* |:---------:|:----- |
* | <tt>'-'</tt> | Whether the entities exist and have the same content. |
Copy link
Member

Choose a reason for hiding this comment

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

It's not just same content, but also needs to have the same timestamps and permissions.

Copy link
Member

Choose a reason for hiding this comment

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

It needs the same i-node, or hard-linked files.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've restored the previous term 'identical'; hope that's sufficient.

file.c Outdated
* |:---------:|:----- |
* | <tt>'-'</tt> | Whether the entities exist and have the same content. |
*
*/s
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
*/s
*/

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

file.c Outdated
* | <tt>'k'</tt> | Whether the entity's sticky bit is set. |
* | <tt>'l'</tt> | Whether the entry is a symbolic link. |
* | <tt>'o'</tt> | Whether the entity is owned by the caller's effective uid. |
* | <tt>'O'</tt> | Like <tt>'o'</tt>, but uses the real uid/gid (not the effective uid/gid). |
Copy link
Member

Choose a reason for hiding this comment

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

I think @peterzhu2118 meant 'O', not 'o'.

file.c Outdated
Comment on lines 5352 to 5353
* | <tt>'o'</tt> | Whether the entity is owned by the caller's effective uid/gid. |
* | <tt>'O'</tt> | Like <tt>'o'</tt>, but uses the real uid/gid (not the effective uid/gid). |
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* | <tt>'o'</tt> | Whether the entity is owned by the caller's effective uid/gid. |
* | <tt>'O'</tt> | Like <tt>'o'</tt>, but uses the real uid/gid (not the effective uid/gid). |
* | <tt>'o'</tt> | Whether the entity is owned by the caller's effective uid. |
* | <tt>'O'</tt> | Like <tt>'o'</tt>, but uses the real uid (not the effective uid). |

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

file.c Outdated
* | <tt>'e'</tt> | Whether the entity is an existing entity. |
* | <tt>'f'</tt> | Whether the entity is an existing regular file. |
* | <tt>'g'</tt> | Whether the entity's setgid bit is set. |
* | <tt>'G'</tt> | Like <tt>'g'</tt>, but also tests whether the ownership is equal to the caller's. |
Copy link
Member

Choose a reason for hiding this comment

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

G is unrelated to g.

Suggested change
* | <tt>'G'</tt> | Like <tt>'g'</tt>, but also tests whether the ownership is equal to the caller's. |
* | <tt>'G'</tt> | Whether the entity's group ownership is equal to the caller's. |

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

file.c Outdated
* and returns `true` or `false`;
* for a non-existent entity, returns `false` (does not raise exception):
*
* | Character | Test |
Copy link
Member

Choose a reason for hiding this comment

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

Can you format the tables using something like http://markdowntable.com/?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

It did not like the alignment chars (:), so needed post-format tune-up.

@peterzhu2118 peterzhu2118 merged commit 7b93e65 into ruby:master Feb 1, 2024
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Improvements to documentation.
3 participants