text-ui 0.2.0 → 0.2.1
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/lib/tui/tools.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7a62ea868dbf5ef06916ce3c183fe44025f57b95a13153a7d4c775de44d04dc6
|
|
4
|
+
data.tar.gz: 8728f0a571a4040715ae3d85d668a361b4aed83ad4b71d3b1461445dc129a156
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3c92a845ae18264cdeb4d9eb803e5c9325ebbce9547f3e8e035e4631fe8a9379208e677e3a22795df8ffcce5202fc675040edf49ce21db87b4db2f609e28901e
|
|
7
|
+
data.tar.gz: f645c58e9c4cfecf76aa45652f1c7f2198b1413dea7b34560f68e014e854182d9b96f071fa2fbc42247f1f23665a9eb1da9a6880b408cdfec1fa59b665a7a0dc
|
data/lib/tui/tools.rb
CHANGED
|
@@ -8,8 +8,8 @@ module Tui::Tools
|
|
|
8
8
|
# but sometimes it needs re-calculating it from scratch
|
|
9
9
|
def self.calc_width value
|
|
10
10
|
case value
|
|
11
|
-
when Array then
|
|
12
|
-
when String then Unicode::DisplayWidth.of(
|
|
11
|
+
when Array then value.collect { |row| Unicode::DisplayWidth.of(row) }.max
|
|
12
|
+
when String then Unicode::DisplayWidth.of(value)
|
|
13
13
|
end
|
|
14
14
|
end
|
|
15
15
|
end
|