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 +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +7 -5
- data/benchmarks/speed.rb +19 -14
- data/lib/tty/table/version.rb +1 -1
- data/tty-table.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8cbe96112e7fc46010dde4ee653530ced922ed59
|
4
|
+
data.tar.gz: f87f483bccb9908efdee8b2d8c1a27669cc6599f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 403caa61865d0773cca26abd67c4ad62518dc47e1f096e53dd60e6b4dd7ef29aa277185292c10827553fc19cb31d81303ed39d36221d8c740316dd68659e6ee5
|
7
|
+
data.tar.gz: fd6502f89d98c915d1ac8ed0d655764107c7a7d3ab38813dc005cff15634cf74bd2bbc6570035c83ae50e042d64ef0e6073fb3811aaab04ff6b47c169f223d57
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,16 +1,18 @@
|
|
1
1
|
# TTY::Table
|
2
2
|
|
3
|
-
[![Gem Version](https://badge.fury.io/rb/tty-table.
|
4
|
-
[![Build Status](https://secure.travis-ci.org/peter-murach/tty-table.
|
5
|
-
[![Code Climate](https://codeclimate.com/github/peter-murach/tty-table.
|
6
|
-
[![Coverage Status](https://coveralls.io/repos/peter-murach/tty-table/badge.
|
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
|
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
|
10
|
-
rows
|
11
|
-
table
|
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 #
|
22
|
-
table.
|
20
|
+
r.report("TTY #render") do
|
21
|
+
table.render
|
23
22
|
end
|
24
23
|
|
25
|
-
r.report("TTY ASCII
|
26
|
-
|
24
|
+
r.report("TTY #render ASCII") do
|
25
|
+
table.render(:ascii)
|
27
26
|
end
|
28
27
|
|
29
|
-
r.report("TTY Unicode
|
30
|
-
|
28
|
+
r.report("TTY #render Unicode") do
|
29
|
+
table.render(:unicode)
|
31
30
|
end
|
32
31
|
|
33
|
-
r.report("TTY Color
|
34
|
-
|
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
|
data/lib/tty/table/version.rb
CHANGED
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.
|
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.
|
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-
|
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.
|
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.
|
68
|
+
version: '0.2'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: verse
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|