toolbus 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/utils.rb +4 -0
- data/lib/views.rb +5 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06edf1245ee5e21a3eac3bc7ebcf8a906d794053
|
4
|
+
data.tar.gz: 36da9d2ac09607b41bb8ef45e6080612321b2ab7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f9f79ad3052b07d3e07405b8255da330fa1704a04cf5ad5c3d66055f9dab91cacaa83266934c15dc439be3bc640402fb2f26f0075cddd5c3b0d3bd446fa37a0
|
7
|
+
data.tar.gz: 4e97e3acd1446a404dfd5b8c97b3165a5763bc65188159b64d015178fb804950910c73bfd7c9dad04db58ca80d2fd53fb2f5b04d8382990a32690a43278b353b
|
data/lib/utils.rb
CHANGED
data/lib/views.rb
CHANGED
@@ -50,12 +50,14 @@ class TableView
|
|
50
50
|
@map = map
|
51
51
|
end
|
52
52
|
|
53
|
+
CHECKMARK_CHARS_OFFSET = 2
|
54
|
+
COUNT_CHARS_OFFSET = 5
|
53
55
|
def to_s
|
54
56
|
@map.map do |(key, count)|
|
55
57
|
color = count > 0 ? GREEN : RED
|
56
58
|
done = count > 0 ? "✓" : " "
|
57
|
-
description = key.
|
58
|
-
[color, done, ' ', description, count.to_s, RESET].join
|
59
|
+
description = key.at_width(SCREEN_WIDTH - COUNT_CHARS_OFFSET - CHECKMARK_CHARS_OFFSET)
|
60
|
+
[color, done, ' ', description, count.to_s.rjust(COUNT_CHARS_OFFSET), RESET].join
|
59
61
|
end
|
60
62
|
end
|
61
63
|
end
|
@@ -72,6 +74,6 @@ class StatusBoxView
|
|
72
74
|
puts
|
73
75
|
num_lines = @statuses.length
|
74
76
|
lines = @statuses.last(8).fill(num_lines, 8 - num_lines) { '' }
|
75
|
-
lines.map { |line| line.
|
77
|
+
lines.map { |line| line.at_width(SCREEN_WIDTH) }.join("\n")
|
76
78
|
end
|
77
79
|
end
|