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

URI.escape is deprecated #36

Open
YtvwlD opened this issue Jun 6, 2020 · 5 comments
Open

URI.escape is deprecated #36

YtvwlD opened this issue Jun 6, 2020 · 5 comments

Comments

@YtvwlD
Copy link

YtvwlD commented Jun 6, 2020

Running on Ruby 2.7, I get this warning a lot:

vendor/bundle/ruby/2.7.0/gems/gravatar_image_tag-1.2.0/lib/gravatar_image_tag.rb:121: warning: URI.escape is obsolete

Everything still seems to work fine, but I'm afraid it might break on a newer version.

@webzorg
Copy link

webzorg commented Dec 26, 2020

It broke in ruby 3.0, I will be forced to fork this project if it is dead and not accepting PRs

@webzorg
Copy link

webzorg commented Dec 26, 2020

URI.escape just needs to be replaced by URI.encode_www_form_component

@sunny
Copy link

sunny commented Jan 10, 2021

Fixed by #35

@msroot
Copy link

msroot commented Jul 5, 2021

you can simple use

def user_avatar user
 "https://www.gravatar.com/avatar/#{Digest::MD5.hexdigest(user.email.downcase)}?size=150"
end

@hoeni
Copy link

hoeni commented Feb 15, 2022

@msroot perfect, thanks! We had to add a default=identicon query parameter to get the identicons instead of the gravatar logo.

def user_avatar user
  "https://www.gravatar.com/avatar/#{Digest::MD5.hexdigest(user.email.downcase)}?default=identicon&size=150"
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants