Class: Hubba::ReportStars

Inherits:
Report
  • Object
show all
Defined in:
lib/hubba/reports.rb

Instance Method Summary collapse

Methods inherited from Report

#initialize, #save

Constructor Details

This class inherits a constructor from Hubba::Report

Instance Method Details

#buildObject



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/hubba/reports.rb', line 68

def build

##  add stars, last_updates, etc.
##  org description etc??

## note: orgs is orgs+users e.g. geraldb, yorobot etc
buf = String.new('')
buf << "# #{@stats.repos.size} repos @ #{@stats.orgs.size} orgs\n"
buf << "\n"


repos = @stats.repos.sort do |l,r|
  ## note: use reverse sort (right,left) - e.g. most stars first
  r.stats.stars <=> l.stats.stars
end

## pp repos

repos.each_with_index do |repo,i|
  buf << "#{i+1}. ★#{repo.stats.stars} **#{repo.full_name}** (#{repo.stats.size} kb)\n"
end

buf
end