Skip to content
Snippets Groups Projects
Verified Commit d5b0f29c authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Move gravatar url compose to separate service

parent 273093a9
No related branches found
No related tags found
No related merge requests found
class GravatarService
def execute(email, size = nil)
if gravatar_config.enabled && email.present?
size = 40 if size.nil? || size <= 0
sprintf gravatar_url,
hash: Digest::MD5.hexdigest(email.strip.downcase),
size: size,
email: email.strip
end
end
def gitlab_config
Gitlab.config.gitlab
end
def gravatar_config
Gitlab.config.gravatar
end
def gravatar_url
if gitlab_config.https
gravatar_config.ssl_url
else
gravatar_config.plain_url
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment