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

Deprecate ActiveSupport::Multibyte::Chars.consumes? #34215

Merged
merged 1 commit into from Oct 15, 2018

Conversation

@frodsan
Copy link
Contributor

@frodsan frodsan commented Oct 15, 2018

In favor of String#is_utf8? method.

I think this method was made for internal use only, and its usage was removed here: https://github.com/rails/rails/pull/8261/files#diff-ce956ebe93786930e40f18db1da5fd46L39.

r? @jeremy

@rails-bot
Copy link

@rails-bot rails-bot commented Oct 15, 2018

Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @jeremy (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

This repository is being automatically checked for code quality issues using Code Climate. You can see results for this analysis in the PR status below. Newly introduced issues should be fixed before a Pull Request is considered ready to review.

Please see the contribution instructions for more information.

@frodsan frodsan force-pushed the deprecation/chars-consumes branch 2 times, most recently from cfcb181 to 2393986 Oct 15, 2018
Copy link
Member

@jeremy jeremy left a comment

@@ -1,3 +1,7 @@
* Deprecate `ActiveSupport::Multibyte::Chars#consumes?` in favor of `String#is_utf8?`.
Copy link
Member

@jeremy jeremy Oct 15, 2018

Chars#consumes?Chars.consumes?

@@ -76,6 +76,11 @@ def respond_to_missing?(method, include_private)
# Returns +true+ when the proxy class can handle the string. Returns
# +false+ otherwise.
def self.consumes?(string)
ActiveSupport::Deprecation.warn(<<-MSG.squish)
ActiveSupport::Multibyte::Chars#consumes? is deprecated and will be
removed from Rails 6.1. Use #is_utf8? instead.
Copy link
Member

@jeremy jeremy Oct 15, 2018

Let's indicate that usage changes from a String argument to a String method. Example:

ActiveSupport::Multibyte::Chars.consumes?(string) is deprecated and will be removed from Rails 6.1. Use string.is_utf8? instead.

@frodsan frodsan changed the title Deprecate ActiveSupport::Multibyte::Chars#consumes? Deprecate ActiveSupport::Multibyte::Chars.consumes? Oct 15, 2018
In favor of String#is_utf8?.

I think this method was made for internal use only, and its usage was removed here: https://github.com/rails/rails/pull/8261/files#diff-ce956ebe93786930e40f18db1da5fd46L39.
@frodsan frodsan force-pushed the deprecation/chars-consumes branch from 2393986 to 309eb34 Oct 15, 2018
@frodsan
Copy link
Contributor Author

@frodsan frodsan commented Oct 15, 2018

Thanks for the review! Most of the search results are projects that vendor activesupport so this may not affect that many users 😄

@jeremy jeremy merged commit 134dab4 into rails:master Oct 15, 2018
1 of 2 checks passed
suketa added a commit to suketa/rails_sandbox that referenced this issue Jun 29, 2019
Deprecate ActiveSupport::Multibyte::Chars.consumes?
rails/rails#34215
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants