tty-table 0.8.0 → 0.9.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: 8c089433bedbafa807caaba4025f66443e2edb93
4
- data.tar.gz: c91840f0c6ade317d39c49625f0f5858a318b212
3
+ metadata.gz: 1bcfc9c4c4f7d6855d4873722744d74857e12de3
4
+ data.tar.gz: 9850f499486fdb55fec0114f5b136d0237be61c6
5
5
  SHA512:
6
- metadata.gz: dbbe1cf16d1bf2e68b07f4641f3643e808fcca717361d6b71f48bf6c02c440dbd32372abc6d22c3dabd7e142897c756ad5df956c04e921be075cf606abad7f9d
7
- data.tar.gz: 77198994da68496eeb19315bd8b4304e9f8649c52a77dc61a0ce9d629a2f454f4f3eeb526f8c175648c309af3fed942a45f0de791086d46cb8070e3631072435
6
+ metadata.gz: 9d879801c732179591cba77d527c2330679d9edc029966ffd08a0afaeac65db2b5e9a5089787881132f336573b5ea8ef9a230c9a6783d8d218db9f403ec23dc7
7
+ data.tar.gz: cb944ee39fa02cba0a77d885c42d7f80d1b6133a51ae96d8f368ce755d462cfce1fdcefa1ea3dcaed80d19e69318137e3bb108d4f6ee314ddc4539010506ef0c
data/.travis.yml CHANGED
@@ -2,6 +2,7 @@
2
2
  language: ruby
3
3
  sudo: false
4
4
  cache: bundler
5
+ before_install: "gem update bundler"
5
6
  bundler_args: --without yard benchmarks
6
7
  script: "bundle exec rake ci"
7
8
  rvm:
@@ -9,7 +10,7 @@ rvm:
9
10
  - 2.1.10
10
11
  - 2.2.6
11
12
  - 2.3.3
12
- - 2.4.0
13
+ - 2.4.1
13
14
  - ruby-head
14
15
  - jruby-9.1.1.0
15
16
  - jruby-head
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Change log
2
2
 
3
+ ## [v0.9.0] - 2017-11-04
4
+
5
+ ### Changed
6
+ * Change ColumnSet class to Columns
7
+ * Change gemset to require Ruby >= 2.0.0
8
+ * Change to update tty-screen dependency
9
+
3
10
  ## [v0.8.0] - 2017-02-27
4
11
 
5
12
  ### Changed
@@ -69,6 +76,7 @@
69
76
 
70
77
  * Initial implementation and release
71
78
 
79
+ [v0.9.0]: https://github.com/piotrmurach/tty-table/compare/v0.8.0...v0.9.0
72
80
  [v0.8.0]: https://github.com/piotrmurach/tty-table/compare/v0.7.0...v0.8.0
73
81
  [v0.7.0]: https://github.com/piotrmurach/tty-table/compare/v0.6.0...v0.7.0
74
82
  [v0.6.0]: https://github.com/piotrmurach/tty-table/compare/v0.5.0...v0.6.0
data/Gemfile CHANGED
@@ -3,7 +3,6 @@ source 'https://rubygems.org'
3
3
  gemspec
4
4
 
5
5
  group :tools do
6
- gem 'rspec', '~> 3.5.0'
7
6
  gem 'yard', '~> 0.8.7'
8
7
  end
9
8
 
data/appveyor.yml CHANGED
@@ -9,7 +9,6 @@ test_script:
9
9
  - bundle exec rake ci
10
10
  environment:
11
11
  matrix:
12
- - ruby_version: "193"
13
12
  - ruby_version: "200"
14
13
  - ruby_version: "200-x64"
15
14
  - ruby_version: "21"
@@ -18,6 +17,3 @@ environment:
18
17
  - ruby_version: "22-x64"
19
18
  - ruby_version: "23"
20
19
  - ruby_version: "23-x64"
21
- matrix:
22
- allow_failures:
23
- - ruby_version: "193"
data/lib/tty/table.rb CHANGED
@@ -4,7 +4,7 @@ require 'equatable'
4
4
  require 'forwardable'
5
5
  require 'necromancer'
6
6
 
7
- require_relative 'table/column_set'
7
+ require_relative 'table/columns'
8
8
  require_relative 'table/header'
9
9
  require_relative 'table/orientation'
10
10
  require_relative 'table/row'
@@ -370,7 +370,7 @@ module TTY
370
370
  #
371
371
  # @api public
372
372
  def width
373
- ColumnSet.new(self).total_width
373
+ Columns.new(self).total_width
374
374
  end
375
375
 
376
376
  # Return true if this is an empty table, i.e. if the number of
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  require_relative 'border/null'
4
- require_relative 'column_set'
4
+ require_relative 'columns'
5
5
  require_relative 'error'
6
6
 
7
7
  module TTY
@@ -109,7 +109,7 @@ module TTY
109
109
  'orientation.'
110
110
  table.orientation = :vertical
111
111
  table.rotate
112
- ColumnSet.widths_from(table)
112
+ Columns.widths_from(table)
113
113
  end
