diff --git a/app/bin/cores.rb b/app/bin/cores.rb index bc941d0bb6..20c0deb4c8 100755 --- a/app/bin/cores.rb +++ b/app/bin/cores.rb @@ -13,6 +13,7 @@ file = file = File.read('../../tmp/data.json') data = JSON.parse(file) contributors = data['contributors'] +head = data['head'] sum = contributors.values.reduce(:+).to_f puts ERB.new(DATA.readlines.join, 0, '>').result diff --git a/app/bin/json.rb b/app/bin/json.rb index bbf82a7b9c..f7786d9bd3 100755 --- a/app/bin/json.rb +++ b/app/bin/json.rb @@ -19,6 +19,8 @@ contributors = Hash.new(0) commits = Array.new reverts = Array.new +head = '' +head_regexp = Regexp.new '^origin/HEAD set to (?[0-9]+\.[0-9]+\.x)' issue_regexp = Regexp.new '#[0-9]+' reverts_regexp = Regexp.new '^Revert \"(?.+#[0-9]+.* by [^:]+:).*' reverts_regexp_loose = Regexp.new '^Revert .*(?#[0-9]+).*' @@ -28,6 +30,8 @@ reverts.push(c[reverts_regexp, "credits"]) elsif c =~ reverts_regexp_loose then reverts.push(c[reverts_regexp_loose, "issue"]) + elsif c =~ head_regexp then + head = c[head_regexp, "head"] else commits.push(c) end @@ -66,7 +70,8 @@ :twoTen => contributors.select {|k,v| (v > 1 && v < 11) }.length, :TenOver => contributors.select {|k,v| v > 10}.length }, - :contributors => contributors + :contributors => contributors, + :head => head } puts output.to_json diff --git a/app/templates/index.html.erb b/app/templates/index.html.erb index 06dade7dbd..0d99cb3303 100644 --- a/app/templates/index.html.erb +++ b/app/templates/index.html.erb @@ -29,7 +29,7 @@ <%= (lastMentions == mentions) ? lastOrder : i %> <% if !notSpecified %><%= name %><% else %><%= name %><% end %> - <% if !notSpecified %><%= mentions %><% else %><%= mentions %><% end %> + <% if !notSpecified %><%= mentions %><% else %><%= mentions %><% end %> <%= ((mentions/sum)*100).round(4) %>% <% if lastMentions != mentions %> <% lastOrder = i %> diff --git a/test/data.json b/test/data.json index 2f367edca4..80475fdcab 100644 --- a/test/data.json +++ b/test/data.json @@ -1 +1 @@ -{"date":"2015-11-12 10:54:12 +0000","count":3302,"graph":{"one":1555,"twoTen":1314,"TenOver":433},"contributors":{"dawehner":1589,"tim.plunkett":1213,"alexpott":814,"berdir":804,"wim leers":762,"sun":705,"damiankloip":633,"xjm":548,"gábor hojtsy":502,"chx":437,"larowlan":437,"andypost":426,"jhodgdon":401,"amateescu":384,"joelpittet":360,"yched":353,"effulgentsia":351,"yesct":346,"cottser":340,"swentel":337,"nod_":323,"vijaycs85":300,"pwolanin":287,"aspilicious":252,"tstoeckler":239,"xano":231,"lewisnyman":225,"plach":225,"catch":224,"jibran":222,"lauriii":214,"droplet":206,"hussainweb":194,"parisliakos":191,"david_rothstein":186,"cilefen":180,"benjy":168,"fago":163,"mgifford":160,"phenaproxima":159,"neclimdul":157,"jessebeach":155,"crell":154,"robloach":154,"internetdevels":147,"rpayanm":144,"martin107":143,"stefan.r":141,"jhedstrom":137,"penyaskito":135,"fabianx":135,"mile23":132,"olli":127,"joshi.rohit100":126,"znerol":124,"rteijeiro":122,"bojhan":122,"er.pushpinderrana":122,"klausi":114,"longwave":113,"jeroent":109,"kim.pepper":108,"mikeryan":108,"davidhernandez":106,"webflo":104,"pfrenssen":103,"pcambra":101,"webchick":101,"jenlampton":101,"kgoel":98,"emma.maria":96,"disasm":96,"sutharsan":89,"marcingy":88,"albert volkman":87,"beejeebus":86,"cosmicdreams":86,"dave reid":78,"plopesc":77,"lokapujya":76,"ianthomas_uk":76,"idebr":76,"damien tournoud":76,"amitgoyal":76,"claudiu.cristea":75,"mortendk":75,"msonnabaum":74,"herom":74,"linclark":71,"mr.baileys":70,"attiks":70,"mrsinguyen":69,"ifrik":69,"niklas fiekas":68,"scor":67,"joachim":67,"mpdonadio":66,"lars toomre":65,"batigolix":64,"pillarsdotnet":63,"eclipsegc":62,"borisson_":61,"acf":61,"mdrummond":61,"heddn":55,"fubhy":55,"duaelfr":54,"heyrocker":54,"linl":54,"thedavidmeister":53,"geertvd":51,"manjit.singh":51,"pjonckiere":50,"quicksketch":49,"daffie":49,"mradcliffe":49,"slashrsm":48,"bfroehle":48,"chertzog":48,"shanethehat":48,"legolasbo":47,"yoroy":47,"nlisgo":47,"eiriksm":47,"googletorp":47,"steveoliver":46,"tr":46,"devin carlson":46,"mondrake":46,"katbailey":45,"jelle_s":45,"schnitzel":45,"mtift":45,"akalata":45,"tadityar":44,"manuel garcia":44,"clemens.tolboom":44,"c4rl":44,"bojanz":44,"ultimike":43,"nick_schuch":43,"mparker17":43,"das_peter":42,"bzrudi71":42,"quietone":42,"traviscarden":41,"pancho":41,"cs_shadow":40,"oriol_e9g":40,"fgm":39,"echoz":37,"dan reinders":37,"moshe weitzman":37,"johnalbin":37}} +{"date":"2015-11-12 10:54:12 +0000","count":3302,"graph":{"one":1555,"twoTen":1314,"TenOver":433},"contributors":{"dawehner":1589,"tim.plunkett":1213,"alexpott":814,"berdir":804,"wim leers":762,"sun":705,"damiankloip":633,"xjm":548,"gábor hojtsy":502,"chx":437,"larowlan":437,"andypost":426,"jhodgdon":401,"amateescu":384,"joelpittet":360,"yched":353,"effulgentsia":351,"yesct":346,"cottser":340,"swentel":337,"nod_":323,"vijaycs85":300,"pwolanin":287,"aspilicious":252,"tstoeckler":239,"xano":231,"lewisnyman":225,"plach":225,"catch":224,"jibran":222,"lauriii":214,"droplet":206,"hussainweb":194,"parisliakos":191,"david_rothstein":186,"cilefen":180,"benjy":168,"fago":163,"mgifford":160,"phenaproxima":159,"neclimdul":157,"jessebeach":155,"crell":154,"robloach":154,"internetdevels":147,"rpayanm":144,"martin107":143,"stefan.r":141,"jhedstrom":137,"penyaskito":135,"fabianx":135,"mile23":132,"olli":127,"joshi.rohit100":126,"znerol":124,"rteijeiro":122,"bojhan":122,"er.pushpinderrana":122,"klausi":114,"longwave":113,"jeroent":109,"kim.pepper":108,"mikeryan":108,"davidhernandez":106,"webflo":104,"pfrenssen":103,"pcambra":101,"webchick":101,"jenlampton":101,"kgoel":98,"emma.maria":96,"disasm":96,"sutharsan":89,"marcingy":88,"albert volkman":87,"beejeebus":86,"cosmicdreams":86,"dave reid":78,"plopesc":77,"lokapujya":76,"ianthomas_uk":76,"idebr":76,"damien tournoud":76,"amitgoyal":76,"claudiu.cristea":75,"mortendk":75,"msonnabaum":74,"herom":74,"linclark":71,"mr.baileys":70,"attiks":70,"mrsinguyen":69,"ifrik":69,"niklas fiekas":68,"scor":67,"joachim":67,"mpdonadio":66,"lars toomre":65,"batigolix":64,"pillarsdotnet":63,"eclipsegc":62,"borisson_":61,"acf":61,"mdrummond":61,"heddn":55,"fubhy":55,"duaelfr":54,"heyrocker":54,"linl":54,"thedavidmeister":53,"geertvd":51,"manjit.singh":51,"pjonckiere":50,"quicksketch":49,"daffie":49,"mradcliffe":49,"slashrsm":48,"bfroehle":48,"chertzog":48,"shanethehat":48,"legolasbo":47,"yoroy":47,"nlisgo":47,"eiriksm":47,"googletorp":47,"steveoliver":46,"tr":46,"devin carlson":46,"mondrake":46,"katbailey":45,"jelle_s":45,"schnitzel":45,"mtift":45,"akalata":45,"tadityar":44,"manuel garcia":44,"clemens.tolboom":44,"c4rl":44,"bojanz":44,"ultimike":43,"nick_schuch":43,"mparker17":43,"das_peter":42,"bzrudi71":42,"quietone":42,"traviscarden":41,"pancho":41,"cs_shadow":40,"oriol_e9g":40,"fgm":39,"echoz":37,"dan reinders":37,"moshe weitzman":37,"johnalbin":37},"head":"8.1.x"}