Skip to content

Merge 3.0.2 - #1

Draft
frdrkolsson wants to merge 38 commits into
masterfrom
merge-3.0.2
Draft

Merge 3.0.2#1
frdrkolsson wants to merge 38 commits into
masterfrom
merge-3.0.2

Conversation

@frdrkolsson

Copy link
Copy Markdown

greg-hellings and others added 30 commits January 22, 2024 10:31
These two files do not need execute permissions,
so the +x flag is removed
Ruby 1.9 is not present in Ubuntu 18.04 and soon ubuntu-latest will be 20.04.
changing documentation to markdown, adding in unicode explanation and examples;
creating additional tests;
…r and footer or other emphasized (strong) separators.

Removed class inheritance and logic for previous/next row and replaced with adding a non-default border_type into the table elaboration logic.

Also split the table elaboration (of implicit separators) from the rendering portion so that it can be intercepted in the case where a user would want to modify the elaborated separators.
- add badge for gem version (including a link to rubygems, more convenient)
- fix CI badge to be pure markdown
Dmitriy Voropaev and others added 8 commits January 22, 2024 10:47
I've noticed the problem for table containing nil values:

$stdout << Terminal::Table.new(headings: %w[xxx xxx]) do
  add_row [nil, 1]
  add_row [2, 3]
  add_row [4, 5]
  align_column 0, :right
end

doesn't change the alignment for the cell with 4:

+-----+-----+
| xxx | xxx |
+-----+-----+
|     | 1   |
|   2 | 3   |
| 4   | 5   |
+-----+-----+

The `align_method` internally uses `column` which without second
argument returns a list of non null values at specific column taking
colspan into account. But afterwards the value is ignored and cells are
fetched by index, which doesn't work well if there are cells with custom
colspan in the table:

$stdout << Terminal::Table.new(headings: %w[xxx] * 4) do
  add_row [1, 2, 3, 4]
  add_row [5, {:value => 6, :colspan => 2}, 7]
  add_row [{:value => 8, :colspan => 2}, 9, :a]
  add_row [{:value => :b, :colspan => 2}, {:value => :c, :colspan => 2}]
  add_row [{:value => :d, :colspan => 3}, :e]
  align_column 1, :right
end

prints:

+-----+-----+-----+-----+
| xxx | xxx | xxx | xxx |
+-----+-----+-----+-----+
| 1   |   2 | 3   | 4   |
| 5   |         6 | 7   |
| 8         |   9 | a   |
| b         |         c |
| d               |   e |
+-----------------+-----+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

10 participants