114
114
 
115
115
  # Expand column widths to match the requested width
@@ -11,10 +11,10 @@ module TTY
11
11
  # Used by {Table} to manage column sizing.
12
12
  #
13
13
  # @api private
14
- class ColumnSet
14
+ class Columns
15
15
  include Equatable
16
16
 
17
- # Initialize a ColumnSet
17
+ # Initialize Columns
18
18
  #
19
19
  # @param [Array[Array[Object]]] data
20
20
  #
@@ -8,7 +8,7 @@ require_relative '../border_dsl'
8
8
  require_relative '../border_options'
9
9
  require_relative '../border/null'
10
10
  require_relative '../column_constraint'
11
- require_relative '../column_set'
11
+ require_relative '../columns'
12
12
  require_relative '../header'
13
13
  require_relative '../indentation'
14
14
  require_relative '../operations'
@@ -132,7 +132,7 @@ module TTY
132
132
  #
133
133
  # @api public
134
134
  def column_widths
135
- @column_widths = ColumnSet.widths_from(table, @column_widths)
135
+ @column_widths = Columns.widths_from(table, @column_widths)
136
136
  end
137
137
 
138
138
  # Store border characters, style and separator for the table rendering
@@ -2,6 +2,6 @@
2
2
 
3
3
  module TTY
4
4
  class Table
5
- VERSION = "0.8.0"
5
+ VERSION = "0.9.0"
6
6
  end # Table
7
7
  end # TTY
data/spec/spec_helper.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # coding: utf-8
2
2
 
3
- if RUBY_VERSION > '1.9' and (ENV['COVERAGE'] || ENV['TRAVIS'])
3
+ if ENV['COVERAGE'] || ENV['TRAVIS']
4
4
  require 'simplecov'
5
5
  require 'coveralls'
6
6
 
@@ -1,15 +1,13 @@
1
1
  # coding: utf-8
2
2
 
3
- require 'spec_helper'
4
-
5
- RSpec.describe TTY::Table::ColumnSet, '#extract_widths' do
3
+ RSpec.describe TTY::Table::Columns, '#extract_widths' do
6
4
  let(:color) { Pastel.new(enabled: true) }
7
5
 
8
6
  it 'extract widths' do
9
7
  header = ['h1', 'h2', 'h3']
10
8
  rows = [['a1', 'a2', 'a3'], ['b1', 'b2', 'b3']]
11
9
  table = TTY::Table.new header, rows
12
- column_set = TTY::Table::ColumnSet.new(table)
10
+ column_set = TTY::Table::Columns.new(table)
13
11
  expect(column_set.extract_widths).to eql([2,2,2])
14
12
  end
15
13
 
@@ -17,7 +15,7 @@ RSpec.describe TTY::Table::ColumnSet, '#extract_widths' do
17
15
  header = ['h1', 'うなじ']
18
16
  rows = [['こんにちは', 'a2'], ['b1','選択']]
19
17
  table = TTY::Table.new header, rows
20
- column_set = TTY::Table::ColumnSet.new(table)
18
+ column_set = TTY::Table::Columns.new(table)
21
19
  expect(column_set.extract_widths).to eql([10,6])
22
20
  end
23
21
 
@@ -25,7 +23,7 @@ RSpec.describe TTY::Table::ColumnSet, '#extract_widths' do
25
23
  table = TTY::Table.new
26
24
  table << ["Multi\nLine\nContent", "Text\nthat\nwraps"]
27
25
  table << ["Some\nother\ntext", 'Simple']
28
- column_set = TTY::Table::ColumnSet.new(table)
26
+ column_set = TTY::Table::Columns.new(table)
29
27
  expect(column_set.extract_widths).to eq([7,6])
30
28
  end
31
29
 
@@ -33,7 +31,7 @@ RSpec.describe TTY::Table::ColumnSet, '#extract_widths' do
33
31
  table = TTY::Table.new
34
32
  table << ["Multi\\nLine\\nContent", "Text\\nthat\\nwraps"]
35
33
  table << ["Some\\nother\\ntext", 'Simple']
36
- column_set = TTY::Table::ColumnSet.new(table)
34
+ column_set = TTY::Table::Columns.new(table)
37
35
  expect(column_set.extract_widths).to eq([20, 17])
38
36
  end
39
37
 
@@ -42,7 +40,7 @@ RSpec.describe TTY::Table::ColumnSet, '#extract_widths' do
42
40
  table = TTY::Table.new header: header
43
41
  table << [color.green.on_blue('a1'), 'a2']
44
42
  table << ['b1', color.red.on_yellow('b2')]
45
- column_set = TTY::Table::ColumnSet.new(table)
43
+ column_set = TTY::Table::Columns.new(table)
46
44
  expect(column_set.extract_widths).to eq([2,2])
47
45
  end
48
46
  end
@@ -1,8 +1,6 @@
1
1
  # coding: utf-8
2
2
 
