tty-table 0.10.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (150) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +13 -0
  3. data/README.md +67 -3
  4. data/Rakefile +2 -0
  5. data/lib/tty-table.rb +0 -3
  6. data/lib/tty/table.rb +35 -12
  7. data/lib/tty/table/alignment_set.rb +2 -2
  8. data/lib/tty/table/border.rb +6 -3
  9. data/lib/tty/table/border/ascii.rb +1 -1
  10. data/lib/tty/table/border/null.rb +3 -2
  11. data/lib/tty/table/border/row_line.rb +1 -1
  12. data/lib/tty/table/border/unicode.rb +1 -2
  13. data/lib/tty/table/border_dsl.rb +3 -3
  14. data/lib/tty/table/border_options.rb +21 -1
  15. data/lib/tty/table/column_constraint.rb +1 -1
  16. data/lib/tty/table/columns.rb +0 -1
  17. data/lib/tty/table/empty.rb +2 -0
  18. data/lib/tty/table/error.rb +1 -1
  19. data/lib/tty/table/field.rb +1 -1
  20. data/lib/tty/table/header.rb +1 -1
  21. data/lib/tty/table/indentation.rb +2 -3
  22. data/lib/tty/table/operation/alignment.rb +8 -6
  23. data/lib/tty/table/operation/escape.rb +1 -1
  24. data/lib/tty/table/operation/filter.rb +1 -1
  25. data/lib/tty/table/operation/padding.rb +1 -9
  26. data/lib/tty/table/operation/truncation.rb +1 -1
  27. data/lib/tty/table/operation/wrapped.rb +1 -1
  28. data/lib/tty/table/operations.rb +1 -1
  29. data/lib/tty/table/options.rb +1 -1
  30. data/lib/tty/table/orientation.rb +1 -1
  31. data/lib/tty/table/orientation/horizontal.rb +1 -1
  32. data/lib/tty/table/orientation/vertical.rb +1 -1
  33. data/lib/tty/table/renderer.rb +4 -4
  34. data/lib/tty/table/renderer/ascii.rb +1 -1
  35. data/lib/tty/table/renderer/basic.rb +19 -20
  36. data/lib/tty/table/renderer/unicode.rb +1 -1
  37. data/lib/tty/table/row.rb +2 -2
  38. data/lib/tty/table/transformation.rb +2 -2
  39. data/lib/tty/table/validatable.rb +1 -1
  40. data/lib/tty/table/version.rb +3 -1
  41. data/spec/spec_helper.rb +1 -1
  42. data/spec/unit/access_spec.rb +1 -3
  43. data/spec/unit/add_row_spec.rb +1 -3
  44. data/spec/unit/alignment_set/each_spec.rb +1 -3
  45. data/spec/unit/alignment_set/new_spec.rb +1 -3
  46. data/spec/unit/alignment_set/to_ary_spec.rb +1 -3
  47. data/spec/unit/alignment_spec.rb +1 -3
  48. data/spec/unit/border/ascii/rendering_spec.rb +1 -3
  49. data/spec/unit/border/new_spec.rb +1 -3
  50. data/spec/unit/border/null/rendering_spec.rb +1 -3
  51. data/spec/unit/border/options/from_spec.rb +1 -3
  52. data/spec/unit/border/options/new_spec.rb +1 -3
  53. data/spec/unit/border/unicode/rendering_spec.rb +1 -3
  54. data/spec/unit/border_options/new_spec.rb +1 -3
  55. data/spec/unit/border_options/update_spec.rb +1 -3
  56. data/spec/unit/column_constraint/enforce_spec.rb +1 -3
  57. data/spec/unit/column_constraint/widths_spec.rb +1 -3
  58. data/spec/unit/columns/extract_widths_spec.rb +1 -1
  59. data/spec/unit/columns/total_width_spec.rb +0 -1
  60. data/spec/unit/columns/widths_from_spec.rb +1 -1
  61. data/spec/unit/data_spec.rb +1 -3
  62. data/spec/unit/each_spec.rb +1 -3
  63. data/spec/unit/each_with_index_spec.rb +1 -3
  64. data/spec/unit/empty_spec.rb +1 -3
  65. data/spec/unit/eql_spec.rb +1 -3
  66. data/spec/unit/field/equality_spec.rb +1 -3
  67. data/spec/unit/field/length_spec.rb +1 -3
  68. data/spec/unit/field/lines_spec.rb +1 -3
  69. data/spec/unit/field/new_spec.rb +1 -3
  70. data/spec/unit/field/width_spec.rb +1 -3
  71. data/spec/unit/filter_spec.rb +1 -3
  72. data/spec/unit/header/call_spec.rb +1 -3
  73. data/spec/unit/header/color_spec.rb +1 -3
  74. data/spec/unit/header/equality_spec.rb +1 -3
  75. data/spec/unit/header/height_spec.rb +1 -3
  76. data/spec/unit/header/new_spec.rb +1 -4
  77. data/spec/unit/header/set_spec.rb +1 -3
  78. data/spec/unit/header/to_ary_spec.rb +1 -3
  79. data/spec/unit/header_spec.rb +1 -3
  80. data/spec/unit/indentation/indent_spec.rb +1 -3
  81. data/spec/unit/new_spec.rb +1 -3
  82. data/spec/unit/operation/alignment/call_spec.rb +1 -3
  83. data/spec/unit/operation/escape/call_spec.rb +1 -3
  84. data/spec/unit/operation/filter/call_spec.rb +1 -3
  85. data/spec/unit/operation/truncation/call_spec.rb +1 -3
  86. data/spec/unit/operation/wrapped/call_spec.rb +1 -3
  87. data/spec/unit/operations/new_spec.rb +1 -1
  88. data/spec/unit/options/access_spec.rb +1 -3
  89. data/spec/unit/options_spec.rb +1 -3
  90. data/spec/unit/orientation_spec.rb +1 -3
  91. data/spec/unit/padding_spec.rb +1 -3
  92. data/spec/unit/properties_spec.rb +1 -3
  93. data/spec/unit/render_repeat_spec.rb +1 -4
  94. data/spec/unit/render_spec.rb +1 -3
  95. data/spec/unit/render_with_spec.rb +1 -3
  96. data/spec/unit/renderer/ascii/coloring_spec.rb +16 -3
  97. data/spec/unit/renderer/ascii/indentation_spec.rb +1 -3
  98. data/spec/unit/renderer/ascii/multiline_spec.rb +1 -3
  99. data/spec/unit/renderer/ascii/padding_spec.rb +1 -3
  100. data/spec/unit/renderer/ascii/render_spec.rb +1 -3
  101. data/spec/unit/renderer/ascii/resizing_spec.rb +1 -3
  102. data/spec/unit/renderer/ascii/separator_spec.rb +14 -4
  103. data/spec/unit/renderer/basic/alignment_spec.rb +1 -3
  104. data/spec/unit/renderer/basic/coloring_spec.rb +1 -3
  105. data/spec/unit/renderer/basic/extract_column_widths_spec.rb +1 -3
  106. data/spec/unit/renderer/basic/filter_spec.rb +1 -3
  107. data/spec/unit/renderer/basic/indentation_spec.rb +1 -3
  108. data/spec/unit/renderer/basic/multiline_spec.rb +1 -3
  109. data/spec/unit/renderer/basic/new_spec.rb +1 -3
  110. data/spec/unit/renderer/basic/options_spec.rb +1 -3
  111. data/spec/unit/renderer/basic/padding_spec.rb +1 -3
  112. data/spec/unit/renderer/basic/render_spec.rb +1 -3
  113. data/spec/unit/renderer/basic/resizing_spec.rb +1 -3
  114. data/spec/unit/renderer/basic/separator_spec.rb +1 -3
  115. data/spec/unit/renderer/basic/single_row_separator_spec.rb +80 -0
  116. data/spec/unit/renderer/basic/truncation_spec.rb +1 -3
  117. data/spec/unit/renderer/basic/wrapping_spec.rb +1 -3
  118. data/spec/unit/renderer/border_spec.rb +1 -3
  119. data/spec/unit/renderer/render_spec.rb +1 -3
  120. data/spec/unit/renderer/select_spec.rb +1 -3
  121. data/spec/unit/renderer/unicode/coloring_spec.rb +1 -3
  122. data/spec/unit/renderer/unicode/indentation_spec.rb +1 -3
  123. data/spec/unit/renderer/unicode/padding_spec.rb +1 -3
  124. data/spec/unit/renderer/unicode/render_spec.rb +1 -3
  125. data/spec/unit/renderer/unicode/separator_spec.rb +13 -3
  126. data/spec/unit/renderer_spec.rb +1 -3
  127. data/spec/unit/rotate_spec.rb +1 -3
  128. data/spec/unit/row/access_spec.rb +1 -3
  129. data/spec/unit/row/call_spec.rb +1 -3
  130. data/spec/unit/row/data_spec.rb +1 -3
  131. data/spec/unit/row/each_spec.rb +1 -3
  132. data/spec/unit/row/equality_spec.rb +1 -3
  133. data/spec/unit/row/height_spec.rb +1 -3
  134. data/spec/unit/row/new_spec.rb +1 -3
  135. data/spec/unit/row/to_ary_spec.rb +1 -3
  136. data/spec/unit/to_s_spec.rb +1 -1
  137. data/spec/unit/transformation/extract_tuples_spec.rb +1 -3
  138. data/spec/unit/utf_spec.rb +1 -3
  139. data/spec/unit/validatable/validate_options_spec.rb +1 -3
  140. data/spec/unit/validatable_spec.rb +1 -3
  141. data/tasks/console.rake +1 -0
  142. data/tty-table.gemspec +19 -10
  143. metadata +21 -27
  144. data/.gitignore +0 -14
  145. data/.rspec +0 -3
  146. data/.travis.yml +0 -26
  147. data/CODE_OF_CONDUCT.md +0 -49
  148. data/Gemfile +0 -17
  149. data/appveyor.yml +0 -21
  150. data/benchmarks/speed.rb +0 -39
