/*globals $,console,d3,cookieJar,formatDate,github,opr,InstallTrigger,Blob */
/*!
 * aggregitor.js
 *
 * Copyright 2016 Timothy Davenport; Licensed MIT
 */

(function () {
    'use strict';
    window.aggregitor = {
        user : null,
        punch_card : function () {

        },
        code_frequency : function () {

        },
        commit_activity : function () {

        },
        contributors : function () {

        },
        participation : function () {

        }
    };
}());

@@ -148,16 +148,61 @@
  MIT%0A */
+%0Avar DAYS_IN_WEEK = 7,%0A    HOURS_IN_DAY = 24;
 %0A%0A(funct
@@ -266,56 +266,1985 @@
     
-user : null,%0A        punch_card : function () %7B%0A
+process_punch_cards : function (user) %7B%0A            /* Takes punch cards from repo/stats and puts them in packaged form of %7Brepo0: punch_card0, repo1: punch_card1%7D.%0A            each punch card is an array of %5Bd, h, c%5D, where d = weekday, h = 24 hour, and c = number of commits. punch cards%0A            are pre filled with 0 so that empty or unavailable repos will be aggregated gracefully later.%0A             */%0A            var punch_cards = %7B%7D%0A                punch_card = %5B%5D,%0A                h = 0,%0A                d = 0,%0A                i = 0,%0A                key = '',%0A                repo = %7B%7D;%0A%0A            // Aggregate punch card data%0A            console.log('Aggregating Punch Card:');%0A            // Loop thru repos%0A            for (key in user.repos) %7B%0A                if (user.repos.hasOwnProperty(key)) %7B%0A                    repo = user.repos%5Bkey%5D;%0A%0A                    // Fill empty punchcard for this repo%0A                    punch_card = %5B%5D;%0A                    for (d = 0; d %3C DAYS_IN_WEEK; d += 1) %7B%0A                        for (h = 0; h %3C HOURS_IN_DAY; h += 1) %7B%0A                            punch_card.push(%5Bd, h, 0%5D);%0A                        %7D%0A                    %7D%0A                    // If there is a punch card for this repo, get it.%0A                    if (repo.hasOwnProperty('stats') &&%0A                        repo.stats.hasOwnProperty('punch_card') &&%0A                        !$.isEmptyObject(repo.stats.punch_card)) %7B%0A                        console.log('    ' + repo.name);%0A                        for (i = 0; i %3C repo.stats.punch_card.length; i += 1) %7B%0A                            punch_card%5Bi%5D%5B2%5D += repo.stats.punch_card%5Bi%5D%5B2%5D;%0A                        %7D%0A                    %7D else %7B%0A                        console.log('    ' + repo.name + ' ! could not aggregate');%0A                    %7D%0A                    // add to punch_cards%0A                    punch_cards%5Bkey%5D = punch_card;%0A                %7D%0A            %7D%0A            return punch_cards;
 %0A   
@@ -2259,16 +2259,24 @@
         
+process_
 code_fre
@@ -2318,16 +2318,24 @@
         
+process_
 commit_a
@@ -2378,16 +2378,24 @@
         
+process_
 contribu
@@ -2435,16 +2435,24 @@
         
+process_
 particip

create punch_card pre processor