def populate
      # Display progressbar with the number of files as countdown
      progressbar = init_progressbar(current_files.count)

      # Extract the blame history from all checked in files
      current_files.each do |file|
        progressbar.increment

        # Skip this file if non wanted type
        next unless check_file?(file)

        # -w ignore whitespaces (defined in @wopt)
        # -M detect moved or copied lines.
        # -p procelain mode (parsed by BlameParser)
        execute("git #{git_directory_params} blame #{encoding_opt} -p -M #{default_params} #{commit_range.to_s} #{@wopt} -- '#{file}'") do |result|
          BlameParser.new(result.to_s).parse.each do |row|
            next if row[:boundary]

            email = get(row, :author, :mail)
            name = get(row, :author, :name)

            # Create or find user
            author = author_by_email(email, name)

            # Get author by name and increase the number of loc by 1
            author.inc(:loc, get(row, :num_lines))

            # Store the files and authors together
            associate_file_with_author(author, file)
          end
        end
      end

      # Get repository summery and update each author accordingly
      execute("git #{git_directory_params} shortlog #{encoding_opt} #{default_params} -se #{commit_range.to_s}") do |result|
        result.to_s.split("\n").map do |line|
          _, commits, name, email = line.match(/(\d+)\s+(.+)\s+<(.+?)>/).to_a
          author = author_by_email(email)

          author.name = name

          author.update({
            raw_commits: commits.to_i,
            raw_files: files_from_author(author).count,
            files_list: files_from_author(author)
          })
        end
      end

      progressbar.finish
    end
def populate
      # Display progressbar with the number of files as countdown
      progressbar = init_progressbar(current_files.count)

      # Extract the blame history from all checked in files
      current_files.each do |file|
        progressbar.increment

        # Skip this file if non wanted type
        next unless check_file?(file)

        # -w ignore whitespaces (defined in @wopt)
        # -M detect moved or copied lines.
        # -p procelain mode (parsed by BlameParser)
        execute("git #{git_directory_params} blame #{encoding_opt} -p -M #{default_params} #{commit_range.to_s} #{@wopt} -- '#{file}'") do |result|
          BlameParser.new(result.to_s).parse.each do |row|
            next if row[:boundary]

            email = get(row, :author, :mail)
            name = get(row, :author, :name)

            # Create or find user
            author = author_by_email(email, name)

            # Get author by name and increase the number of loc by 1
            author.inc(:loc, get(row, :num_lines))

            # Store the files and authors together
            associate_file_with_author(author, file)
          end
        end
      end

      # Get repository summery and update each author accordingly
      execute("git #{git_directory_params} shortlog #{encoding_opt} #{default_params} -se #{commit_range.to_s}") do |result|
        result.to_s.split("\n").map do |line|
          _, commits, name, email = line.match(/(\d+)\s+(.+)\s+<(.+?)>/).to_a
          author = author_by_email(email)

          author.name = name

          author.update({
            raw_commits: commits.to_i,
            raw_files: files_from_author(author).count,
            files_list: files_from_author(author)
          })
        end
      end

      progressbar.finish
    end
Populates @authors and with data
 Block is called on every call to populate, but
 the data is only calculated once