@@ -1,6 +1,4 @@
1
- # coding: utf-8
2
-
3
- require 'spec_helper'
1
+ # frozen_string_literal: true
4
2
 
5
3
  RSpec.describe TTY::Table::Renderer::Basic, 'alignment' do
6
4
  let(:header) { ['h1', 'h2', 'h3'] }
@@ -1,6 +1,4 @@
1
- # coding: utf-8
2
-
3
- require 'spec_helper'
1
+ # frozen_string_literal: true
4
2
 
5
3
  RSpec.describe TTY::Table::Renderer::Basic, 'coloring' do
6
4
  let(:clear) { "\e[0m" }
@@ -1,6 +1,4 @@
1
- # coding: utf-8
2
-
3
- require 'spec_helper'
1
+ # frozen_string_literal: true
4
2
 
5
3
  RSpec.describe TTY::Table::Renderer::Basic, '#column_widths' do
6
4
  let(:rows) { [['a1', 'a2', 'a3'], ['b1', 'b2', 'b3']] }
@@ -1,6 +1,4 @@
1
- # coding: utf-8
2
-
3
- require 'spec_helper'
1
+ # frozen_string_literal: true
4
2
 
5
3
  RSpec.describe TTY::Table::Renderer::Basic, 'filter' do
6
4
  let(:header) { ['h1', 'h2', 'h3'] }
