Skip to content

Passing non-String types to Lipgloss::Table in row data renders empty rows #9

@hlmartin

Description

@hlmartin

I would expect passing a number or a boolean (and potentially other types) as a row value would display those values (performing a .to_s on them implicitly if needed), or at the very least throw an error. Right now the table headers will render with an empty table body.

Minimal example:

require "lipgloss"

headers = ["a", "b", "c"]
rows = [["1", "2", "3"], ["4", "5", "6"], ["7", "8", 9]]
table = Lipgloss::Table.new.headers(headers).rows(rows)

puts table.render
$ ruby example.rb
╭─┬─┬─╮
│a│b│c│
├─┼─┼─┤
╰─┴─┴─╯

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions