Class: Hubba::ReportCatalog
- Defined in:
- lib/hubba/reports/reports/catalog.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 34 35 36 37 38 39 40 41 |
# File 'lib/hubba/reports/reports/catalog.rb', line 6 def build ## note: orgs is orgs+users e.g. geraldb, yorobot etc buf = String.new('') buf << "# Catalog" buf << " - #{@stats.repos.size} Repos @ #{@stats.orgs.size} Orgs" buf << "\n\n" @stats.orgs.each do |org| name = org[0] repos = org[1] buf << "### #{name} _(#{repos.size})_\n" buf << "\n" ### add stats for repos repos.each do |repo| buf << "**#{repo.name}** ★#{repo.stats.stars} (#{repo.stats.size} kb)" buf << " <br>\n" buf << "_#{repo.stats.description}_" if repo.stats.topics && repo.stats.topics.size > 0 buf << " <br>\n" ## wrap in backtip (verbatim code) buf << repo.stats.topics.map {|topic| "`#{topic}`" }.join( ' · ' ) ## use interpunct? - was: • (bullet) end buf << "\n\n" end buf << "\n" end buf end |