console_table 0.2.3 → 0.2.4
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/console_table.gemspec +1 -1
- data/lib/console_table.rb +3 -4
- 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: ab7d82bb06f02ef3d9801e976dadf6c7db1cbd3f
|
4
|
+
data.tar.gz: 22494271d6b5d07cefd7e08b86cdf2bcb8e3454b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b67854940872e00d6f531025bd67507cc22961271e44782bce78c61360a5b85ceb63044694c531482087a94d620b08ecc8ec2b0044fc75ee5a47487050780af
|
7
|
+
data.tar.gz: cef3669df0150ef6cc49a8e43557440999026c30d70e82707706963649699247b4fc8fa65f002697d25277751263bec9985f2ddd020fcd34385b8c4ed5638c02
|
data/console_table.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "console_table"
|
7
|
-
spec.version = "0.2.
|
7
|
+
spec.version = "0.2.4"
|
8
8
|
spec.authors = ["Rod Hilton"]
|
9
9
|
spec.email = ["consoletable@rodhilton.com"]
|
10
10
|
spec.summary = %q{Simplifies printing tables of information to commandline consoles}
|
data/lib/console_table.rb
CHANGED
@@ -16,6 +16,7 @@ module ConsoleTable
|
|
16
16
|
end
|
17
17
|
|
18
18
|
class ConsoleTableClass
|
19
|
+
require 'terminfo'
|
19
20
|
|
20
21
|
# Add strings to the footer array to have them formatted when the table closes
|
21
22
|
attr_reader :footer
|
@@ -277,14 +278,12 @@ module ConsoleTable
|
|
277
278
|
|
278
279
|
total_width = @set_width
|
279
280
|
begin
|
280
|
-
require 'terminfo'
|
281
281
|
total_width = TermInfo.screen_columns
|
282
282
|
rescue => ex
|
283
|
-
total_width = ENV["COLUMNS"].to_i
|
283
|
+
total_width = ENV["COLUMNS"].to_i unless ENV["COLUMNS"].nil?
|
284
|
+
total_width = 79 if total_width.nil?
|
284
285
|
end if total_width.nil?
|
285
286
|
|
286
|
-
working_column_layout = []
|
287
|
-
|
288
287
|
keys = @original_column_layout.collect { |d| d[:key] }.uniq
|
289
288
|
if keys.length < @original_column_layout.length
|
290
289
|
raise("ConsoleTable configuration invalid, same key defined more than once")
|