@@ -1,6 +1,4 @@
1
- # coding: utf-8
2
-
3
- require 'spec_helper'
1
+ # frozen_string_literal: true
4
2
 
5
3
  RSpec.describe TTY::Table::Renderer::Basic, 'indentation' do
6
4
  let(:header) { ['h1', 'h2', 'h3'] }
@@ -1,6 +1,4 @@
1
- # coding: utf-8
2
-
3
- require 'spec_helper'
1
+ # frozen_string_literal: true
4
2
 
5
3
  RSpec.describe TTY::Table::Renderer::Basic, 'multiline content' do
6
4
  context 'with escaping' do
@@ -1,6 +1,4 @@
1
- # coding: utf-8
2
-
3
- require 'spec_helper'
1
+ # frozen_string_literal: true
4
2
 
5
3
  RSpec.describe TTY::Table::Renderer::Basic, '.new' do
6
4
  let(:header) { ['h1'] }
@@ -1,6 +1,4 @@
1
- # coding: utf-8
2
-
3
- require 'spec_helper'
1
+ # frozen_string_literal: true
4
2
 
5
3
  RSpec.describe TTY::Table::Renderer::Basic, 'options' do
6
4
  let(:rows) { [['a1', 'a2'], ['b1', 'b2']] }
@@ -1,6 +1,4 @@
1
- # coding: utf-8
2
-
3
- require 'spec_helper'
1
+ # frozen_string_literal: true
4
2
 
