app.rb
# Get the user's recent commits from their public activity feed.
Get the user's recent commits from their public activity feed.
Get the user ' s recent commits from their public activity feed .
def recent_commits
  public_events = @client.user_public_events @user[:login]
  public_events.select! { |e| e[:type] == "PushEvent" }
  commits = []
  public_events.each do |e|
    e[:payload][:commits].each do |c|
      c[:html_url] = "https://github.com/#{e[:repo][:name]}/commit/#{c[:sha]}"
      c[:shortcut] = "#{e[:repo][:name]}@#{c[:sha][0..7]}"
    end
    commits.concat e[:payload][:commits]
  end
  commits.take 15
end
def recent_commits public_events = @client . user_public_events @user [ :login ] public_events . select! { | e | e [ :type ] == "PushEvent" } commits = [ ] public_events . each do | e | e [ :payload ] [ :commits ] . each do | c | c [ :html_url ] = "https://github.com/#{e[:repo][:name]}/commit/#{c[:sha]}" c [ :shortcut ] = "#{e[:repo][:name]}@#{c[:sha][0..7]}" end commits . concat e [ :payload ] [ :commits ] end commits . take 15 end
Get the user's recent commits from their public activity feed.
Get the user ' s recent commits from their public activity feed .