tty-table 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +8 -2
- data/CHANGELOG.md +32 -7
- data/Gemfile +2 -3
- data/README.md +1 -1
- data/lib/tty/table/alignment_set.rb +1 -1
- data/lib/tty/table/border_dsl.rb +3 -2
- data/lib/tty/table/column_constraint.rb +4 -4
- data/lib/tty/table/header.rb +1 -1
- data/lib/tty/table/operation/alignment.rb +1 -1
- data/lib/tty/table/operation/padding.rb +8 -9
- data/lib/tty/table/operations.rb +1 -1
- data/lib/tty/table/renderer/basic.rb +2 -2
- data/lib/tty/table/row.rb +1 -1
- data/lib/tty/table/version.rb +1 -1
- data/spec/unit/eql_spec.rb +1 -1
- data/tty-table.gemspec +4 -3
- metadata +30 -11
- data/.ruby-version +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eebfd38f22245b3bfc96be1e233a24b200ad5e0a
|
4
|
+
data.tar.gz: 9ed70fc5d0fd984793eb29ee6bbe610ecf8b31e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82815c1a2aa7fd70eb3d4adb16f097cb7c104b9a8182a9c22341bb16744b10b4924e4eb92bfc60ebfd1535859b2b338e1223105d48f2f7ffb798ea27e49bf7bd
|
7
|
+
data.tar.gz: 70e0ab3b211e5d7edd0c434a9d11ba4bf5f00035446dfc88fc4d2dfff07bb5e1c90f296f287e7b60f1fadc7115380c65f2c642ec7173eac72d288e6e99890f0a
|
data/.travis.yml
CHANGED
@@ -1,11 +1,15 @@
|
|
1
|
+
---
|
1
2
|
language: ruby
|
3
|
+
sudo: false
|
4
|
+
cache: bundler
|
2
5
|
bundler_args: --without yard benchmarks
|
3
6
|
script: "bundle exec rake ci"
|
4
7
|
rvm:
|
5
8
|
- 1.9.3
|
6
9
|
- 2.0.0
|
7
|
-
- 2.1
|
8
|
-
- 2.2
|
10
|
+
- 2.1
|
11
|
+
- 2.2
|
12
|
+
- 2.3.0
|
9
13
|
- ruby-head
|
10
14
|
matrix:
|
11
15
|
include:
|
@@ -20,3 +24,5 @@ matrix:
|
|
20
24
|
fast_finish: true
|
21
25
|
branches:
|
22
26
|
only: master
|
27
|
+
notifications:
|
28
|
+
email: false
|
data/CHANGELOG.md
CHANGED
@@ -1,22 +1,33 @@
|
|
1
|
-
|
1
|
+
# Change log
|
2
2
|
|
3
|
+
## [v0.5.0] - 2016-02-11
|
4
|
+
|
5
|
+
### Changed
|
6
|
+
* Upgrade pastel & tty-screen dependencies
|
7
|
+
* Remove unused parameters from Operations::Padding
|
8
|
+
|
9
|
+
### Fixed
|
10
|
+
* Fix all warnings
|
11
|
+
|
12
|
+
## [v0.4.0] - 2015-09-20
|
13
|
+
|
14
|
+
### Changed
|
3
15
|
* Update dependencies on tty-screen and pastel
|
4
16
|
|
5
|
-
|
17
|
+
## [v0.3.0] - 2015-07-06
|
6
18
|
|
19
|
+
### Changed
|
7
20
|
* Change benchmarks to reflect API
|
8
21
|
* Change dependency on tty-screen
|
9
22
|
|
10
|
-
|
23
|
+
## [v0.2.0] - 2015-03-30
|
11
24
|
|
25
|
+
### Added
|
12
26
|
* Add UTF-8 support for operations
|
13
27
|
* Add AlignmentSet for alignments storage
|
14
28
|
* Add tests for multilne column widths
|
15
29
|
|
16
|
-
|
17
|
-
* Remove color renderer
|
18
|
-
* Remove adjust_padding from Columns
|
19
|
-
|
30
|
+
### Changed
|
20
31
|
* Change Table each_with_index to iterate over rows
|
21
32
|
* Change Alignment operation to use AlignmentSet
|
22
33
|
* Change Columns to directly depend on table data
|
@@ -24,10 +35,24 @@
|
|
24
35
|
* Change Border to accept padding as argument
|
25
36
|
* Change and extract padding operation
|
26
37
|
* Change Columns to ColumnConstraint and refactor enforce
|
38
|
+
* Remove padding from wrapped operation to fully rely on Verse.wrap
|
39
|
+
* Remove color renderer
|
40
|
+
* Remove adjust_padding from Columns
|
27
41
|
|
42
|
+
### Fixed
|
28
43
|
* Fix table rendering for UTF-8 content
|
29
44
|
* Fix alignment to allow for individual field alignment
|
30
45
|
* Fix bug with padding operation
|
31
46
|
* Fix table border and content coloring
|
32
47
|
* Fix bug with table rerendering to allow for multiple renders
|
33
48
|
* Fix bug with ANSI codes in table content
|
49
|
+
|
50
|
+
## [v0.1.0] - 2015-02-08
|
51
|
+
|
52
|
+
* Initial implementation and release
|
53
|
+
|
54
|
+
[v0.5.0]: https://github.com/peter-murach/tty-table/compare/v0.4.0...v0.5.0
|
55
|
+
[v0.4.0]: https://github.com/peter-murach/tty-table/compare/v0.3.0...v0.4.0
|
56
|
+
[v0.3.0]: https://github.com/peter-murach/tty-table/compare/v0.2.0...v0.3.0
|
57
|
+
[v0.2.0]: https://github.com/peter-murach/tty-table/compare/v0.1.0...v0.2.0
|
58
|
+
[v0.1.0]: https://github.com/peter-murach/tty-table/compare/v0.1.0
|
data/Gemfile
CHANGED
data/README.md
CHANGED
data/lib/tty/table/border_dsl.rb
CHANGED
@@ -15,7 +15,7 @@ module TTY
|
|
15
15
|
# @return [Table::BorderOptions]
|
16
16
|
attr_reader :options
|
17
17
|
|
18
|
-
def_delegators :@options, :characters
|
18
|
+
def_delegators :@options, :characters
|
19
19
|
|
20
20
|
# Initialize a BorderDSL
|
21
21
|
#
|
@@ -39,7 +39,8 @@ module TTY
|
|
39
39
|
# @return [undefined]
|
40
40
|
#
|
41
41
|
# @api public
|
42
|
-
def style(value)
|
42
|
+
def style(value = (not_set = true))
|
43
|
+
return options.style if not_set
|
43
44
|
options.style = value
|
44
45
|
end
|
45
46
|
|
@@ -12,6 +12,10 @@ module TTY
|
|
12
12
|
|
13
13
|
BORDER_WIDTH = 1
|
14
14
|
|
15
|
+
attr_reader :table
|
16
|
+
|
17
|
+
attr_reader :renderer
|
18
|
+
|
15
19
|
# Initialize a Columns
|
16
20
|
#
|
17
21
|
# @param [TTY::Table] table
|
@@ -92,10 +96,6 @@ module TTY
|
|
92
96
|
|
93
97
|
private
|
94
98
|
|
95
|
-
attr_reader :table
|
96
|
-
|
97
|
-
attr_reader :renderer
|
98
|
-
|
99
99
|
# Rotate table to vertical orientation and print information to stdout
|
100
100
|
#
|
101
101
|
# @api private
|
data/lib/tty/table/header.rb
CHANGED
@@ -7,19 +7,15 @@ module TTY
|
|
7
7
|
#
|
8
8
|
# Used internally by {Table::Renderer}
|
9
9
|
class Padding
|
10
|
-
|
11
|
-
attr_reader :widths
|
12
|
-
|
13
10
|
# Initialize a Padding operation
|
14
11
|
#
|
15
|
-
# @param [
|
12
|
+
# @param [Verse::Padder] padding
|
16
13
|
#
|
17
14
|
# @param [Array[Integer]] widths
|
18
15
|
#
|
19
16
|
# @api public
|
20
|
-
def initialize(padding
|
17
|
+
def initialize(padding)
|
21
18
|
@padding = padding
|
22
|
-
@widths = widths
|
23
19
|
end
|
24
20
|
|
25
21
|
# Apply padding to a field
|
@@ -36,10 +32,13 @@ module TTY
|
|
36
32
|
# @return [TTY::Table::Field]
|
37
33
|
#
|
38
34
|
# @api public
|
39
|
-
def call(field,
|
40
|
-
|
41
|
-
Verse.pad(field.content, @padding)
|
35
|
+
def call(field, *)
|
36
|
+
Verse.pad(field.content, padding)
|
42
37
|
end
|
38
|
+
|
39
|
+
protected
|
40
|
+
|
41
|
+
attr_reader :padding
|
43
42
|
end # Padding
|
44
43
|
end # Operation
|
45
44
|
end # Table
|
data/lib/tty/table/operations.rb
CHANGED
@@ -193,10 +193,10 @@ module TTY
|
|
193
193
|
@operations.add(:filter, Operation::Filter.new(filter))
|
194
194
|
@operations.add(:truncation, Operation::Truncation.new(widths))
|
195
195
|
@operations.add(:wrapping, Operation::Wrapped.new(widths))
|
196
|
-
@operations.add(:padding, Operation::Padding.new(padding
|
196
|
+
@operations.add(:padding, Operation::Padding.new(padding))
|
197
197
|
end
|
198
198
|
|
199
|
-
|
199
|
+
protected
|
200
200
|
|
201
201
|
# Table to be rendered
|
202
202
|
#
|
data/lib/tty/table/row.rb
CHANGED
data/lib/tty/table/version.rb
CHANGED
data/spec/unit/eql_spec.rb
CHANGED
data/tty-table.gemspec
CHANGED
@@ -20,10 +20,11 @@ Gem::Specification.new do |spec|
|
|
20
20
|
|
21
21
|
spec.add_dependency 'equatable', '~> 0.5.0'
|
22
22
|
spec.add_dependency 'necromancer', '~> 0.3.0'
|
23
|
-
spec.add_dependency 'pastel', '~> 0.
|
24
|
-
spec.add_dependency 'tty-screen', '~> 0.
|
23
|
+
spec.add_dependency 'pastel', '~> 0.6.0'
|
24
|
+
spec.add_dependency 'tty-screen', '~> 0.5.0'
|
25
25
|
spec.add_dependency 'verse', '~> 0.4.0'
|
26
26
|
spec.add_dependency 'unicode_utils','~> 1.4.0'
|
27
27
|
|
28
|
-
spec.add_development_dependency 'bundler', '
|
28
|
+
spec.add_development_dependency 'bundler', '>= 1.5.0', '< 2.0'
|
29
|
+
spec.add_development_dependency 'rake'
|
29
30
|
end
|
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.5.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:
|
11
|
+
date: 2016-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: equatable
|
@@ -44,28 +44,28 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.
|
47
|
+
version: 0.6.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.
|
54
|
+
version: 0.6.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: tty-screen
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.
|
61
|
+
version: 0.5.0
|
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.5.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: verse
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -98,16 +98,36 @@ dependencies:
|
|
98
98
|
name: bundler
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - '>='
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
103
|
+
version: 1.5.0
|
104
|
+
- - <
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: '2.0'
|
104
107
|
type: :development
|
105
108
|
prerelease: false
|
106
109
|
version_requirements: !ruby/object:Gem::Requirement
|
107
110
|
requirements:
|
108
|
-
- -
|
111
|
+
- - '>='
|
112
|
+
- !ruby/object:Gem::Version
|
113
|
+
version: 1.5.0
|
114
|
+
- - <
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '2.0'
|
117
|
+
- !ruby/object:Gem::Dependency
|
118
|
+
name: rake
|
119
|
+
requirement: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - '>='
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: '0'
|
124
|
+
type: :development
|
125
|
+
prerelease: false
|
126
|
+
version_requirements: !ruby/object:Gem::Requirement
|
127
|
+
requirements:
|
128
|
+
- - '>='
|
109
129
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
130
|
+
version: '0'
|
111
131
|
description: A flexible and intuitive table generator
|
112
132
|
email:
|
113
133
|
- ''
|
@@ -117,7 +137,6 @@ extra_rdoc_files: []
|
|
117
137
|
files:
|
118
138
|
- .gitignore
|
119
139
|
- .rspec
|
120
|
-
- .ruby-version
|
121
140
|
- .travis.yml
|
122
141
|
- CHANGELOG.md
|
123
142
|
- Gemfile
|
data/.ruby-version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
2.0.0
|