5
3
  RSpec.describe TTY::Table::Renderer::Basic, 'padding' do
6
4
  let(:header) { ['Field', 'Type', 'Null', 'Key', 'Default', 'Extra'] }
@@ -1,6 +1,4 @@
1
- # coding: utf-8
2
-
3
- require 'spec_helper'
1
+ # frozen_string_literal: true
4
2
 
5
3
  RSpec.describe TTY::Table::Renderer::Basic, '#render' do
6
4
  let(:header) { ['h1', 'h2', 'h3'] }
@@ -1,6 +1,4 @@
1
- # coding: utf-8
2
-
3
- require 'spec_helper'
1
+ # frozen_string_literal: true
4
2
 
5
3
  RSpec.describe TTY::Table::Renderer::Basic, 'resizing' do
6
4
  let(:header) { ['h1', 'h2', 'h3'] }
@@ -1,6 +1,4 @@
1
- # coding: utf-8
2
-
3
- require 'spec_helper'
1
+ # frozen_string_literal: true
4
2
 
5
3
  RSpec.describe TTY::Table::Renderer::Basic, 'with separator' do
6
4
  let(:header) { ['h1', 'h2', 'h3'] }
@@ -0,0 +1,80 @@
1
+ # frozen_string_literal: true
2
+
3
+ RSpec.describe TTY::Table::Renderer::Basic, 'individual row separators' do
4
+ context 'using the separator option' do
5
+ let(:header) { ['h1', 'h2', 'h3'] }
6
+ let(:rows) { [['a1', 'a2', 'a3'], ['b1', 'b2', 'b3'], ['c1', 'c2', 'c3']] }
7
+ let(:table) { TTY::Table.new(header, rows) }
8
+
9
+ let(:object) { described_class.new table }
10
+
11
+ subject(:renderer) { object }
12
+
13
+ it "can use an array to specify the rows to separate" do
14
+ renderer.border.separator = [2]
15
+ expect(renderer.render).to eq unindent(<<-EOS)
16
+ h1 h2 h3
17
+ a1 a2 a3
18
+ b1 b2 b3
19
+
20
+ c1 c2 c3
21
+ EOS
22
+ end
23
+
24
+ it "can use a proc to specify the rows to separate" do
25
+ renderer.border.separator = ->(line) { line == 2 }
26
+ expect(renderer.render).to eq unindent(<<-EOS)
27
+ h1 h2 h3
28
+ a1 a2 a3
29
+ b1 b2 b3
30
+
31
+ c1 c2 c3
32
+ EOS
33
+ end
34
+ end
35
+
36
+ it "works without a header row" do
37
+ table = TTY::Table.new([['a1', 'a2', 'a3'], ['b1', 'b2', 'b3'], ['c1', 'c2', 'c3']])
38
+ renderer = described_class.new(table)
39
+ renderer.border.separator = [1]
40
+ expect(renderer.render).to eq unindent(<<-EOS)
41
+ a1 a2 a3
42
+ b1 b2 b3
43
+
44
+ c1 c2 c3
45
+ EOS
46
+ end
47
+
48
+ context 'using the :separator keyword as a row' do
49
+ it "the :separator keyword can be used in the row definition" do
50
+ table = TTY::Table.new([['a1', 'a2', 'a3'], ['b1', 'b2', 'b3'], :separator, ['c1', 'c2', 'c3']])
51
+ expect(described_class.new(table).render).to eq unindent(<<-EOS)
52
+ a1 a2 a3
53
+ b1 b2 b3
54
+
55
+ c1 c2 c3
56
+ EOS
57
+ end
58
+
59
+ it "the :separator keyword can be pushed into a run" do
60
+ table = TTY::Table.new([['a1', 'a2', 'a3'], ['b1', 'b2', 'b3']])
61
+ table << :separator << ['c1', 'c2', 'c3']
62
+ expect(described_class.new(table).render).to eq unindent(<<-EOS)
63
+ a1 a2 a3
64
+ b1 b2 b3
65
+
66
+ c1 c2 c3
67
+ EOS
68
+ end
69
+
70
+ it "the :separator keyword be used between the header and the body" do
71
+ table = TTY::Table.new(['h1', 'h2', 'h3'], [:separator, ['a1', 'a2', 'a3'], ['b1', 'b2', 'b3']])
72
+ expect(described_class.new(table).render).to eq unindent(<<-EOS)
73
+ h1 h2 h3
74
+
75
+ a1 a2 a3
76
+ b1 b2 b3
77
+ EOS
78
+ end
79
+ end
80
+ end
@@ -1,6 +1,4 @@
1
- # coding: utf-8
2
-
3
- require 'spec_helper'
1
+ # frozen_string_literal: true
4
2
 
