Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update template URL for contributor's commit list for gitlab (dynamically adjusting for correct branch) #129

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/bin/cores.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 6 additions & 1 deletion app/bin/json.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
contributors = Hash.new(0)
commits = Array.new
reverts = Array.new
head = ''
head_regexp = Regexp.new '^origin/HEAD set to (?<head>[0-9]+\.[0-9]+\.x)'
issue_regexp = Regexp.new '#[0-9]+'
reverts_regexp = Regexp.new '^Revert \"(?<credits>.+#[0-9]+.* by [^:]+:).*'
reverts_regexp_loose = Regexp.new '^Revert .*(?<issue>#[0-9]+).*'
Expand All @@ -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
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion app/templates/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<td><%= (lastMentions == mentions) ? lastOrder : i %></td>
<td><% if !notSpecified %><a href="https://www.drupal.org/u/<%= name.downcase.gsub ' ', '-' %>"><%= name %></a><% else %><%= name %><% end %>
</td>
<td><% if !notSpecified %><a href="http://cgit.drupalcode.org/drupal/log/?qt=grep&q=<%= name.gsub ' ', '+' %>"><%= mentions %></a><% else %><%= mentions %><% end %></td>
<td><% if !notSpecified %><a href="https://git.drupalcode.org/project/drupal/commits/<%= head %>?utf8=✓&search=<%= name.gsub ' ', '+' %>"><%= mentions %></a><% else %><%= mentions %><% end %></td>
<td><%= ((mentions/sum)*100).round(4) %>%</td>
<% if lastMentions != mentions %>
<% lastOrder = i %>
Expand Down
2 changes: 1 addition & 1 deletion test/data.json
Original file line number Diff line number Diff line change
@@ -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"}