make_menu 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/make_menu/text/column.rb +7 -5
- data/lib/make_menu/text/table.rb +1 -1
- data/lib/make_menu/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d77eaca0e51f7d0a83a9dfee76c802001897c54ea3de35bd01dbee07e36e4f04
|
4
|
+
data.tar.gz: 4b508767ebcdd7c6de85fc90e7d596a5b0f11293c1a108c83abd819f01cda9fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e0182748c51ea9417c65d14223ab0b558204877f2dd25cb78b9787310e8794ce972a6c04f1a4fb1aad4099fab6ca7a8dec0e4dbf8658c6113ceca972d122f9b
|
7
|
+
data.tar.gz: 8f0157fa975c994df129d9d55446c78331527d9aca1bfa3f543e99990c92186b909651f95334270ce2328585e2700d28da1988f8d41446073ce03599db17ab7b
|
data/Gemfile.lock
CHANGED
@@ -2,21 +2,23 @@
|
|
2
2
|
|
3
3
|
module MakeMenu
|
4
4
|
module Text
|
5
|
+
SPACING = 2
|
6
|
+
|
5
7
|
# A column of text with a fixed with
|
6
8
|
class Column
|
7
|
-
def initialize
|
8
|
-
@width =
|
9
|
+
def initialize
|
10
|
+
@width = nil
|
9
11
|
@rows = []
|
10
12
|
@row_index = 0
|
11
13
|
end
|
12
14
|
|
13
|
-
|
14
|
-
|
15
|
-
attr_accessor :rows, :row_index
|
15
|
+
attr_accessor :rows, :row_index, :width
|
16
16
|
|
17
17
|
# Add a block of text to the column. Each row will be padded to the column width
|
18
18
|
def add(text)
|
19
19
|
self.rows += text.split("\n").map do |row|
|
20
|
+
self.width = row.decolor.size + SPACING unless width
|
21
|
+
self.width = [width, row.decolor.size + SPACING].max
|
20
22
|
row.gsub("\r", '')
|
21
23
|
end
|
22
24
|
self.row_index += text.lines.size
|
data/lib/make_menu/text/table.rb
CHANGED
data/lib/make_menu/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: make_menu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Barri Mason
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-02-
|
11
|
+
date: 2024-02-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tty-screen
|