8000 [DOC] Clean up doc for File#flock by BurdetteLamar · Pull Request #9332 · ruby/ruby · GitHub
[go: up one dir, main page]

Skip to content

[DOC] Clean up doc for File#flock #9332

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 13 commits into from
Dec 23, 2023
Merged

[DOC] Clean up doc for File#flock #9332

merged 13 commits into from
Dec 23, 2023

Conversation

BurdetteLamar
Copy link
Member

Switches from RDoc to markdown in order to have a better table.

@BurdetteLamar BurdetteLamar added the Documentation Improvements to documentation. label Dec 23, 2023
file.c Outdated
* <td><tt>File::LOCK_NB</tt></td>
* <td>Non-blocking</td>
* <td>
* No blocking; may be combined with other `File::LOCK_SH` or `File::LOCK_EX`
Copy link
Member
8000

Choose a reason for hiding this comment

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

The backticks don't work inside of HTML.

Suggested change
* No blocking; may be combined with other `File::LOCK_SH` or `File::LOCK_EX`
* No blocking; may be combined with other <tt>File::LOCK_SH</tt> or <tt>File::LOCK_EX</tt>

Copy link
Member

Choose a reason for hiding this comment

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

@BurdetteLamar this doesn't appear to be fixed.

@peterzhu2118
Copy link
Member

@BurdetteLamar there appears to be changes to complex.c in this PR, is that a mistake?

@BurdetteLamar
Copy link
Member Author

mistake

@peterzhu2118, Don't know how to unwind this (attempt failed). Okay to close and put file.c into new PR?

@peterzhu2118
Copy link
Member

I merged the master branch into this branch, it looks like it solved the issues.

@peterzhu2118 peterzhu2118 merged commit 688a131 into ruby:master Dec 23, 2023
Comment on lines +5239 to +5271
* <table>
* <tr>
* <th colspan="3">Locking Constants</th>
* </tr>
* <tr>
* <th>Constant</th>
* <th>Lock</th>
* <th>Effect</th>
* </tr>
* <tr>
* <td><tt>File::LOCK_EX</tt></td>
8000 * <td>Exclusive</td>
* <td>Only one process may hold an exclusive lock for <tt>self</tt> at a time.</td>
* </tr>
* <tr>
* <td><tt>File::LOCK_NB</tt></td>
* <td>Non-blocking</td>
* <td>
* No blocking; may be combined with other `File::LOCK_SH` or `File::LOCK_EX`
* using the bitwise OR operator <tt>|</tt>.
* </td>
* </tr>
* <tr>
* <td><tt>File::LOCK_SH</tt></td>
* <td>Shared</td>
* <td>Multiple processes may each hold a shared lock for <tt>self</tt> at the same time.</td>
* </tr>
* <tr>
* <td><tt>File::LOCK_UN</tt></td>
* <td>Unlock</td>
* <td>Remove an existing lock held by this process.</td>
* </tr>
* </table>
Copy link
Member

Choose a reason for hiding this comment

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

This seems duplicate of File::Constants@Locking but different a little.
Why not just linking?

Or a markdown table.

 *  [Locking Constants](rdoc-ref:File::Constants@Locking)
 *
 *  | Constant      | Lock         | Effect
 *  |---------------|--------------|-------------------------------------------------------------------
 *  | File::LOCK_EX | Exclusive    | Only one process may hold an exclusive lock for +self+ at a time.
 *  | File::LOCK_NB | Non-blocking | No blocking; may be combined with other +File::LOCK_SH+ or +File::LOCK_EX+ using the bitwise OR operator <tt>\|</tt>
 *  | File::LOCK_SH | Shared       | Multiple processes may each hold a shared lock for +self+ at the same time.
 *  | File::LOCK_UN | Unlock       | Remove an existing lock held by this process.

Copy link
Member Author

Choose a reason for hiding this comment

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

This seems duplicate of File::Constants@Locking but different a little. Why not just linking?

Or a markdown table.

 *  [Locking Constants](rdoc-ref:File::Constants@Locking)
 *
 *  | Constant      | Lock         | Effect
 *  |---------------|--------------|-------------------------------------------------------------------
 *  | File::LOCK_EX | Exclusive    | Only one process may hold an exclusive lock for +self+ at a time.
 *  | File::LOCK_NB | Non-blocking | No blocking; may be combined with other +File::LOCK_SH+ or +File::LOCK_EX+ using the bitwise OR operator <tt>\|</tt>
 *  | File::LOCK_SH | Shared       | Multiple processes may each hold a shared lock for +self+ at the same time.
 *  | File::LOCK_UN | Unlock       | Remove an existing lock held by this process.

@nobu, my aim here is reformatting from RDoc to markdown, not (for the most part) revision; the existing crude "table" has been here at least since before version 2.7.0, so I've retained (but reformatted) it.

I tried the markdown table (Github flavored?), but it did not work for me; do I need to enable something?

Copy link
Member

Choose a reason for hiding this comment

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

I used the markdown table and it correctly generated a table for me. I'm on RDoc 6.6.2.

Screenshot 2023-12-24 at 10 24 48 AM

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 am running 6,3,1, gem install rdoc failed (problems building native extensions). How to proceed?

Copy link
Member

Choose a reason for hiding this comment

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

What Ruby are you running and what is the error?

Copy link
Member Author

Choose a reason for hiding this comment

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

ruby 3.0.2p107 (2021-07-07 revision 0db68f0) [x86_64-linux-gnu] on my LInux machine.

Over on my Windows machine, I'm running ruby 3,2,2 and rdoc 6.5.0, where the markdown table works fine. Will migrate there and revise.

@nurse nurse mentioned this pull request Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Improvements to documentation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0