app/helpers/commits_helper.rb
def commit_person_link(commit, options = {})
    user = commit.send(options[:source])

    source_name = clean(commit.send "#{options[:source]}_name".to_sym)
    source_email = clean(commit.send "#{options[:source]}_email".to_sym)

    person_name = user.try(:name) || source_name
    person_email = user.try(:email) || source_email

    text =
      if options[:avatar]
        avatar = image_tag(avatar_icon(person_email, options[:size]), class: "avatar #{"s#{options[:size]}" if options[:size]}", width: options[:size], alt: "")
        %Q{#{avatar} <span class="commit-#{options[:source]}-name">#{person_name}</span>}
      else
        person_name
      end

    options = {
      class: "commit-#{options[:source]}-link has-tooltip",
      title: source_email
    }

    if user.nil?
      mail_to(source_email, text.html_safe, options)
    else
      link_to(text.html_safe, user_path(user), options)
    end
  end
# Private: Returns a link to a person. If the person has a matching user and
# is a member of the current @project it will link to the team member page.
# Otherwise it will link to the person email as specified in the commit.
#
# options:
#  source: one of :author or :committer
#  avatar: true will prepend the avatar image
#  size:   size of the avatar image in px
Returns a link to a person. If the person has a matching user and
is a member of the current @project it will link to the team member page.
Otherwise it will link to the person email as specified in the commit.

one of :author or :committer
avatar: true will prepend the avatar image
size:   size of the avatar image in px
Returns a link to a person . If the person has a matching user and is a member of the current @project it will link to the team member page . Otherwise it will link to the person email as specified in the commit . one of : author or : committer avatar : true will prepend the avatar image size : size of the avatar image in px
def commit_person_link(commit, options = {})
    user = commit.send(options[:source])
    source_name = clean(commit.send "#{options[:source]}_name".to_sym)
    source_email = clean(commit.send "#{options[:source]}_email".to_sym)
    person_name = user.try(:name) || source_name
    person_email = user.try(:email) || source_email
    text =
      if options[:avatar]
        avatar = image_tag(avatar_icon(person_email, options[:size]), class: "avatar #{"s#{options[:size]}" if options[:size]}", width: options[:size], alt: "")
        %Q{#{avatar} <span class="commit-#{options[:source]}-name">#{person_name}</span>}
      else
        person_name
      end
    options = {
      class: "commit-#{options[:source]}-link has-tooltip",
      title: source_email
    }
    if user.nil?
      mail_to(source_email, text.html_safe, options)
    else
      link_to(text.html_safe, user_path(user), options)
    end
  end
def commit_person_link ( commit , options = { } ) user = commit . send ( options [ :source ] ) source_name = clean ( commit . send "#{options[:source]}_name" . to_sym ) source_email = clean ( commit . send "#{options[:source]}_email" . to_sym ) person_name = user . try ( :name ) || source_name person_email = user . try ( :email ) || source_email text = if options [ :avatar ] avatar = image_tag ( avatar_icon ( person_email , options [ :size ] ) , class : "avatar #{"s#{options[:size]}" if options[:size]}" , width : options [ :size ] , alt : "" ) %Q{#{avatar} <span class="commit-#{options[:source]}-name">#{person_name}</span>} else person_name end options = { class : "commit-#{options[:source]}-link has-tooltip" , title : source_email } if user . nil? mail_to ( source_email , text . html_safe , options ) else link_to ( text . html_safe , user_path ( user ) , options ) end end
Private: Returns a link to a person.
Private : Returns a link to a person .
commit
options