Merge 3.0.2 - #1
Draft
frdrkolsson wants to merge 38 commits into
Draft
Conversation
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.
…n tweaking of the Separator border_type.
… the examples dir and README
- add badge for gem version (including a link to rubygems, more convenient) - fix CI badge to be pure markdown
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 |
+-----------------+-----+
frdrkolsson
force-pushed
the
merge-3.0.2
branch
from
January 22, 2024 09:49
4b7675b to
a8232dd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merge 3.0.2 from https://github.com/tj/terminal-table/tree/master
For KL PR tbd