3
- require 'spec_helper'
4
-
5
- RSpec.describe TTY::Table::ColumnSet, '#extract_widths!' do
3
+ RSpec.describe TTY::Table::Columns, '#extract_widths!' do
6
4
  let(:header) { ['h1', 'h2', 'h3'] }
7
5
  let(:rows) { [['a1', 'a2', 'a3'], ['b1', 'b2', 'b3']] }
8
6
  let(:table) { TTY::Table.new header, rows }
@@ -1,8 +1,6 @@
1
1
  # coding: utf-8
2
2
 
3
- require 'spec_helper'
4
-
5
- RSpec.describe TTY::Table::ColumnSet, '#widths_from' do
3
+ RSpec.describe TTY::Table::Columns, '#widths_from' do
6
4
  let(:header) { ['h1', 'h2', 'h3'] }
7
5
  let(:rows) { [['a1', 'a2', 'a3'], ['b1', 'b2', 'b3']] }
8
6
  let(:table) { TTY::Table.new header, rows }
data/tty-table.gemspec CHANGED
@@ -18,13 +18,16 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
+ spec.required_ruby_version = '>= 2.0.0'
22
+
21
23
  spec.add_dependency 'equatable', '~> 0.5.0'
22
24
  spec.add_dependency 'necromancer', '~> 0.4.0'
23
25
  spec.add_dependency 'pastel', '~> 0.7.0'
24
- spec.add_dependency 'tty-screen', '~> 0.5.0'
26
+ spec.add_dependency 'tty-screen', '~> 0.6.0'
25
27
  spec.add_dependency 'verse', '~> 0.5.0'
26
28
  spec.add_dependency 'unicode-display_width','~> 1.1.0'
27
29
 
28
30
  spec.add_development_dependency 'bundler', '>= 1.5.0', '< 2.0'
29
31
  spec.add_development_dependency 'rake'
32
+ spec.add_development_dependency 'rspec', '~> 3.1'
30
33
  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.8.0
4
+ version: 0.9.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: 2017-02-27 00:00:00.000000000 Z
11
+ date: 2017-11-04 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.5.0
61
+ version: 0.6.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.5.0
68
+ version: 0.6.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: verse
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -128,6 +128,20 @@ dependencies:
128
128
  - - ">="
129
129
  - !ruby/object:Gem::Version
130
130
  version: '0'
131
+ - !ruby/object:Gem::Dependency
132
+ name: rspec
133
+ requirement: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - "~>"
136
+ - !ruby/object:Gem::Version
137
+ version: '3.1'
138
+ type: :development
139
+ prerelease: false
140
+ version_requirements: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - "~>"
143
+ - !ruby/object:Gem::Version
144
+ version: '3.1'
131
145
  description: A flexible and intuitive table generator
132
146
  email:
133
147
  - ''
@@ -159,7 +173,7 @@ files:
159
173
  - lib/tty/table/border_dsl.rb
160
174
  - lib/tty/table/border_options.rb
161
175
  - lib/tty/table/column_constraint.rb
162
- - lib/tty/table/column_set.rb
176
+ - lib/tty/table/columns.rb
163
177
  - lib/tty/table/empty.rb
164
178
  - lib/tty/table/error.rb
165
179
  - lib/tty/table/field.rb
@@ -201,9 +215,9 @@ files:
201
215
  - spec/unit/border_options/update_spec.rb
202
216
  - spec/unit/column_constraint/enforce_spec.rb
203
217
  - spec/unit/column_constraint/widths_spec.rb
204
- - spec/unit/column_set/extract_widths_spec.rb
205
- - spec/unit/column_set/total_width_spec.rb
206
- - spec/unit/column_set/widths_from_spec.rb
218
+ - spec/unit/columns/extract_widths_spec.rb
219
+ - spec/unit/columns/total_width_spec.rb
220
+ - spec/unit/columns/widths_from_spec.rb
207
221
  - spec/unit/data_spec.rb
208
222
  - spec/unit/each_spec.rb
209
223
  - spec/unit/each_with_index_spec.rb
@@ -299,7 +313,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
299
313
  requirements:
300
314
  - - ">="
301
315
  - !ruby/object:Gem::Version
302
- version: '0'
316
+ version: 2.0.0
303
317
  required_rubygems_version: !ruby/object:Gem::Requirement
304
318
  requirements:
305
319
  - - ">="
@@ -329,9 +343,9 @@ test_files:
329
343
  - spec/unit/border_options/update_spec.rb
330
344
  - spec/unit/column_constraint/enforce_spec.rb
331
345
  - spec/unit/column_constraint/widths_spec.rb
332
- - spec/unit/column_set/extract_widths_spec.rb
333
- - spec/unit/column_set/total_width_spec.rb
334
- - spec/unit/column_set/widths_from_spec.rb
346
+ - spec/unit/columns/extract_widths_spec.rb
347
+ - spec/unit/columns/total_width_spec.rb
348
+ - spec/unit/columns/widths_from_spec.rb
335
349
  - spec/unit/data_spec.rb
336
350
  - spec/unit/each_spec.rb
337
351
  - spec/unit/each_with_index_spec.rb