Sha256: 525715bace2653ace2ccd9ad87fda16858b5ff6c964df57dc5a5154151c4e933
Contents?: true
Size: 620 Bytes
Versions: 27
Compression:
Stored size: 620 Bytes
Contents
class Lono::Pro class Repo < Base def run data = api.repos(@options[:type]) # data = data[7..9] header = ["Name", "Docs", "Description"] rows = data.map do |d| desc = truncate(d[:description]) [d[:name], d[:docs_url], desc] end show_table(header, rows) end private def truncate(string, max=36) string.length > max ? "#{string[0...max]}..." : string end def show_table(header, data) table = Text::Table.new table.head = header data.each do |item| table.rows << item end puts table end end end
Version data entries
27 entries across 27 versions & 1 rubygems