Sha256: f2934c30604c9c9415932ca3d9e3d1fb119be95aa1371ff88b71f9e07e22bf65
Contents?: true
Size: 909 Bytes
Versions: 40
Compression:
Stored size: 909 Bytes
Contents
require 'tty-markdown' module Inferno module CLI class Suites def run ENV['NO_DB'] = 'true' require_relative '../../../inferno' Inferno::Application.start(:suites) suites = Inferno::Repositories::TestSuites.new.all suite_hash = suites.each_with_object({}) { |suite, hash| hash[suite.id] = suite.title } id_column_length = suite_hash.keys.map(&:length).max + 2 title_column_length = suite_hash.values.map(&:length).max + 1 output = '' output += "| #{'Title'.ljust(title_column_length)}| #{'ID'.ljust(id_column_length)}|\n" output += "|-#{'-' * title_column_length}|-#{'-' * id_column_length}|\n" suite_hash.each do |id, title| output += "| #{title.ljust(title_column_length)}| #{id.ljust(id_column_length)}|\n" end puts TTY::Markdown.parse(output) end end end end
Version data entries
40 entries across 40 versions & 1 rubygems