comparison app/helpers/projects_helper.rb @ 1194:6676c0284df2 feature_564

Add "mature projects" box. This isn't good enough on its own, it's just a test -- we need this to inform other relationships
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Tue, 22 Jan 2013 17:03:50 +0000
parents 3c9ca27c2d3d
children 16826c3afbba
comparison
equal deleted inserted replaced
1193:d67ed1030451 1194:6676c0284df2
293 pp.each do |p| 293 pp.each do |p|
294 phash[p] = score_maturity p 294 phash[p] = score_maturity p
295 end 295 end
296 phash 296 phash
297 end 297 end
298
299 def mature_projects(count)
300 phash = all_maturity_scores
301 scores = phash.values.sort
302 threshold = scores[scores.length / 2]
303 if threshold == 0 then threshold = 1 end
304 phash.keys.select { |k| phash[k] > threshold }.sample(count)
305 end
298 end 306 end