5
3
  RSpec.describe TTY::Table::Renderer::Basic, 'truncation' do
6
4
  let(:header) { ['header1', 'head2', 'h3'] }
@@ -1,6 +1,4 @@
1
- # coding: utf-8
2
-
3
- require 'spec_helper'
1
+ # frozen_string_literal: true
4
2
 
5
3
  RSpec.describe TTY::Table::Renderer::Basic, 'wrapping' do
6
4
  let(:header) { ['header1', 'head2', 'h3'] }
@@ -1,6 +1,4 @@
1
- # coding: utf-8
2
-
3
- require 'spec_helper'
1
+ # frozen_string_literal: true
4
2
 
5
3
  RSpec.describe TTY::Table::Renderer, '#border' do
6
4
  let(:header) { ['h1', 'h2', 'h3'] }
@@ -1,6 +1,4 @@
1
- # coding: utf-8
2
-
3
- require 'spec_helper'
1
+ # frozen_string_literal: true
4
2
 
5
3
  RSpec.describe TTY::Table::Renderer, '#render' do
6
4
  let(:header) { ['h1', 'h2', 'h3'] }
@@ -1,6 +1,4 @@
1
- # coding: utf-8
2
-
3
- require 'spec_helper'
1
+ # frozen_string_literal: true
4
2
 
5
3
  RSpec.describe TTY::Table::Renderer, '#select' do
6
4
  let(:klass) { ::Class.new }
@@ -1,6 +1,4 @@
1
- # coding: utf-8
2
-
3
- require 'spec_helper'
1
+ # frozen_string_literal: true
4
2
 
5
3
  RSpec.describe TTY::Table::Renderer::Unicode, 'coloring' do
6
4
 
@@ -1,6 +1,4 @@
1
- # coding: utf-8
2
-
3
- require 'spec_helper'
1
+ # frozen_string_literal: true
4
2
 
5
3
  RSpec.describe TTY::Table::Renderer::Unicode, 'indentation' do
6
4
  let(:header) { ['h1', 'h2', 'h3'] }
@@ -1,6 +1,4 @@
1
- # coding: utf-8
2
-
3
- require 'spec_helper'
1
+ # frozen_string_literal: true
4
2
 
5
3
  RSpec.describe TTY::Table::Renderer::Unicode, 'padding' do
6
4
  let(:header) { ['Field', 'Type', 'Null', 'Key', 'Default', 'Extra'] }
@@ -1,6 +1,4 @@
1
- # coding: utf-8
2
-
3
- require 'spec_helper'
1
+ # frozen_string_literal: true
4
2
 
5
3
  RSpec.describe TTY::Table::Renderer::Unicode, '#render' do
6
4
  let(:header) { ['h1', 'h2', 'h3'] }
@@ -1,6 +1,4 @@
1
- # coding: utf-8
2
-
3
- require 'spec_helper'
1
+ # frozen_string_literal: true
4
2
 
