text-table 1.2.3 → 1.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5637e2fb2a77c1c4c6f019b4120e6d1dfc547336
4
- data.tar.gz: da83a6185a3c4acac5e857594dd187fe43544b76
3
+ metadata.gz: a197566529e0dc4b05dc3ee53918eb4eac2341a4
4
+ data.tar.gz: ee8786d2e4973ecdb34f0b76b02138c65fd4e2a3
5
5
  SHA512:
6
- metadata.gz: da85599487daf6768f1a466e20950418cc65905782a22972a27e0b59c70b4d63df5ab41c945a59e378f065b7c224026a9d712e4b18b174523c0276d0bb67307a
7
- data.tar.gz: 359c082e3f514a9b706ff5a82a1df813ab82c89ee0802c1883f8630eb8a87eff4e70aa400bfc79936c9bf36ae3b0d8c81e81b5d2585930c7dfbdb769c46bae50
6
+ metadata.gz: de10c431e934dcf03b2af5a50e977f85705ca46a29282bf71077f0e73bbf9ef9454e4c6aafc509a5a22caad2d3ab8a1e827433ae33d7d5a608e1a22476761bd5
7
+ data.tar.gz: c15f4390e3a4a782d3a36221ae5f175c3c8b1856dd99d4e8af6587c2bc55bec284355b4960205aada1459b13e363e41d577187fcf33b41c6c01a23d921cc054e
@@ -0,0 +1,11 @@
1
+ language: ruby
2
+ rvm:
3
+ - "1.8.7"
4
+ - "1.9.2"
5
+ - "1.9.3"
6
+ - "2.0.0"
7
+ - jruby-18mode
8
+ - jruby-19mode
9
+ - rbx-18mode
10
+ - rbx-19mode
11
+ script: bundle exec rspec
@@ -1,4 +1,7 @@
1
1
  = text-table
2
+ {<img src="https://badge.fury.io/rb/text-table.png" alt="Gem Version" />}[https://rubygems.org/gems/text-table]
3
+ {<img src="https://secure.travis-ci.org/aptinio/text-table.png" alt="Build Status" />}[http://travis-ci.org/aptinio/text-table]
4
+ {<img src="https://codeclimate.com/github/aptinio/text-table.png" alt="Code Climate" />}[https://codeclimate.com/github/aptinio/text-table]
2
5
 
3
6
  A feature-rich, easy-to-use plain text table formatter.
4
7
 
@@ -201,6 +201,7 @@ module Text #:nodoc:
201
201
  row[row.index(cell)] = hashify(cell, {:align => alignment_block}) if cell and not(cell.is_a?(Hash) && cell[:colspan].to_i > 0)
202
202
  end
203
203
  rows.each do |row|
204
+ next if row == :separator
204
205
  set_alignment.call(row, column_number, alignment)
205
206
  end
206
207
  set_alignment.call(foot, column_number, alignment) if foot
@@ -211,5 +212,8 @@ module Text #:nodoc:
211
212
  defaults.merge(cell.is_a?(Hash) ? cell : {:value => cell})
212
213
  end
213
214
 
215
+ def inspect
216
+ "#<#{self.class}:0x#{self.__id__.to_s(16)}>"
217
+ end
214
218
  end
215
219
  end
@@ -1,5 +1,5 @@
1
1
  module Text
2
2
  class Table
3
- VERSION = '1.2.3'
3
+ VERSION = '1.2.4'
4
4
  end
5
5
  end
@@ -149,6 +149,7 @@ describe Text::Table do
149
149
  before do
150
150
  table.rows[1][2] = {:value => 'c', :align => :center}
151
151
  table.rows << [{:value => 'x', :colspan => 2}, 'c', 'd']
152
+ table.rows << :separator
152
153
  table.rows << ['a', 'b', {:value => 'x', :colspan => 2}]
153
154
  table.align_column 2, :right
154
155
  table.align_column 3, :right
@@ -161,6 +162,7 @@ describe Text::Table do
161
162
  | aa | bbb | cccc | d |
162
163
  | aaa | bbbb | c | dd |
163
164
  | x | c | d |
165
+ +------+------+------+------+
164
166
  | a | b | x |
165
167
  +------+------+------+------+
166
168
  | aaaa | b | cc | ddd |
@@ -3,17 +3,17 @@ require 'benchmark'
3
3
 
4
4
  describe Text::Table, 'performance' do
5
5
  it 'is linear relative to row count' do
6
- base = time_to_render_num_of_rows 30
7
- time = time_to_render_num_of_rows 300
6
+ base = time_to_render_num_of_rows 1_000
7
+ time = time_to_render_num_of_rows 10_000
8
8
 
9
- time.should_not > base * 12
9
+ time.should_not > base * 20
10
10
  end
11
11
 
12
12
  def time_to_render_num_of_rows(num)
13
13
  GC.start
14
14
 
15
- Benchmark.realtime do
16
- Text::Table.new(rows: Array.new(num)).to_s
17
- end
15
+ Benchmark.measure {
16
+ Text::Table.new(:rows => Array.new(num)).to_s
17
+ }.total
18
18
  end
19
19
  end
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: text-table
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.3
4
+ version: 1.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Tinio
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-15 00:00:00.000000000 Z
11
+ date: 2015-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '2'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '2'
27
27
  description: Allows you to easily create and format plain text tables, useful when
@@ -34,8 +34,9 @@ extra_rdoc_files:
34
34
  - LICENSE
35
35
  - README.rdoc
36
36
  files:
37
- - .document
38
- - .gitignore
37
+ - ".document"
38
+ - ".gitignore"
39
+ - ".travis.yml"
39
40
  - CHANGELOG.rdoc
40
41
  - Gemfile
41
42
  - LICENSE
@@ -67,17 +68,17 @@ require_paths:
67
68
  - lib
68
69
  required_ruby_version: !ruby/object:Gem::Requirement
69
70
  requirements:
70
- - - '>='
71
+ - - ">="
71
72
  - !ruby/object:Gem::Version
72
73
  version: '0'
73
74
  required_rubygems_version: !ruby/object:Gem::Requirement
74
75
  requirements:
75
- - - '>='
76
+ - - ">="
76
77
  - !ruby/object:Gem::Version
77
78
  version: '0'
78
79
  requirements: []
79
80
  rubyforge_project:
80
- rubygems_version: 2.0.3
81
+ rubygems_version: 2.4.5
81
82
  signing_key:
82
83
  specification_version: 4
83
84
  summary: A feature-rich, easy-to-use plain text table formatter.