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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6079d0d2ded23323d692aa38230e046661266725
4
- data.tar.gz: 790e09be5cac49b465f13dd6a24e58ae446acdd9
3
+ metadata.gz: eebfd38f22245b3bfc96be1e233a24b200ad5e0a
4
+ data.tar.gz: 9ed70fc5d0fd984793eb29ee6bbe610ecf8b31e6
5
5
  SHA512:
6
- metadata.gz: 0cf9f524abcee8d42a56765e1ab8818b2dc69c275300c4fcec678c4b19db1f16824d0dc2d4fc960ad65a958c5d10a529e97ecf66ef4b01e391931ed12b62ea2e
7
- data.tar.gz: 8c37bc9cfc4ca3a55562c4de14ad31daec5831eb6f97a66e72c6a039a2dbe7283dd401fc0fd65fcf37b4d2e60d06fc35a4a2fb6733698a10a2e97ed7c3290545
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.0
8
- - 2.2.0
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
- 0.4.0 (Sept 20, 2015)
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
- 0.3.0 (July 6, 2015)
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
- 0.2.0 (Mar 30, 2015)
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
- * Remove padding from wrapped operation to fully rely on Verse.wrap
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
@@ -2,9 +2,8 @@ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
- group :development do
6
- gem 'rake', '~> 10.4.2'
7
- gem 'rspec', '~> 3.3.0'
5
+ group :tools do
6
+ gem 'rspec', '~> 3.4.0'
8
7
  gem 'yard', '~> 0.8.7'
9
8
  end
10
9
 
data/README.md CHANGED
@@ -704,4 +704,4 @@ table.render width: 80, resize: true
704
704
 
705
705
  ## Copyright
706
706
 
707
- Copyright (c) 2015 Piotr Murach. See LICENSE for further details.
707
+ Copyright (c) 2015-2016 Piotr Murach. See LICENSE for further details.
@@ -65,7 +65,7 @@ module TTY
65
65
  to_ary
66
66
  end
67
67
 
68
- private
68
+ protected
69
69
 
70
70
  attr_reader :alignments
71
71
  end # AlignmentSet
@@ -15,7 +15,7 @@ module TTY
15
15
  # @return [Table::BorderOptions]
16
16
  attr_reader :options
17
17
 
18
- def_delegators :@options, :characters, :style
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
@@ -13,7 +13,7 @@ module TTY
13
13
 
14
14
  # A set of header elements that correspond to values in each row
15
15
  class Header
16
- include Equatable, Enumerable
16
+ include Enumerable
17
17
  extend Forwardable
18
18
 
19
19
  def_delegators :@attributes, :join, :map, :map!
@@ -29,7 +29,7 @@ module TTY
29
29
  align_field(field, col)
30
30
  end
31
31
 
32
- private
32
+ protected
33
33
 
34
34
  attr_reader :alignments
35
35
 
@@ -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 [TTY::Table::Padder] padding
12
+ # @param [Verse::Padder] padding
16
13
  #
17
14
  # @param [Array[Integer]] widths
18
15
  #
19
16
  # @api public
20
- def initialize(padding, widths)
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, row, col)
40
- column_width = widths[col]
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
@@ -69,7 +69,7 @@ module TTY
69
69
  end
70
70
  end
71
71
 
72
- private
72
+ protected
73
73
 
74
74
  # The table
75
75
  #
@@ -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, widths))
196
+ @operations.add(:padding, Operation::Padding.new(padding))
197
197
  end
198
198
 
199
- private
199
+ protected
200
200
 
201
201
  # Table to be rendered
202
202
  #
data/lib/tty/table/row.rb CHANGED
@@ -18,7 +18,7 @@ module TTY
18
18
  #
19
19
  # @api private
20
20
  class Row
21
- include Enumerable, Equatable
21
+ include Enumerable
22
22
  extend Forwardable
23
23
 
24
24
  # The row attributes that describe each element
@@ -2,6 +2,6 @@
2
2
 
3
3
  module TTY
4
4
  class Table
5
- VERSION = "0.4.0"
5
+ VERSION = "0.5.0"
6
6
  end
7
7
  end # TTY
@@ -9,7 +9,7 @@ RSpec.describe TTY::Table, '#eql?' do
9
9
  subject { object.eql?(other) }
10
10
 
11
11
  describe '#inspect' do
12
- it { expect(object.inspect).to match /#<TTY::Table/ }
12
+ it { expect(object.inspect).to match(/#<TTY::Table/) }
13
13
  end
14
14
 
15
15
  context 'with the same object' do
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.5.1'
24
- spec.add_dependency 'tty-screen', '~> 0.4.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', '~> 1.5'
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.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: 2015-09-20 00:00:00.000000000 Z
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.5.1
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.5.1
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.4.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.4.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: '1.5'
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: '1.5'
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