Module: Dri::Utils::Table
- Included in:
- Commands::Analyze::StackTraces, Commands::Fetch::Failures, Commands::Fetch::FeatureFlags, Commands::Fetch::Pipelines, Commands::Fetch::Triaged, Commands::Incidents
- Defined in:
- lib/dri/utils/table.rb
Instance Method Summary collapse
Instance Method Details
#print_table(headers, rows, alignments: [], **kwargs) ⇒ Object
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/dri/utils/table.rb', line 8 def print_table(headers, rows, alignments: [], **kwargs) if alignments.empty? (1..headers.size).each do alignments.push(:center) end end table = TTY::Table.new(headers, rows) puts table.render(:ascii, resize: true, multiline: true, alignments: alignments, **kwargs) end |