terminal-table 1.5.1 → 1.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/terminal-table/import.rb +2 -0
- data/lib/terminal-table/row.rb +11 -11
- data/lib/terminal-table/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5276af39a8c70872f4f6ebbc2e6a3737d78f8da
|
4
|
+
data.tar.gz: 2763365975b930b885ae1c88c957e6fe3b508904
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e8e66ec3b2c947acc0cb91ae1fa573e693bbe54846bd3c69b1c0dd43f995d0a705102a5d1ddfbfa995e49a57a0858a5c71305657d8fa9a6daa1de13f7b2da50
|
7
|
+
data.tar.gz: dd328d81b11d32dcc3ffbf17a85b0dd87edec4a48231fba2a94c53279536abe07a6f8c44e06174cd3f957760b9886da4fc6d2dbc00a6a5e1f3c5fde67d9b90cb
|
data/lib/terminal-table/row.rb
CHANGED
@@ -1,24 +1,24 @@
|
|
1
1
|
module Terminal
|
2
2
|
class Table
|
3
3
|
class Row
|
4
|
-
|
4
|
+
|
5
5
|
##
|
6
6
|
# Row cells
|
7
|
-
|
7
|
+
|
8
8
|
attr_reader :cells
|
9
|
-
|
9
|
+
|
10
10
|
attr_reader :table
|
11
|
-
|
11
|
+
|
12
12
|
##
|
13
13
|
# Initialize with _width_ and _options_.
|
14
|
-
|
14
|
+
|
15
15
|
def initialize table, array = []
|
16
16
|
@cell_index = 0
|
17
17
|
@table = table
|
18
18
|
@cells = []
|
19
19
|
array.each { |item| self << item }
|
20
20
|
end
|
21
|
-
|
21
|
+
|
22
22
|
def add_cell item
|
23
23
|
options = item.is_a?(Hash) ? item : {:value => item}
|
24
24
|
cell = Cell.new(options.merge(:index => @cell_index, :table => @table))
|
@@ -26,15 +26,15 @@ module Terminal
|
|
26
26
|
@cells << cell
|
27
27
|
end
|
28
28
|
alias << add_cell
|
29
|
-
|
29
|
+
|
30
30
|
def [] index
|
31
31
|
cells[index]
|
32
32
|
end
|
33
|
-
|
33
|
+
|
34
34
|
def height
|
35
|
-
cells.map { |c| c.lines.count }.max
|
35
|
+
cells.map { |c| c.lines.count }.max || 0
|
36
36
|
end
|
37
|
-
|
37
|
+
|
38
38
|
def render
|
39
39
|
y = @table.style.border_y
|
40
40
|
(0...height).to_a.map do |line|
|
@@ -45,4 +45,4 @@ module Terminal
|
|
45
45
|
end
|
46
46
|
end
|
47
47
|
end
|
48
|
-
end
|
48
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: terminal-table
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TJ Holowaychuk
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-06-
|
12
|
+
date: 2015-06-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|