Skip to content

Commit

Permalink
Simplify!
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiopelosin committed Apr 12, 2013
1 parent 56943b1 commit 4d39342
Show file tree
Hide file tree
Showing 9 changed files with 559 additions and 208 deletions.
20 changes: 11 additions & 9 deletions Rakefile
Expand Up @@ -5,7 +5,7 @@ require 'json'
require 'erb'
require 'cgi'

task :default => :deploy
task :default => :update

#-----------------------------------------------------------------------------#
# These tasks assume to be in sibling directory to the CocoaPods gem
Expand All @@ -25,21 +25,23 @@ end
desc "Update the page"
task :update do
title("Updating master repo")
# sh "pod repo update master"
sh "pod repo update master"
sets = Pod::Source.new(Pathname.new(File.expand_path "~/.cocoapods/master")).pod_sets
puts "COUNT: #{sets.count}"

title("Computing addition dates")
count_by_date = generate_count_by_date(sets)

title("Generating graph data")
graph_data = generate_graph_data(count_by_date)
File.open('graph.json', 'w+') { |f| f.puts(graph_data.to_json) }

title("Generating HTML")
html = generate_html(sets, graph_data)
File.open('index.html', 'w+') { |f| f.puts(html) }
json = {
'total_count' => sets.count,
'count_by_date' => graph_data,
}
File.open('graph.json', 'w+') { |f| f.puts(json.to_json) }

puts "Page updated."
`open index.html`
end

#-----------------------------------------------------------------------------#
Expand All @@ -48,7 +50,7 @@ end
# Pods added by the date.
#
def generate_count_by_date(sets)
dates_by_pods = Pod::Specification::Set::Statistics.instance.creation_dates(sets)
dates_by_pods = Pod::Specification::Set::Statistics.new(Pod::STATISTICS_CACHE_FILE).creation_dates(sets)
dates = dates_by_pods.values
min_date = dates.min - (24 * 3600)
count_by_date = {Time.utc(min_date.year, min_date.month, min_date.day) => 0}
Expand All @@ -60,7 +62,7 @@ def generate_count_by_date(sets)
count_by_date.sort_by{|date, count| date}
end

