Skip to content

Commit a0ac147

Browse files
author
Visnu Pitiyanuvath
committed
Revert "script/winners -> markdown"
This reverts commit 3311dec.
1 parent e54df93 commit a0ac147

File tree

1 file changed

+20
-21
lines changed

1 file changed

+20
-21
lines changed

script/winners

+20-21
Original file line numberDiff line numberDiff line change
@@ -13,58 +13,57 @@ db = Mongo::Connection.new.db "nodeknockout"
1313
@winners = {}
1414

1515
def green s
16-
"<b>#{s}</b>"
16+
puts "\033[32m#{s}\033[0m"
1717
end
1818

1919
def red s
20-
"<del>#{s}</del>"
20+
puts "\033[31m#{s}\033[0m"
2121
end
2222

2323
def output t, dimension, score
2424
out = @winners.values.include?(t)
25-
s = "[#{t['application']}](#{t['url']}) by [#{t['name']}](http://nodeknockout.com/teams/#{t['slug']}) - #{sprintf('%.2f', score)}"
26-
s = if !@winners[dimension] && !out
27-
@winners[dimension] = t
28-
green s
29-
elsif out
30-
red s
31-
else
32-
s
33-
end
34-
puts "1. #{s}"
25+
s = " #{t['application']} by #{t['name']} - #{score}"
26+
if !@winners[dimension] && !out
27+
@winners[dimension] = t
28+
green s
29+
elsif out
30+
red s
31+
else
32+
puts s
33+
end
3534
end
3635

37-
puts "\n\#\#\# Overall"
36+
puts "\nOVERALL"
3837
@db_teams.find({ :validDeploy => true }, { :sort => [['score.overall', -1]], :limit => 5}).each do |t|
39-
output t, 'overall', t['score']['overall'] / 5
38+
output t, 'overall', t['score']['overall']
4039
end
4140

42-
puts "\n\#\#\# Solo"
41+
puts "\nSOLO"
4342
@db_teams.find({ :validDeploy => true, :members => {'$size' => 1} }, { :sort => [['score.overall', -1]], :limit => 5}).each do |t|
44-
output t, 'solo', t['score']['overall'] / 5
43+
output t, 'solo', t['score']['overall']
4544
end
4645

47-
puts "\n\#\#\# Utility"
46+
puts "\nUTILITY"
4847
@db_teams.find({ :validDeploy => true }, { :sort => [['score.final.utility', -1]], :limit => 5}).each do |t|
4948
output t, 'utility', t['score']['final']['utility']
5049
end
5150

52-
puts "\n\#\#\# Design"
51+
puts "\nDESIGN"
5352
@db_teams.find({ :validDeploy => true }, { :sort => [['score.final.design', -1]], :limit => 5}).each do |t|
5453
output t, 'design', t['score']['final']['design']
5554
end
5655

57-
puts "\n\#\#\# Innovation"
56+
puts "\nINNOVATION"
5857
@db_teams.find({ :validDeploy => true }, { :sort => [['score.final.innovation', -1]], :limit => 5}).each do |t|
5958
output t, 'innovation', t['score']['final']['innovation']
6059
end
6160

62-
puts "\n\#\#\# Completeness"
61+
puts "\nCOMPLETENESS"
6362
@db_teams.find({ :validDeploy => true }, { :sort => [['score.final.completeness', -1]], :limit => 5}).each do |t|
6463
output t, 'completeness', t['score']['final']['completeness']
6564
end
6665

67-
puts "\n\#\#\# Popularity"
66+
puts "\nPOPULARITY"
6867
@db_teams.find({ :validDeploy => true }, { :sort => [['score.final.popularity', -1]], :limit => 5}).each do |t|
6968
output t, 'popularity', t['score']['final']['popularity']
7069
end

0 commit comments

Comments
 (0)