5
3
  RSpec.describe TTY::Table::Renderer::Unicode, 'with separator' do
6
4
  let(:header) { ['h1', 'h2', 'h3'] }
@@ -23,4 +21,16 @@ RSpec.describe TTY::Table::Renderer::Unicode, 'with separator' do
23
21
  └──┴──┴──┘
24
22
  EOS
25
23
  end
24
+
25
+ it "will not the default separator if individual separators are specified" do
26
+ renderer.border.separator = [1]
27
+ expect(renderer.render).to eq unindent(<<-EOS)
28
+ ┌──┬──┬──┐
29
+ │h1│h2│h3│
30
+ │a1│a2│a3│
31
+ ├──┼──┼──┤
32
+ │b1│b2│b3│
33
+ └──┴──┴──┘
34
+ EOS
35
+ end
26
36
  end
@@ -1,6 +1,4 @@
1
- # encoding: utf-8
2
-
3
- require 'spec_helper'
1
+ # frozen_string_literal: true
4
2
 
5
3
  RSpec.describe TTY::Table, '#renderer' do
6
4
  let(:object) { described_class }
@@ -1,6 +1,4 @@
1
- # encoding: utf-8
2
-
3
- require 'spec_helper'
1
+ # frozen_string_literal: true
4
2
 
5
3
  RSpec.describe TTY::Table, '#rotate' do
6
4
  let(:header) { ['h1', 'h2', 'h3'] }
@@ -1,6 +1,4 @@
1
- # coding: utf-8
2
-
3
- require 'spec_helper'
1
+ # frozen_string_literal: true
4
2
 
5
3
  RSpec.describe TTY::Table::Row, '#access' do
6
4
  let(:object) { described_class.new [] }
@@ -1,6 +1,4 @@
1
- # coding: utf-8
2
-
3
- require 'spec_helper'
1
+ # frozen_string_literal: true
4
2
 
5
3
  RSpec.describe TTY::Table::Row, '#call' do
6
4
  let(:object) { described_class.new(data) }
@@ -1,6 +1,4 @@
1
- # coding: utf-8
2
-
3
- require 'spec_helper'
1
+ # frozen_string_literal: true
4
2
 
5
3
  RSpec.describe TTY::Table::Row, '#data' do
6
4
  let(:object) { described_class.new data, header }
@@ -1,6 +1,4 @@
1
- # coding: utf-8
2
-
3
- require 'spec_helper'
1
+ # frozen_string_literal: true
4
2
 
5
3
  RSpec.describe TTY::Table::Row, '#new' do
6
4
  let(:yields) { [] }
@@ -1,6 +1,4 @@
1
- # coding: utf-8
2
-
3
- require 'spec_helper'
1
+ # frozen_string_literal: true
4
2
 
5
3
  RSpec.describe TTY::Table::Row, '#==' do
6
4
  let(:attributes) { [:id] }
@@ -1,6 +1,4 @@
1
- # coding: utf-8
2
-
3
- require 'spec_helper'
1
+ # frozen_string_literal: true
4
2
 
5
3
  RSpec.describe TTY::Table::Row, '#height' do
6
4
  let(:object) { described_class.new row }
@@ -1,6 +1,4 @@
1
- # coding: utf-8
2
-
3
- require 'spec_helper'
1
+ # frozen_string_literal: true
4
2
 
5
3
  RSpec.describe TTY::Table::Row, '#new' do
6
4
  let(:object) { described_class }
@@ -1,6 +1,4 @@
1
- # coding: utf-8
2
-
3
- require 'spec_helper'
1
+ # frozen_string_literal: true
4
2
 
5
3
  RSpec.describe TTY::Table::Row, '#to_ary' do
6
4
  let(:object) { described_class.new data }
@@ -1,4 +1,4 @@
1
- # coding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  require 'spec_helper'
4
4
 
@@ -1,6 +1,4 @@
1
- # coding: utf-8
2
-
3
- require 'spec_helper'
1
+ # frozen_string_literal: true
4
2
 
