Class: Hubba::ReportStars
- Defined in:
- lib/hubba/reports/reports/stars.rb
Instance Method Summary collapse
Methods inherited from Report
Constructor Details
This class inherits a constructor from Hubba::Report
Instance Method Details
#build ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/hubba/reports/reports/stars.rb', line 6 def build ## add stars, last_updates, etc. ## org description etc?? ## note: orgs is orgs+users e.g. geraldb, yorobot etc buf = String.new('') buf << "# Stars" buf << " - #{@stats.repos.size} Repos @ #{@stats.orgs.size} Orgs" buf << "\n\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 << "<!-- break -->\n" ## markdown hack: add a list end marker buf << "\n\n" buf end |