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
Use Module.prepend instead of alias_method for Range#to_s #22556
Conversation
r? @kaspth (@rails-bot has picked a reviewer for you, use r? to override) |
14e1e61
to
4ac1175
Compare
# Convert range to a formatted string. See RANGE_FORMATS for predefined formats. | ||
# | ||
# This method is aliased to <tt>to_s</tt>. | ||
# Provides option for converting range into formatted string. See RANGE_FORMATS for predefined formats. |
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.
Think the old explanation was clearer.
Looks good to me. Keep your commits squashed to 1, after fixing my one comment, and I'll merge. |
4ac1175
to
39205ec
Compare
Fixed as in comment. |
Is Note that all |
It is a public API since we are documenting it. In my opinion it should be preserved since its implementation is not hard and we are not using any deprecated API like |
There was discussion about this topic in #20038 (same issue with Numeric type). I believe |
On the other hand, if all the deprecations are as simple as |
Any updates on this one? |
I'm 👍 on deprecations, but, like @jeremy said, they should be handled together. Can you take the deprecation out? |
39205ec
to
2f7716b
Compare
Removed deprecation of |
Yes, |
2f7716b
to
b0f1d98
Compare
Ok - all deprecations removed as requested. |
Use Module.prepend instead of alias_method for Range#to_s
Thanks, will you be following this up with a deprecation PR? |
Thanks for merging. I will try to do follow-up PR this weekend. |
This is a follow-up pull request to #19434 - now that Ruby 2.2.2 is out we can switch to #prepend.
Looks like
to_formatted_s
andto_default_s
are neither mentioned, nor tested, so we can treat them as private API that was required foralias_method_chain
- but deprecation warning is left just in case./cc @rafaelfranca @kirs @sgrif