-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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] RDoc for character selectors #5632
Conversation
- String#tr(selector, replacements): returns a new string. | ||
- String#tr!(selector, replacements): returns +self+. | ||
- String#tr_s(selector, replacements): returns a new string. | ||
- String#tr_s!(selector, replacements): returns +self+. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These links all work for me. If the arguments' not rendering properly is a problem, I think it's an Rdoc problem. If the links work, I vote to keep the arguments; I think they clarify the semantics of the calls, especially the top four.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I've opened ruby/rdoc#871 which fixes this problem. Using that rdoc to build the HTML, it looks much better.
- String#tr(selector, replacements): returns a new string. | ||
- String#tr!(selector, replacements): returns +self+. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#5626 called the method parameters replaceables
and replacements
, this should be consistent and use the same names.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When this PR is merged, #tr revision will be next -- unless you think it should be added here.
Co-authored-by: Peter Zhu <peter@peterzhu.ca>
Added a new commit with example of negation and range together. |
@peterzhu2118: sorry, did not realize that I hadn't committed your change earlier. Now done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
This file will be a link target for methods doc that cites character selectors (e.g., String#tr),
It covers only the character selector; +replacement+ is discussed at String#tr (which will be revised and simplified); multiple selectors will be discussed at String#delete and String#count.
At line 29, the extra space is needed to render properly (at least on my machine).