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.
- checksums.yaml +5 -5
- data/CHANGELOG.md +13 -0
- data/README.md +67 -3
- data/Rakefile +2 -0
- data/lib/tty-table.rb +0 -3
- data/lib/tty/table.rb +35 -12
- data/lib/tty/table/alignment_set.rb +2 -2
- data/lib/tty/table/border.rb +6 -3
- data/lib/tty/table/border/ascii.rb +1 -1
- data/lib/tty/table/border/null.rb +3 -2
- data/lib/tty/table/border/row_line.rb +1 -1
- data/lib/tty/table/border/unicode.rb +1 -2
- data/lib/tty/table/border_dsl.rb +3 -3
- data/lib/tty/table/border_options.rb +21 -1
- data/lib/tty/table/column_constraint.rb +1 -1
- data/lib/tty/table/columns.rb +0 -1
- data/lib/tty/table/empty.rb +2 -0
- data/lib/tty/table/error.rb +1 -1
- data/lib/tty/table/field.rb +1 -1
- data/lib/tty/table/header.rb +1 -1
- data/lib/tty/table/indentation.rb +2 -3
- data/lib/tty/table/operation/alignment.rb +8 -6
- data/lib/tty/table/operation/escape.rb +1 -1
- data/lib/tty/table/operation/filter.rb +1 -1
- data/lib/tty/table/operation/padding.rb +1 -9
- data/lib/tty/table/operation/truncation.rb +1 -1
- data/lib/tty/table/operation/wrapped.rb +1 -1
- data/lib/tty/table/operations.rb +1 -1
- data/lib/tty/table/options.rb +1 -1
- data/lib/tty/table/orientation.rb +1 -1
- data/lib/tty/table/orientation/horizontal.rb +1 -1
- data/lib/tty/table/orientation/vertical.rb +1 -1
- data/lib/tty/table/renderer.rb +4 -4
- data/lib/tty/table/renderer/ascii.rb +1 -1
- data/lib/tty/table/renderer/basic.rb +19 -20
- data/lib/tty/table/renderer/unicode.rb +1 -1
- data/lib/tty/table/row.rb +2 -2
- data/lib/tty/table/transformation.rb +2 -2
- data/lib/tty/table/validatable.rb +1 -1
- data/lib/tty/table/version.rb +3 -1
- data/spec/spec_helper.rb +1 -1
- data/spec/unit/access_spec.rb +1 -3
- data/spec/unit/add_row_spec.rb +1 -3
- data/spec/unit/alignment_set/each_spec.rb +1 -3
- data/spec/unit/alignment_set/new_spec.rb +1 -3
- data/spec/unit/alignment_set/to_ary_spec.rb +1 -3
- data/spec/unit/alignment_spec.rb +1 -3
- data/spec/unit/border/ascii/rendering_spec.rb +1 -3
- data/spec/unit/border/new_spec.rb +1 -3
- data/spec/unit/border/null/rendering_spec.rb +1 -3
- data/spec/unit/border/options/from_spec.rb +1 -3
- data/spec/unit/border/options/new_spec.rb +1 -3
- data/spec/unit/border/unicode/rendering_spec.rb +1 -3
- data/spec/unit/border_options/new_spec.rb +1 -3
- data/spec/unit/border_options/update_spec.rb +1 -3
- data/spec/unit/column_constraint/enforce_spec.rb +1 -3
- data/spec/unit/column_constraint/widths_spec.rb +1 -3
- data/spec/unit/columns/extract_widths_spec.rb +1 -1
- data/spec/unit/columns/total_width_spec.rb +0 -1
- data/spec/unit/columns/widths_from_spec.rb +1 -1
- data/spec/unit/data_spec.rb +1 -3
- data/spec/unit/each_spec.rb +1 -3
- data/spec/unit/each_with_index_spec.rb +1 -3
- data/spec/unit/empty_spec.rb +1 -3
- data/spec/unit/eql_spec.rb +1 -3
- data/spec/unit/field/equality_spec.rb +1 -3
- data/spec/unit/field/length_spec.rb +1 -3
- data/spec/unit/field/lines_spec.rb +1 -3
- data/spec/unit/field/new_spec.rb +1 -3
- data/spec/unit/field/width_spec.rb +1 -3
- data/spec/unit/filter_spec.rb +1 -3
- data/spec/unit/header/call_spec.rb +1 -3
- data/spec/unit/header/color_spec.rb +1 -3
- data/spec/unit/header/equality_spec.rb +1 -3
- data/spec/unit/header/height_spec.rb +1 -3
- data/spec/unit/header/new_spec.rb +1 -4
- data/spec/unit/header/set_spec.rb +1 -3
- data/spec/unit/header/to_ary_spec.rb +1 -3
- data/spec/unit/header_spec.rb +1 -3
- data/spec/unit/indentation/indent_spec.rb +1 -3
- data/spec/unit/new_spec.rb +1 -3
- data/spec/unit/operation/alignment/call_spec.rb +1 -3
- data/spec/unit/operation/escape/call_spec.rb +1 -3
- data/spec/unit/operation/filter/call_spec.rb +1 -3
- data/spec/unit/operation/truncation/call_spec.rb +1 -3
- data/spec/unit/operation/wrapped/call_spec.rb +1 -3
- data/spec/unit/operations/new_spec.rb +1 -1
- data/spec/unit/options/access_spec.rb +1 -3
- data/spec/unit/options_spec.rb +1 -3
- data/spec/unit/orientation_spec.rb +1 -3
- data/spec/unit/padding_spec.rb +1 -3
- data/spec/unit/properties_spec.rb +1 -3
- data/spec/unit/render_repeat_spec.rb +1 -4
- data/spec/unit/render_spec.rb +1 -3
- data/spec/unit/render_with_spec.rb +1 -3
- data/spec/unit/renderer/ascii/coloring_spec.rb +16 -3
- data/spec/unit/renderer/ascii/indentation_spec.rb +1 -3
- data/spec/unit/renderer/ascii/multiline_spec.rb +1 -3
- data/spec/unit/renderer/ascii/padding_spec.rb +1 -3
- data/spec/unit/renderer/ascii/render_spec.rb +1 -3
- data/spec/unit/renderer/ascii/resizing_spec.rb +1 -3
- data/spec/unit/renderer/ascii/separator_spec.rb +14 -4
- data/spec/unit/renderer/basic/alignment_spec.rb +1 -3
- data/spec/unit/renderer/basic/coloring_spec.rb +1 -3
- data/spec/unit/renderer/basic/extract_column_widths_spec.rb +1 -3
- data/spec/unit/renderer/basic/filter_spec.rb +1 -3
- data/spec/unit/renderer/basic/indentation_spec.rb +1 -3
- data/spec/unit/renderer/basic/multiline_spec.rb +1 -3
- data/spec/unit/renderer/basic/new_spec.rb +1 -3
- data/spec/unit/renderer/basic/options_spec.rb +1 -3
- data/spec/unit/renderer/basic/padding_spec.rb +1 -3
- data/spec/unit/renderer/basic/render_spec.rb +1 -3
- data/spec/unit/renderer/basic/resizing_spec.rb +1 -3
- data/spec/unit/renderer/basic/separator_spec.rb +1 -3
- data/spec/unit/renderer/basic/single_row_separator_spec.rb +80 -0
- data/spec/unit/renderer/basic/truncation_spec.rb +1 -3
- data/spec/unit/renderer/basic/wrapping_spec.rb +1 -3
- data/spec/unit/renderer/border_spec.rb +1 -3
- data/spec/unit/renderer/render_spec.rb +1 -3
- data/spec/unit/renderer/select_spec.rb +1 -3
- data/spec/unit/renderer/unicode/coloring_spec.rb +1 -3
- data/spec/unit/renderer/unicode/indentation_spec.rb +1 -3
- data/spec/unit/renderer/unicode/padding_spec.rb +1 -3
- data/spec/unit/renderer/unicode/render_spec.rb +1 -3
- data/spec/unit/renderer/unicode/separator_spec.rb +13 -3
- data/spec/unit/renderer_spec.rb +1 -3
- data/spec/unit/rotate_spec.rb +1 -3
- data/spec/unit/row/access_spec.rb +1 -3
- data/spec/unit/row/call_spec.rb +1 -3
- data/spec/unit/row/data_spec.rb +1 -3
- data/spec/unit/row/each_spec.rb +1 -3
- data/spec/unit/row/equality_spec.rb +1 -3
- data/spec/unit/row/height_spec.rb +1 -3
- data/spec/unit/row/new_spec.rb +1 -3
- data/spec/unit/row/to_ary_spec.rb +1 -3
- data/spec/unit/to_s_spec.rb +1 -1
- data/spec/unit/transformation/extract_tuples_spec.rb +1 -3
- data/spec/unit/utf_spec.rb +1 -3
- data/spec/unit/validatable/validate_options_spec.rb +1 -3
- data/spec/unit/validatable_spec.rb +1 -3
- data/tasks/console.rake +1 -0
- data/tty-table.gemspec +19 -10
- metadata +21 -27
- data/.gitignore +0 -14
- data/.rspec +0 -3
- data/.travis.yml +0 -26
- data/CODE_OF_CONDUCT.md +0 -49
- data/Gemfile +0 -17
- data/appveyor.yml +0 -21
- data/benchmarks/speed.rb +0 -39
data/spec/unit/data_spec.rb
CHANGED
data/spec/unit/each_spec.rb
CHANGED
data/spec/unit/empty_spec.rb
CHANGED
data/spec/unit/eql_spec.rb
CHANGED
data/spec/unit/field/new_spec.rb
CHANGED
data/spec/unit/filter_spec.rb
CHANGED
data/spec/unit/header_spec.rb
CHANGED
data/spec/unit/new_spec.rb
CHANGED
data/spec/unit/options_spec.rb
CHANGED
data/spec/unit/padding_spec.rb
CHANGED
data/spec/unit/render_spec.rb
CHANGED
@@ -1,6 +1,4 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
require 'spec_helper'
|
1
|
+
# frozen_string_literal: true
|
4
2
|
|
5
3
|
RSpec.describe TTY::Table::Renderer::ASCII, 'coloring' do
|
6
4
|
|
@@ -66,5 +64,20 @@ RSpec.describe TTY::Table::Renderer::ASCII, 'coloring' do
|
|
66
64
|
+-------+-------+
|
67
65
|
EOS
|
68
66
|
end
|
67
|
+
|
68
|
+
xit "colors adjecent content" do
|
69
|
+
hello = color.decorate("hello", :black, :on_green)
|
70
|
+
world = color.decorate("world", :black, :on_red)
|
71
|
+
|
72
|
+
table = TTY::Table.new [:header], [
|
73
|
+
[hello],
|
74
|
+
[world],
|
75
|
+
[hello + world],
|
76
|
+
[hello + ' ' + world],
|
77
|
+
]
|
78
|
+
renderer = described_class.new(table, column_widths: 6, multiline: true)
|
79
|
+
|
80
|
+
rendered = renderer.render
|
81
|
+
end
|
69
82
|
end
|
70
83
|
end
|
@@ -1,6 +1,4 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
require 'spec_helper'
|
1
|
+
# frozen_string_literal: true
|
4
2
|
|
5
3
|
RSpec.describe TTY::Table::Renderer::ASCII, 'with separator' do
|
6
4
|
let(:header) { ['h1', 'h2', 'h3'] }
|
@@ -13,7 +11,7 @@ RSpec.describe TTY::Table::Renderer::ASCII, 'with separator' do
|
|
13
11
|
|
14
12
|
context 'when ascii' do
|
15
13
|
it "renders each row" do
|
16
|
-
renderer.border.separator= :each_row
|
14
|
+
renderer.border.separator = :each_row
|
17
15
|
expect(renderer.render).to eq unindent(<<-EOS)
|
18
16
|
+--+--+--+
|
19
17
|
|h1|h2|h3|
|
@@ -24,5 +22,17 @@ RSpec.describe TTY::Table::Renderer::ASCII, 'with separator' do
|
|
24
22
|
+--+--+--+
|
25
23
|
EOS
|
26
24
|
end
|
25
|
+
|
26
|
+
it "will not the default separator if individual separators are specified" do
|
27
|
+
renderer.border.separator = [1]
|
28
|
+
expect(renderer.render).to eq unindent(<<-EOS)
|
29
|
+
+--+--+--+
|
30
|
+
|h1|h2|h3|
|
31
|
+
|a1|a2|a3|
|
32
|
+
+--+--+--+
|
33
|
+
|b1|b2|b3|
|
34
|
+
+--+--+--+
|
35
|
+
EOS
|
36
|
+
end
|
27
37
|
end
|
28
38
|
end
|