# @return [Hash{Symbol => Number}] Hash which contains the value of the x axis
# @return [Array<Hash{Symbol => Number}>] Hash which contains the value of the x axis
# (the dates expressed in the UNIX format) and of the y axis (the
# cumulated number of added Pods on a specific date).
#
Expand Down
Binary file added assets/cocoapods.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/rss-logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/twitter-logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion graph.json
@@ -1 +1 @@
[{"x":1315353600,"y":0},{"x":1315440000,"y":2},{"x":1315699200,"y":3},{"x":1315785600,"y":4},{"x":1316304000,"y":8},{"x":1316390400,"y":10},{"x":1316476800,"y":11},{"x":1316563200,"y":13},{"x":1316736000,"y":14},{"x":1316908800,"y":16},{"x":1317081600,"y":17},{"x":1317513600,"y":20},{"x":1317859200,"y":21},{"x":1319068800,"y":22},{"x":1320105600,"y":23},{"x":1320883200,"y":26},{"x":1321142400,"y":28},{"x":1321315200,"y":32},{"x":1321401600,"y":34},{"x":1321660800,"y":36},{"x":1321747200,"y":39},{"x":1321833600,"y":42},{"x":1321920000,"y":45},{"x":1322006400,"y":46},{"x":1322265600,"y":47},{"x":1322352000,"y":48},{"x":1323216000,"y":49},{"x":1323302400,"y":50},{"x":1323734400,"y":51},{"x":1323820800,"y":52},{"x":1323907200,"y":53},{"x":1324166400,"y":55},{"x":1324598400,"y":56},{"x":1325116800,"y":57},{"x":1325203200,"y":58},{"x":1325376000,"y":59},{"x":1325635200,"y":60},{"x":1326067200,"y":63},{"x":1326153600,"y":64},{"x":1327449600,"y":65},{"x":1327622400,"y":66},{"x":1327795200,"y":67},{"x":1327881600,"y":71},{"x":1327968000,"y":72},{"x":1328054400,"y":73},{"x":1328227200,"y":74},{"x":1328572800,"y":77},{"x":1328659200,"y":80},{"x":1328745600,"y":81},{"x":1328832000,"y":82},{"x":1329696000,"y":83},{"x":1329955200,"y":84},{"x":1330041600,"y":85},{"x":1330214400,"y":96},{"x":1330300800,"y":99},{"x":1330387200,"y":100},{"x":1330646400,"y":107},{"x":1330732800,"y":108},{"x":1330819200,"y":111},{"x":1331078400,"y":112},{"x":1331251200,"y":113},{"x":1331337600,"y":114},{"x":1331424000,"y":115},{"x":1331510400,"y":118},{"x":1331683200,"y":121},{"x":1331769600,"y":122},{"x":1331856000,"y":123},{"x":1332115200,"y":124},{"x":1332374400,"y":125},{"x":1332547200,"y":126},{"x":1332633600,"y":128},{"x":1332720000,"y":129},{"x":1332892800,"y":131},{"x":1333065600,"y":134},{"x":1333152000,"y":135},{"x":1333238400,"y":136},{"x":1333324800,"y":137},{"x":1333411200,"y":138},{"x":1333497600,"y":139},{"x":1333584000,"y":142},{"x":1333670400,"y":152},{"x":1333756800,"y":156},{"x":1334016000,"y":157},{"x":1334188800,"y":158},{"x":1334275200,"y":159},{"x":1334448000,"y":161},{"x":1334534400,"y":169},{"x":1334620800,"y":177},{"x":1334707200,"y":183},{"x":1334793600,"y":186},{"x":1334880000,"y":187},{"x":1334966400,"y":188},{"x":1335398400,"y":189},{"x":1336608000,"y":190},{"x":1337817600,"y":256},{"x":1338249600,"y":260},{"x":1338336000,"y":261},{"x":1339027200,"y":278},{"x":1339545600,"y":284},{"x":1339718400,"y":285},{"x":1340064000,"y":286},{"x":1340582400,"y":297},{"x":1340755200,"y":299},{"x":1341100800,"y":300},{"x":1343001600,"y":362},{"x":1343088000,"y":365},{"x":1343174400,"y":366},{"x":1343260800,"y":367},{"x":1343520000,"y":368},{"x":1343692800,"y":370},{"x":1343779200,"y":371},{"x":1343865600,"y":375},{"x":1344038400,"y":384},{"x":1344211200,"y":386},{"x":1344297600,"y":392},{"x":1344470400,"y":396},{"x":1344556800,"y":402},{"x":1344816000,"y":407},{"x":1344902400,"y":408},{"x":1344988800,"y":410},{"x":1345075200,"y":414},{"x":1345161600,"y":416},{"x":1345680000,"y":440},{"x":1345766400,"y":444},{"x":1346025600,"y":449},{"x":1346112000,"y":454},{"x":1346284800,"y":464},{"x":1346371200,"y":466},{"x":1346544000,"y":467},{"x":1346630400,"y":470},{"x":1346716800,"y":476},{"x":1346803200,"y":478},{"x":1346889600,"y":484},{"x":1346976000,"y":490},{"x":1347062400,"y":495},{"x":1347235200,"y":497},{"x":1347321600,"y":499},{"x":1347408000,"y":505},{"x":1347494400,"y":507},{"x":1347580800,"y":509},{"x":1347840000,"y":514},{"x":1348012800,"y":515},{"x":1348099200,"y":517},{"x":1348185600,"y":518},{"x":1348272000,"y":520},{"x":1348531200,"y":524},{"x":1348617600,"y":525},{"x":1348704000,"y":529},{"x":1348790400,"y":535},{"x":1348876800,"y":540},{"x":1349049600,"y":541},{"x":1349136000,"y":545},{"x":1349222400,"y":557},{"x":1349308800,"y":559},{"x":1349481600,"y":562},{"x":1349568000,"y":564},{"x":1349654400,"y":566},{"x":1349740800,"y":571},{"x":1349827200,"y":572},{"x":1349913600,"y":575},{"x":1350000000,"y":579},{"x":1350086400,"y":583},{"x":1350172800,"y":584},{"x":1350259200,"y":587},{"x":1350864000,"y":604},{"x":1350950400,"y":614},{"x":1351036800,"y":619},{"x":1351296000,"y":626},{"x":1351382400,"y":628},{"x":1351468800,"y":631},{"x":1351555200,"y":635},{"x":1351641600,"y":642},{"x":1351814400,"y":644},{"x":1352073600,"y":652},{"x":1352160000,"y":656},{"x":1352246400,"y":659},{"x":1352505600,"y":660},{"x":1352592000,"y":661},{"x":1352678400,"y":669},{"x":1352764800,"y":676},{"x":1352851200,"y":678},{"x":1352937600,"y":683},{"x":1353024000,"y":684},{"x":1353110400,"y":685},{"x":1353283200,"y":689},{"x":1353369600,"y":691},{"x":1353456000,"y":695},{"x":1353542400,"y":698},{"x":1353715200,"y":706},{"x":1353888000,"y":707},{"x":1353974400,"y":711},{"x":1354147200,"y":721},{"x":1354320000,"y":723},{"x":1354406400,"y":725},{"x":1354492800,"y":731},{"x":1354579200,"y":732},{"x":1354665600,"y":734},{"x":1355184000,"y":751},{"x":1355270400,"y":755},{"x":1355356800,"y":756},{"x":1355529600,"y":777},{"x":1355616000,"y":778},{"x":1355702400,"y":783},{"x":1356566400,"y":826},{"x":1356652800,"y":827},{"x":1356998400,"y":842},{"x":1357084800,"y":845},{"x":1357171200,"y":849},{"x":1357257600,"y":857},{"x":1357430400,"y":861},{"x":1357516800,"y":869},{"x":1357603200,"y":875},{"x":1357689600,"y":885},{"x":1357776000,"y":892},{"x":1357862400,"y":894},{"x":1357948800,"y":897},{"x":1358035200,"y":901},{"x":1358121600,"y":905},{"x":1358208000,"y":915},{"x":1358294400,"y":918},{"x":1358380800,"y":926},{"x":1358467200,"y":931},{"x":1358553600,"y":936},{"x":1358640000,"y":939},{"x":1358726400,"y":945},{"x":1358812800,"y":951},{"x":1359072000,"y":975},{"x":1359158400,"y":984},{"x":1359244800,"y":987},{"x":1359331200,"y":989},{"x":1359417600,"y":994},{"x":1359504000,"y":1002},{"x":1359590400,"y":1012},{"x":1359676800,"y":1016},{"x":1359849600,"y":1031},{"x":1360281600,"y":1055},{"x":1360368000,"y":1057},{"x":1360540800,"y":1066},{"x":1360627200,"y":1070},{"x":1360972800,"y":1097},{"x":1361059200,"y":1101},{"x":1361145600,"y":1102},{"x":1361232000,"y":1106},{"x":1361318400,"y":1111},{"x":1361404800,"y":1117},{"x":1361491200,"y":1122},{"x":1361836800,"y":1135},{"x":1363046400,"y":1202},{"x":1363132800,"y":1211},{"x":1363219200,"y":1216},{"x":1363305600,"y":1219},{"x":1363392000,"y":1225},{"x":1363478400,"y":1226},{"x":1363564800,"y":1228},{"x":1363651200,"y":1236},{"x":1363737600,"y":1241},{"x":1363824000,"y":1246},{"x":1363910400,"y":1252},{"x":1363996800,"y":1256},{"x":1364169600,"y":1263},{"x":1364601600,"y":1289},{"x":1364860800,"y":1309}]
{"total_count":1365,"count_by_date":[{"x":1315353600,"y":0},{"x":1315440000,"y":2},{"x":1315699200,"y":3},{"x":1315785600,"y":4},{"x":1316304000,"y":8},{"x":1316390400,"y":10},{"x":1316476800,"y":11},{"x":1316563200,"y":13},{"x":1316736000,"y":14},{"x":1316908800,"y":16},{"x":1317081600,"y":17},{"x":1317513600,"y":20},{"x":1317859200,"y":21},{"x":1319068800,"y":22},{"x":1320105600,"y":23},{"x":1320883200,"y":26},{"x":1321142400,"y":28},{"x":1321315200,"y":32},{"x":1321401600,"y":34},{"x":1321660800,"y":36},{"x":1321747200,"y":39},{"x":1321833600,"y":42},{"x":1321920000,"y":45},{"x":1322006400,"y":46},{"x":1322265600,"y":47},{"x":1322352000,"y":48},{"x":1323216000,"y":49},{"x":1323302400,"y":50},{"x":1323734400,"y":51},{"x":1323820800,"y":52},{"x":1323907200,"y":53},{"x":1324166400,"y":55},{"x":1324598400,"y":56},{"x":1325116800,"y":57},{"x":1325203200,"y":58},{"x":1325376000,"y":59},{"x":1325635200,"y":60},{"x":1326067200,"y":63},{"x":1326153600,"y":64},{"x":1327449600,"y":65},{"x":1327622400,"y":66},{"x":1327795200,"y":67},{"x":1327881600,"y":71},{"x":1327968000,"y":72},{"x":1328054400,"y":73},{"x":1328227200,"y":74},{"x":1328572800,"y":77},{"x":1328659200,"y":80},{"x":1328745600,"y":81},{"x":1328832000,"y":82},{"x":1329696000,"y":83},{"x":1329955200,"y":84},{"x":1330041600,"y":85},{"x":1330214400,"y":96},{"x":1330300800,"y":99},{"x":1330387200,"y":100},{"x":1330646400,"y":107},{"x":1330732800,"y":108},{"x":1330819200,"y":111},{"x":1331078400,"y":112},{"x":1331251200,"y":113},{"x":1331337600,"y":114},{"x":1331424000,"y":115},{"x":1331510400,"y":118},{"x":1331683200,"y":121},{"x":1331769600,"y":122},{"x":1331856000,"y":123},{"x":1332115200,"y":124},{"x":1332374400,"y":125},{"x":1332547200,"y":126},{"x":1332633600,"y":128},{"x":1332720000,"y":129},{"x":1332892800,"y":131},{"x":1333065600,"y":134},{"x":1333152000,"y":135},{"x":1333238400,"y":136},{"x":1333324800,"y":137},{"x":1333411200,"y":138},{"x":1333497600,"y":139},{"x":1333584000,"y":142},{"x":1333670400,"y":152},{"x":1333756800,"y":156},{"x":1334016000,"y":157},{"x":1334188800,"y":158},{"x":1334275200,"y":159},{"x":1334448000,"y":161},{"x":1334534400,"y":169},{"x":1334620800,"y":177},{"x":1334707200,"y":183},{"x":1334793600,"y":186},{"x":1334880000,"y":187},{"x":1334966400,"y":188},{"x":1335398400,"y":189},{"x":1336608000,"y":190},{"x":1337817600,"y":256},{"x":1338249600,"y":260},{"x":1338336000,"y":261},{"x":1339027200,"y":278},{"x":1339545600,"y":284},{"x":1339718400,"y":285},{"x":1340064000,"y":286},{"x":1340582400,"y":297},{"x":1340755200,"y":299},{"x":1341100800,"y":300},{"x":1343001600,"y":362},{"x":1343088000,"y":365},{"x":1343174400,"y":366},{"x":1343260800,"y":367},{"x":1343520000,"y":368},{"x":1343692800,"y":370},{"x":1343779200,"y":371},{"x":1343865600,"y":375},{"x":1344038400,"y":384},{"x":1344211200,"y":386},{"x":1344297600,"y":392},{"x":1344470400,"y":396},{"x":1344556800,"y":402},{"x":1344816000,"y":407},{"x":1344902400,"y":408},{"x":1344988800,"y":410},{"x":1345075200,"y":414},{"x":1345161600,"y":416},{"x":1345680000,"y":440},{"x":1345766400,"y":444},{"x":1346025600,"y":449},{"x":1346112000,"y":454},{"x":1346284800,"y":464},{"x":1346371200,"y":466},{"x":1346544000,"y":467},{"x":1346630400,"y":470},{"x":1346716800,"y":476},{"x":1346803200,"y":478},{"x":1346889600,"y":484},{"x":1346976000,"y":490},{"x":1347062400,"y":495},{"x":1347235200,"y":497},{"x":1347321600,"y":499},{"x":1347408000,"y":505},{"x":1347494400,"y":507},{"x":1347580800,"y":509},{"x":1347840000,"y":514},{"x":1348012800,"y":515},{"x":1348099200,"y":517},{"x":1348185600,"y":518},{"x":1348272000,"y":520},{"x":1348531200,"y":524},{"x":1348617600,"y":525},{"x":1348704000,"y":528},{"x":1348790400,"y":534},{"x":1348876800,"y":539},{"x":1349049600,"y":540},{"x":1349136000,"y":544},{"x":1349222400,"y":556},{"x":1349308800,"y":558},{"x":1349481600,"y":561},{"x":1349568000,"y":563},{"x":1349654400,"y":565},{"x":1349740800,"y":570},{"x":1349827200,"y":571},{"x":1349913600,"y":574},{"x":1350000000,"y":578},{"x":1350086400,"y":582},{"x":1350172800,"y":583},{"x":1350259200,"y":586},{"x":1350864000,"y":603},{"x":1350950400,"y":613},{"x":1351036800,"y":618},{"x":1351296000,"y":625},{"x":1351382400,"y":627},{"x":1351468800,"y":630},{"x":1351555200,"y":634},{"x":1351641600,"y":641},{"x":1351814400,"y":643},{"x":1352073600,"y":651},{"x":1352160000,"y":655},{"x":1352246400,"y":658},{"x":1352505600,"y":659},{"x":1352592000,"y":660},{"x":1352678400,"y":668},{"x":1352764800,"y":675},{"x":1352851200,"y":677},{"x":1352937600,"y":682},{"x":1353024000,"y":683},{"x":1353110400,"y":684},{"x":1353283200,"y":688},{"x":1353369600,"y":690},{"x":1353456000,"y":694},{"x":1353542400,"y":697},{"x":1353715200,"y":705},{"x":1353888000,"y":706},{"x":1353974400,"y":710},{"x":1354147200,"y":720},{"x":1354320000,"y":722},{"x":1354406400,"y":724},{"x":1354492800,"y":730},{"x":1354579200,"y":731},{"x":1354665600,"y":733},{"x":1355184000,"y":750},{"x":1355270400,"y":754},{"x":1355356800,"y":755},{"x":1355529600,"y":776},{"x":1355616000,"y":777},{"x":1355702400,"y":782},{"x":1356566400,"y":825},{"x":1356652800,"y":826},{"x":1356998400,"y":841},{"x":1357084800,"y":844},{"x":1357171200,"y":848},{"x":1357257600,"y":856},{"x":1357430400,"y":860},{"x":1357516800,"y":868},{"x":1357603200,"y":874},{"x":1357689600,"y":884},{"x":1357776000,"y":891},{"x":1357862400,"y":893},{"x":1357948800,"y":896},{"x":1358035200,"y":900},{"x":1358121600,"y":904},{"x":1358208000,"y":914},{"x":1358294400,"y":917},{"x":1358380800,"y":925},{"x":1358467200,"y":930},{"x":1358553600,"y":935},{"x":1358640000,"y":938},{"x":1358726400,"y":944},{"x":1358812800,"y":950},{"x":1359072000,"y":974},{"x":1359158400,"y":983},{"x":1359244800,"y":986},{"x":1359331200,"y":988},{"x":1359417600,"y":993},{"x":1359504000,"y":1001},{"x":1359590400,"y":1011},{"x":1359676800,"y":1015},{"x":1359849600,"y":1030},{"x":1360281600,"y":1054},{"x":1360368000,"y":1056},{"x":1360540800,"y":1065},{"x":1360627200,"y":1069},{"x":1360972800,"y":1096},{"x":1361059200,"y":1100},{"x":1361145600,"y":1101},{"x":1361232000,"y":1105},{"x":1361318400,"y":1110},{"x":1361404800,"y":1116},{"x":1361491200,"y":1121},{"x":1361836800,"y":1134},{"x":1363046400,"y":1201},{"x":1363132800,"y":1210},{"x":1363219200,"y":1215},{"x":1363305600,"y":1218},{"x":1363392000,"y":1224},{"x":1363478400,"y":1225},{"x":1363564800,"y":1227},{"x":1363651200,"y":1235},{"x":1363737600,"y":1240},{"x":1363824000,"y":1245},{"x":1363910400,"y":1251},{"x":1363996800,"y":1255},{"x":1364169600,"y":1262},{"x":1364601600,"y":1288},{"x":1364860800,"y":1308},{"x":1364947200,"y":1311},{"x":1365033600,"y":1318},{"x":1365120000,"y":1319},{"x":1365552000,"y":1351},{"x":1365638400,"y":1363},{"x":1365724800,"y":1365}]}

0 comments on commit 4d39342

Please sign in to comment.