terminal-table 1.5.1 → 1.5.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 313963c2be91f08803b78b1d933955c2a23b8a0a
4
- data.tar.gz: db59f26e5ea165487fdd1c43f0bf39c1a9203476
3
+ metadata.gz: a5276af39a8c70872f4f6ebbc2e6a3737d78f8da
4
+ data.tar.gz: 2763365975b930b885ae1c88c957e6fe3b508904
5
5
  SHA512:
6
- metadata.gz: 8fe9f4508ffd90a2e57c2629bef2341692e80a476db60eafffabd35e2710a4c8e0107767c1c5a68537178ae5369c8e6436729c0d131c09b009290be422415390
7
- data.tar.gz: 2f88a22636edfe84955c152d6f60e65d9d32a662da5faca63d4fe3cb9c45896371ca778b01c3952aa592a0fb888b8da7e100f94bcfefea25c5a95a204d0d9437
6
+ metadata.gz: 1e8e66ec3b2c947acc0cb91ae1fa573e693bbe54846bd3c69b1c0dd43f995d0a705102a5d1ddfbfa995e49a57a0858a5c71305657d8fa9a6daa1de13f7b2da50
7
+ data.tar.gz: dd328d81b11d32dcc3ffbf17a85b0dd87edec4a48231fba2a94c53279536abe07a6f8c44e06174cd3f957760b9886da4fc6d2dbc00a6a5e1f3c5fde67d9b90cb
@@ -1 +1,3 @@
1
+ require 'terminal-table' #required as some people require this file directly from their Gemfiles
2
+
1
3
  include Terminal::Table::TableHelper
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Terminal
2
2
  class Table
3
- VERSION = '1.5.1'
3
+ VERSION = '1.5.2'
4
4
  end
5
5
  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.1
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-28 00:00:00.000000000 Z
12
+ date: 2015-06-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler