app/helpers/extensions_helper.rb
#
# Selects the appropriate avatar 
# only link if the avatar is that of the owner
# only show organization avatar for hosted assets
#
# @param extension [active record]
# @param options [Hash] options for the Gravatar
# @option options [Integer] :size (48) the size of the Gravatar in pixels
# @option options [String] :maintainer the id to associate with the gravatar
#
Selects the appropriate avatar
only link if the avatar is that of the owner
only show organization avatar for hosted assets
Selects the appropriate avatar only link if the avatar is that of the owner only show organization avatar for hosted assets
def link_to_gravatar(extension, options={})
    options = {
      size: 36
    }.merge(options)
    size = options[:size]
    maintainer = options[:maintainer] || ''
    html = ''
    if extension.github_organization
      html = gravatar_for(extension.github_organization, size: size)
    elsif extension.hosted?
      html = gravatar_for(extension.owner, size: size, hosted: true)
    else
      link_to extension.owner do
        html = gravatar_for(extension.owner, size: size)
        html += content_tag('div', maintainer) if maintainer.present?
      end
    end
    html.html_safe
  end
def link_to_gravatar ( extension , options = { } ) options = { size : 36 } . merge ( options ) size = options [ :size ] maintainer = options [ :maintainer ] || '' html = '' if extension . github_organization html = gravatar_for ( extension . github_organization , size : size ) elsif extension . hosted? html = gravatar_for ( extension . owner , size : size , hosted : true ) else link_to extension . owner do html = gravatar_for ( extension . owner , size : size ) html += content_tag ( 'div' , maintainer ) if maintainer . present? end end html . html_safe end
Selects the appropriate avatar
only link if the avatar is that of the owner
only show organization avatar for hosted assets
Selects the appropriate avatar only link if the avatar is that of the owner only show organization avatar for hosted assets
extension
<not_specific>
options
:maintainer the id to associate with the gravatar
: maintainer the id to associate with the gravatar
<not_specific>
None