tty-table 0.2.0 → 0.3.0

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: 4c9b59ba29023d88b80d1337c882ed5a8a21994e
4
- data.tar.gz: 15ead8cc776eaa5a61920719a1b2252a04505827
3
+ metadata.gz: 8cbe96112e7fc46010dde4ee653530ced922ed59
4
+ data.tar.gz: f87f483bccb9908efdee8b2d8c1a27669cc6599f
5
5
  SHA512:
6
- metadata.gz: 90fa0140b4962bacd8aa1fc51fdb33e4390113ad915b3b9c4789e237073507210276c0ea4f3df6ead55c2f5b820aaa737deab5ea70e88366d196f6718141f243
7
- data.tar.gz: 87f0906fffa4b503fc4d02bffcb4c0eb909730b76cff707a9aeaca9374f6c1118a359c03d364dac28db6645b37ed2fcb3f9340d91f8162c0ebb67bcce1e2ac05
6
+ metadata.gz: 403caa61865d0773cca26abd67c4ad62518dc47e1f096e53dd60e6b4dd7ef29aa277185292c10827553fc19cb31d81303ed39d36221d8c740316dd68659e6ee5
7
+ data.tar.gz: fd6502f89d98c915d1ac8ed0d655764107c7a7d3ab38813dc005cff15634cf74bd2bbc6570035c83ae50e042d64ef0e6073fb3811aaab04ff6b47c169f223d57
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ 0.3.0 (July 6, 2015)
2
+
3
+ * Change benchmarks to reflect API
4
+ * Change dependency on tty-screen
5
+
1
6
  0.2.0 (Mar 30, 2015)
2
7
 
3
8
  * Add UTF-8 support for operations
data/README.md CHANGED
@@ -1,16 +1,18 @@
1
1
  # TTY::Table
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/tty-table.png)][gem]
4
- [![Build Status](https://secure.travis-ci.org/peter-murach/tty-table.png?branch=master)][travis]
5
- [![Code Climate](https://codeclimate.com/github/peter-murach/tty-table.png)][codeclimate]
6
- [![Coverage Status](https://coveralls.io/repos/peter-murach/tty-table/badge.png)][coverage]
3
+ [![Gem Version](https://badge.fury.io/rb/tty-table.svg)][gem]
4
+ [![Build Status](https://secure.travis-ci.org/peter-murach/tty-table.svg?branch=master)][travis]
5
+ [![Code Climate](https://codeclimate.com/github/peter-murach/tty-table/badges/gpa.svg)][codeclimate]
6
+ [![Coverage Status](https://coveralls.io/repos/peter-murach/tty-table/badge.svg?branch=master)][coverage]
7
+ [![Inline docs](http://inch-ci.org/github/peter-murach/tty-table.svg?branch=master)][inchpages]
7
8
 
8
9
  [gem]: http://badge.fury.io/rb/tty-table
9
10
  [travis]: http://travis-ci.org/peter-murach/tty-table
10
11
  [codeclimate]: https://codeclimate.com/github/peter-murach/tty-table
11
12
  [coverage]: https://coveralls.io/r/peter-murach/tty-table
13
+ [inchpages]: http://inch-ci.org/github/peter-murach/tty-table
12
14
 
13
- > A flexible and intuitive table generator.
15
+ > A flexible and intuitive table formatting.
14
16
 
15
17
  **TTY::Table** provides independent table formatting component for [TTY](https://github.com/peter-murach/tty) toolkit.
16
18
 
data/benchmarks/speed.rb CHANGED
@@ -2,35 +2,40 @@
2
2
 
3
3
  # Benchmark speed of table operations
4
4
 
5
+ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
6
+
5
7
  require 'tty-table'
6
8
  require 'benchmark'
7
9
  require 'benchmark/ips'
8
10
 
9
- header = [:name, :color]
10
- rows = (1..100).map { |n| ["row#{n}", "red"] }
11
- table = TTY::Table.new(header, rows)
12
- table_ascii = TTY::Table.new(header, rows, :renderer => :ascii)
13
- table_unicode = TTY::Table.new(header, rows, :renderer => :unicode)
14
- table_color = TTY::Table.new(header, rows, :renderer => :ascii, :border => { :style => :red })
11
+ header = [:name, :color]
12
+ rows = (1..100).map { |n| ["row#{n}", "red"] }
13
+ table = TTY::Table.new(header, rows)
15
14
 
16
15
  Benchmark.ips do |r|
17
16
  r.report("Ruby #to_s") do
18
17
  rows.to_s
19
18
  end
20
19
 
21
- r.report("TTY #to_s") do
22
- table.to_s
20
+ r.report("TTY #render") do
21
+ table.render
23
22
  end
24
23
 
25
- r.report("TTY ASCII #to_s") do
26
- table_ascii.to_s
24
+ r.report("TTY #render ASCII") do
25
+ table.render(:ascii)
27
26
  end
28
27
 
29
- r.report("TTY Unicode #to_s") do
30
- table_unicode.to_s
28
+ r.report("TTY #render Unicode") do
29
+ table.render(:unicode)
31
30
  end
32
31
 
33
- r.report("TTY Color #to_s") do
34
- table_color.to_s
32
+ r.report("TTY #render Color") do
33
+ table.render(:ascii, border: {style: :red})
35
34
  end
36
35
  end
36
+
37
+ # Ruby #to_s 2588.6 (±12.2%) i/s - 12948 in 5.084883s
38
+ # TTY #render 20.8 (±9.6%) i/s - 104 in 5.030159s
39
+ # TTY #render ASCII 18.1 (±16.5%) i/s - 89 in 5.041230s
40
+ # TTY #render Unicode 18.0 (±16.7%) i/s - 88 in 5.029868s
41
+ # TTY #render Color 11.7 (±17.1%) i/s - 58 in 5.071654s
@@ -2,6 +2,6 @@
2
2
 
3
3
  module TTY
4
4
  class Table
5
- VERSION = "0.2.0"
5
+ VERSION = "0.3.0"
6
6
  end
7
7
  end # TTY
data/tty-table.gemspec CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
21
21
  spec.add_dependency 'equatable', '~> 0.5'
22
22
  spec.add_dependency 'necromancer', '~> 0.3'
23
23
  spec.add_dependency 'pastel', '~> 0.4'
24
- spec.add_dependency 'tty-screen', '~> 0.1'
24
+ spec.add_dependency 'tty-screen', '~> 0.2'
25
25
  spec.add_dependency 'verse', '~> 0.4'
26
26
  spec.add_dependency 'unicode_utils','~> 1.4.0'
27
27
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tty-table
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Murach
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-30 00:00:00.000000000 Z
11
+ date: 2015-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: equatable
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - ~>
60
60
  - !ruby/object:Gem::Version
61
- version: '0.1'
61
+ version: '0.2'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ~>
67
67
  - !ruby/object:Gem::Version
68
- version: '0.1'
68
+ version: '0.2'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: verse
71
71
  requirement: !ruby/object:Gem::Requirement