5
3
  RSpec.describe TTY::Table::Transformation, '#extract_tuples' do
6
4
  let(:object) { described_class }
@@ -1,6 +1,4 @@
1
- # coding: utf-8
2
-
3
- require 'spec_helper'
1
+ # frozen_string_literal: true
4
2
 
5
3
  RSpec.describe TTY::Table, 'unicode support' do
6
4
  it "measures utf characters correctly for :basic" do
@@ -1,6 +1,4 @@
1
- # coding: utf-8
2
-
3
- require 'spec_helper'
1
+ # frozen_string_literal: true
4
2
 
5
3
  RSpec.describe TTY::Table::Validatable, '#validate_options!' do
6
4
  let(:described_class) { Class.new { include TTY::Table::Validatable } }
@@ -1,6 +1,4 @@
1
- # coding: utf-8
2
-
3
- require 'spec_helper'
1
+ # frozen_string_literal: true
4
2
 
5
3
  RSpec.describe TTY::Table::Validatable do
6
4
  let(:described_class) { Class.new { include TTY::Table::Validatable } }
@@ -8,3 +8,4 @@ task :console do
8
8
  ARGV.clear
9
9
  IRB.start
10
10
  end
11
+ task c: %w[ console ]
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  lib = File.expand_path('../lib', __FILE__)
3
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
3
  require 'tty/table/version'
@@ -7,26 +6,36 @@ Gem::Specification.new do |spec|
7
6
  spec.name = 'tty-table'
8
7
  spec.version = TTY::Table::VERSION
9
8
  spec.authors = ["Piotr Murach"]
10
- spec.email = [""]
9
+ spec.email = ["me@piotrmurach.com"]
11
10
  spec.summary = %q{A flexible and intuitive table generator}
12
11
  spec.description = %q{A flexible and intuitive table generator}
13
12
  spec.homepage = "https://piotrmurach.github.io/tty/"
14
13
  spec.license = "MIT"
15
-
16
- spec.files = `git ls-files -z`.split("\x0")
17
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
14
+ if spec.respond_to?(:metadata=)
15
+ spec.metadata = {
16
+ "allowed_push_host" => "https://rubygems.org",
17
+ "bug_tracker_uri" => "https://github.com/piotrmurach/tty-table/issues",
18
+ "changelog_uri" => "https://github.com/piotrmurach/tty-table/blob/master/CHANGELOG.md",
19
+ "documentation_uri" => "https://www.rubydoc.info/gems/tty-table",
20
+ "homepage_uri" => spec.homepage,
21
+ "source_code_uri" => "https://github.com/piotrmurach/tty-table"
22
+ }
23
+ end
24
+ spec.files = Dir['{lib,spec,examples}/**/*.rb']
25
+ spec.files += Dir['{bin,tasks}/*', 'tty-table.gemspec']
26
+ spec.files += Dir['README.md', 'CHANGELOG.md', 'LICENSE.txt', 'Rakefile']
18
27
  spec.test_files = spec.files.grep(%r{^(spec|features)/})
19
28
  spec.require_paths = ["lib"]
20
29
 
21
30
  spec.required_ruby_version = '>= 2.0.0'
22
31
 
23
- spec.add_dependency 'equatable', '~> 0.5.0'
24
- spec.add_dependency 'necromancer', '~> 0.4.0'
32
+ spec.add_dependency 'equatable', '~> 0.6'
33
+ spec.add_dependency 'necromancer', '~> 0.5'
25
34
  spec.add_dependency 'pastel', '~> 0.7.2'
26
- spec.add_dependency 'tty-screen', '~> 0.6.4'
27
- spec.add_dependency 'strings', '~> 0.1.0'
35
+ spec.add_dependency 'tty-screen', '~> 0.7'
36
+ spec.add_dependency 'strings', '~> 0.1.5'
28
37
 
29
- spec.add_development_dependency 'bundler', '>= 1.5.0', '< 2.0'
38
+ spec.add_development_dependency 'bundler', '>= 1.5.0'
30
39
  spec.add_development_dependency 'rake'
31
40
  spec.add_development_dependency 'rspec', '~> 3.1'
32
41
  end