terminal-table 4.0.0 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +1 -1
- data/History.rdoc +8 -0
- data/README.md +6 -0
- data/lib/terminal-table/cell.rb +1 -1
- data/lib/terminal-table/style.rb +8 -0
- data/lib/terminal-table/table.rb +3 -1
- data/lib/terminal-table/util.rb +2 -1
- data/lib/terminal-table/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 23b2fe8f55fdd00991734825bacbd04e7f395bfa5e2b61a31b666ccaa1c20560
|
|
4
|
+
data.tar.gz: efae59fa00957cd275e6b4a40080cc67c5cb8e1e0b833bb18792d1446d71da72
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b81e47bb78032cee966b1c13f7bd9db291056ce71089302c757ff47be66dcd2ca17c73da4e3924ed2b0a450ae6c5e7b90a88ba71bc3d4ba27e684d9198b114ce
|
|
7
|
+
data.tar.gz: d30603ac110f6d9245ed43123284904568387cdd4917adc5c037d95198894192cc73dbb030a120d375a763a4b1d2896acba908e6a9c5c5f4d7ddca5d225a4048
|
data/.github/workflows/ci.yml
CHANGED
data/History.rdoc
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
4.1.0 / 2026-12-01
|
|
2
|
+
==================
|
|
3
|
+
|
|
4
|
+
- Add `border: :none` style to render a table without any borders.
|
|
5
|
+
- Apply margin_left to every line of multiline cells.
|
|
6
|
+
- Ignore OSC 8 hyperlinks when calculating cell width.
|
|
7
|
+
- Split a cell's value into lines only once.
|
|
8
|
+
|
|
1
9
|
4.0.0 / 2025-01-28
|
|
2
10
|
==================
|
|
3
11
|
|
data/README.md
CHANGED
|
@@ -320,6 +320,12 @@ Ascii borders are default, but can be explicitly set with:
|
|
|
320
320
|
table.style = { :border => :ascii }
|
|
321
321
|
```
|
|
322
322
|
|
|
323
|
+
### No Borders
|
|
324
|
+
To remove all borders and separators:
|
|
325
|
+
```
|
|
326
|
+
table.style = { :border => :none }
|
|
327
|
+
```
|
|
328
|
+
|
|
323
329
|
### Customizing Borders
|
|
324
330
|
Inside the `UnicodeBorder` class, there are definitions for a variety of corner/intersection and divider types.
|
|
325
331
|
|
data/lib/terminal-table/cell.rb
CHANGED
data/lib/terminal-table/style.rb
CHANGED
|
@@ -68,6 +68,14 @@ module Terminal
|
|
|
68
68
|
end
|
|
69
69
|
end
|
|
70
70
|
|
|
71
|
+
class NoneBorder < AsciiBorder
|
|
72
|
+
def initialize
|
|
73
|
+
super
|
|
74
|
+
@top, @bottom, @left, @right = false, false, false, false
|
|
75
|
+
@data = { x: "", y: "", i: "" }
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
|
|
71
79
|
class UnicodeBorder < Border
|
|
72
80
|
|
|
73
81
|
ALLOWED_SEPARATOR_BORDER_STYLES = %i[
|
data/lib/terminal-table/table.rb
CHANGED
|
@@ -170,7 +170,9 @@ module Terminal
|
|
|
170
170
|
|
|
171
171
|
def render
|
|
172
172
|
elaborate_rows unless @elaborated
|
|
173
|
-
|
|
173
|
+
rows = @rows
|
|
174
|
+
rows = rows.reject { |r| r.is_a?(Separator) && r.implicit } if style.border.is_a?(NoneBorder)
|
|
175
|
+
rows.map { |r| style.margin_left + r.render.rstrip.gsub(/[ \t]*\n/) { "\n" + style.margin_left } }.join("\n")
|
|
174
176
|
end
|
|
175
177
|
alias :to_s :render
|
|
176
178
|
|
data/lib/terminal-table/util.rb
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
module Terminal
|
|
2
2
|
class Table
|
|
3
3
|
module Util
|
|
4
|
-
# removes all ANSI escape sequences (e.g. color)
|
|
4
|
+
# removes all ANSI escape sequences (e.g. color, OSC 8 hyperlinks)
|
|
5
5
|
def ansi_escape(line)
|
|
6
6
|
line.to_s.gsub(/\x1b(\[|\(|\))[;?0-9]*[0-9A-Za-z]/, '').
|
|
7
7
|
gsub(/\x1b(\[|\(|\))[;?0-9]*[0-9A-Za-z]/, '').
|
|
8
|
+
gsub(/\x1b\]8;[^\x07\x1b]*(?:\x07|\x1b\\)/, '').
|
|
8
9
|
gsub(/(\x03|\x1a)/, '')
|
|
9
10
|
end
|
|
10
11
|
module_function :ansi_escape
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: terminal-table
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.
|
|
4
|
+
version: 4.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- TJ Holowaychuk
|
|
8
8
|
- Scott J. Goldman
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
140
140
|
- !ruby/object:Gem::Version
|
|
141
141
|
version: '0'
|
|
142
142
|
requirements: []
|
|
143
|
-
rubygems_version:
|
|
143
|
+
rubygems_version: 4.0.20
|
|
144
144
|
specification_version: 4
|
|
145
145
|
summary: Simple, feature rich ascii table generation library
|
|
146
146
|
test_files: []
|