texttable 1.1.9 → 1.1.11
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/.ruby-version +1 -1
- data/lib/texttable.rb +6 -8
- data/texttable.gemspec +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: 2880607f51cf22460623d451767a3364a5ae0c0fcd009e50626ae612d67b1c53
|
4
|
+
data.tar.gz: ea66bd41f51fee3aeaae9a4c0520635c7e709d65125d40ab8236cbcd1841b8ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b14ff4573aa2104b9ddce63a4b223e7198667a353639bf947066df75a13de55d72578e6c4c3dfdb2a80bf75692c1740ea6bedb30313dd0a99ae35f0d47884cb5
|
7
|
+
data.tar.gz: 6c21c5feefd81c76fe7b4f805767b45e54154369d5542eaad9530550ed16be40a551ea11c296286baa8e77943002eb4c85f85c8d093a082b8c803af88a776ce8
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
3.1.2
|
data/lib/texttable.rb
CHANGED
@@ -147,9 +147,8 @@ class TextTable
|
|
147
147
|
value
|
148
148
|
end
|
149
149
|
|
150
|
-
def
|
150
|
+
def update(obj, *args)
|
151
151
|
obj = [obj, *args] if args.size > 0
|
152
|
-
@values = @rows[@row = @rows.size] = []
|
153
152
|
case obj
|
154
153
|
when Hash then obj.each {|k, v| @values[index(k.to_s, true)] = v }
|
155
154
|
when Array then @values.replace(obj)
|
@@ -158,6 +157,11 @@ class TextTable
|
|
158
157
|
self
|
159
158
|
end
|
160
159
|
|
160
|
+
def add(obj, *args)
|
161
|
+
@values = @rows[@row = @rows.size] = []
|
162
|
+
update(obj, *args)
|
163
|
+
end
|
164
|
+
|
161
165
|
alias :<< :add
|
162
166
|
|
163
167
|
def show(*)
|
@@ -226,9 +230,3 @@ class TextTable
|
|
226
230
|
out
|
227
231
|
end
|
228
232
|
end
|
229
|
-
|
230
|
-
class ActiveRecord::Result
|
231
|
-
def +@
|
232
|
-
TextTable.new(columns, rows)
|
233
|
-
end
|
234
|
-
end if defined?(ActiveRecord)
|
data/texttable.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: texttable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steve Shreeve
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: This gem will auto-size based on column widths.
|
14
14
|
email: steve.shreeve@gmail.com
|
@@ -41,7 +41,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
41
41
|
- !ruby/object:Gem::Version
|
42
42
|
version: '0'
|
43
43
|
requirements: []
|
44
|
-
rubygems_version: 3.
|
44
|
+
rubygems_version: 3.3.26
|
45
45
|
signing_key:
|
46
46
|
specification_version: 4
|
47
47
|
summary: An easy way to work with rows and columns as simple tables
|