How to display the git last commit of every file in a list with ruby

Problem

You want to display the last commit of every file that you have in a list.

Solution

Let’s say that you have the following file list in an array:

in order to be able to get the last commits of each of the files in ruby do the following: