tty-table 0.11.0 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/LICENSE.txt +1 -1
- data/README.md +104 -98
- data/lib/tty-table.rb +1 -1
- data/lib/tty/table.rb +70 -34
- data/lib/tty/table/alignment_set.rb +1 -3
- data/lib/tty/table/border.rb +50 -57
- data/lib/tty/table/border/ascii.rb +16 -16
- data/lib/tty/table/border/null.rb +19 -22
- data/lib/tty/table/border/row_line.rb +3 -2
- data/lib/tty/table/border/unicode.rb +16 -16
- data/lib/tty/table/border_dsl.rb +24 -22
- data/lib/tty/table/border_options.rb +32 -27
- data/lib/tty/table/column_constraint.rb +12 -9
- data/lib/tty/table/columns.rb +6 -6
- data/lib/tty/table/field.rb +46 -28
- data/lib/tty/table/header.rb +5 -5
- data/lib/tty/table/indentation.rb +7 -4
- data/lib/tty/table/operation/alignment.rb +1 -1
- data/lib/tty/table/operation/escape.rb +1 -2
- data/lib/tty/table/operation/padding.rb +1 -1
- data/lib/tty/table/operation/truncation.rb +1 -1
- data/lib/tty/table/operation/wrapped.rb +1 -1
- data/lib/tty/table/options.rb +1 -1
- data/lib/tty/table/orientation.rb +4 -4
- data/lib/tty/table/renderer.rb +8 -8
- data/lib/tty/table/renderer/ascii.rb +2 -2
- data/lib/tty/table/renderer/basic.rb +37 -40
- data/lib/tty/table/renderer/unicode.rb +1 -1
- data/lib/tty/table/row.rb +7 -7
- data/lib/tty/table/validatable.rb +23 -7
- data/lib/tty/table/version.rb +1 -1
- metadata +23 -272
- data/Rakefile +0 -10
- data/examples/alignment.rb +0 -10
- data/examples/basic.rb +0 -6
- data/examples/orientation.rb +0 -13
- data/examples/padding.rb +0 -15
- data/examples/resize.rb +0 -15
- data/spec/spec_helper.rb +0 -50
- data/spec/unit/access_spec.rb +0 -84
- data/spec/unit/add_row_spec.rb +0 -26
- data/spec/unit/alignment_set/each_spec.rb +0 -15
- data/spec/unit/alignment_set/new_spec.rb +0 -25
- data/spec/unit/alignment_set/to_ary_spec.rb +0 -12
- data/spec/unit/alignment_spec.rb +0 -69
- data/spec/unit/border/ascii/rendering_spec.rb +0 -88
- data/spec/unit/border/new_spec.rb +0 -25
- data/spec/unit/border/null/rendering_spec.rb +0 -128
- data/spec/unit/border/options/from_spec.rb +0 -36
- data/spec/unit/border/options/new_spec.rb +0 -12
- data/spec/unit/border/unicode/rendering_spec.rb +0 -61
- data/spec/unit/border_options/new_spec.rb +0 -18
- data/spec/unit/border_options/update_spec.rb +0 -16
- data/spec/unit/column_constraint/enforce_spec.rb +0 -68
- data/spec/unit/column_constraint/widths_spec.rb +0 -33
- data/spec/unit/columns/extract_widths_spec.rb +0 -41
- data/spec/unit/columns/total_width_spec.rb +0 -11
- data/spec/unit/columns/widths_from_spec.rb +0 -49
- data/spec/unit/data_spec.rb +0 -10
- data/spec/unit/each_spec.rb +0 -24
- data/spec/unit/each_with_index_spec.rb +0 -49
- data/spec/unit/empty_spec.rb +0 -21
- data/spec/unit/eql_spec.rb +0 -32
- data/spec/unit/field/equality_spec.rb +0 -49
- data/spec/unit/field/length_spec.rb +0 -33
- data/spec/unit/field/lines_spec.rb +0 -19
- data/spec/unit/field/new_spec.rb +0 -27
- data/spec/unit/field/width_spec.rb +0 -21
- data/spec/unit/filter_spec.rb +0 -20
- data/spec/unit/header/call_spec.rb +0 -28
- data/spec/unit/header/color_spec.rb +0 -17
- data/spec/unit/header/equality_spec.rb +0 -49
- data/spec/unit/header/height_spec.rb +0 -25
- data/spec/unit/header/new_spec.rb +0 -13
- data/spec/unit/header/set_spec.rb +0 -18
- data/spec/unit/header/to_ary_spec.rb +0 -12
- data/spec/unit/header_spec.rb +0 -11
- data/spec/unit/indentation/indent_spec.rb +0 -15
- data/spec/unit/new_spec.rb +0 -71
- data/spec/unit/operation/alignment/call_spec.rb +0 -37
- data/spec/unit/operation/escape/call_spec.rb +0 -13
- data/spec/unit/operation/filter/call_spec.rb +0 -14
- data/spec/unit/operation/truncation/call_spec.rb +0 -28
- data/spec/unit/operation/wrapped/call_spec.rb +0 -38
- data/spec/unit/operations/new_spec.rb +0 -28
- data/spec/unit/options/access_spec.rb +0 -12
- data/spec/unit/options_spec.rb +0 -23
- data/spec/unit/orientation_spec.rb +0 -143
- data/spec/unit/padding_spec.rb +0 -115
- data/spec/unit/properties_spec.rb +0 -23
- data/spec/unit/render_repeat_spec.rb +0 -39
- data/spec/unit/render_spec.rb +0 -61
- data/spec/unit/render_with_spec.rb +0 -104
- data/spec/unit/renderer/ascii/coloring_spec.rb +0 -83
- data/spec/unit/renderer/ascii/indentation_spec.rb +0 -39
- data/spec/unit/renderer/ascii/multiline_spec.rb +0 -99
- data/spec/unit/renderer/ascii/padding_spec.rb +0 -115
- data/spec/unit/renderer/ascii/render_spec.rb +0 -66
- data/spec/unit/renderer/ascii/resizing_spec.rb +0 -112
- data/spec/unit/renderer/ascii/separator_spec.rb +0 -38
- data/spec/unit/renderer/basic/alignment_spec.rb +0 -86
- data/spec/unit/renderer/basic/coloring_spec.rb +0 -59
- data/spec/unit/renderer/basic/extract_column_widths_spec.rb +0 -26
- data/spec/unit/renderer/basic/filter_spec.rb +0 -51
- data/spec/unit/renderer/basic/indentation_spec.rb +0 -46
- data/spec/unit/renderer/basic/multiline_spec.rb +0 -72
- data/spec/unit/renderer/basic/new_spec.rb +0 -24
- data/spec/unit/renderer/basic/options_spec.rb +0 -50
- data/spec/unit/renderer/basic/padding_spec.rb +0 -74
- data/spec/unit/renderer/basic/render_spec.rb +0 -55
- data/spec/unit/renderer/basic/resizing_spec.rb +0 -94
- data/spec/unit/renderer/basic/separator_spec.rb +0 -41
- data/spec/unit/renderer/basic/single_row_separator_spec.rb +0 -80
- data/spec/unit/renderer/basic/truncation_spec.rb +0 -33
- data/spec/unit/renderer/basic/wrapping_spec.rb +0 -38
- data/spec/unit/renderer/border_spec.rb +0 -102
- data/spec/unit/renderer/render_spec.rb +0 -34
- data/spec/unit/renderer/select_spec.rb +0 -20
- data/spec/unit/renderer/unicode/coloring_spec.rb +0 -68
- data/spec/unit/renderer/unicode/indentation_spec.rb +0 -39
- data/spec/unit/renderer/unicode/padding_spec.rb +0 -59
- data/spec/unit/renderer/unicode/render_spec.rb +0 -66
- data/spec/unit/renderer/unicode/separator_spec.rb +0 -36
- data/spec/unit/renderer_spec.rb +0 -17
- data/spec/unit/rotate_spec.rb +0 -84
- data/spec/unit/row/access_spec.rb +0 -23
- data/spec/unit/row/call_spec.rb +0 -43
- data/spec/unit/row/data_spec.rb +0 -24
- data/spec/unit/row/each_spec.rb +0 -29
- data/spec/unit/row/equality_spec.rb +0 -71
- data/spec/unit/row/height_spec.rb +0 -25
- data/spec/unit/row/new_spec.rb +0 -39
- data/spec/unit/row/to_ary_spec.rb +0 -12
- data/spec/unit/to_s_spec.rb +0 -56
- data/spec/unit/transformation/extract_tuples_spec.rb +0 -33
- data/spec/unit/utf_spec.rb +0 -31
- data/spec/unit/validatable/validate_options_spec.rb +0 -31
- data/spec/unit/validatable_spec.rb +0 -30
- data/tasks/console.rake +0 -11
- data/tasks/coverage.rake +0 -11
- data/tasks/spec.rake +0 -29
- data/tty-table.gemspec +0 -41
data/spec/unit/row/each_spec.rb
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
RSpec.describe TTY::Table::Row, '#new' do
|
4
|
-
let(:yields) { [] }
|
5
|
-
let(:value) { 'a1' }
|
6
|
-
let(:header) { ['Header1']}
|
7
|
-
let(:row) { [ value ] }
|
8
|
-
let(:object) { described_class.new row, header }
|
9
|
-
|
10
|
-
context 'with block' do
|
11
|
-
subject { object.each { |field| yields << field } }
|
12
|
-
|
13
|
-
it 'yields only fields' do
|
14
|
-
subject
|
15
|
-
yields.each { |field| expect(field).to be_instance_of(value.class) }
|
16
|
-
end
|
17
|
-
|
18
|
-
it 'yields rows with expected attributes' do
|
19
|
-
subject
|
20
|
-
yields.each { |field| expect(field).to eql(value) }
|
21
|
-
end
|
22
|
-
|
23
|
-
it 'yields each row' do
|
24
|
-
expect { subject }.to change { yields }.
|
25
|
-
from( [] ).
|
26
|
-
to( yields )
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,71 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
RSpec.describe TTY::Table::Row, '#==' do
|
4
|
-
let(:attributes) { [:id] }
|
5
|
-
let(:data) { ['1'] }
|
6
|
-
let(:object) { described_class.new(data, attributes) }
|
7
|
-
|
8
|
-
subject { object == other }
|
9
|
-
|
10
|
-
context 'with the same object' do
|
11
|
-
let(:other) { object }
|
12
|
-
|
13
|
-
it { is_expected.to eql(true) }
|
14
|
-
|
15
|
-
it 'is symmetric' do
|
16
|
-
is_expected.to eql(other == object)
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
context 'with an equivalent object' do
|
21
|
-
let(:other) { object.dup }
|
22
|
-
|
23
|
-
it { is_expected.to eql(true) }
|
24
|
-
|
25
|
-
it 'is symmetric' do
|
26
|
-
is_expected.to eql(other == object)
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
context 'with an equivalent object of subclass' do
|
31
|
-
let(:other) { Class.new(described_class).new(data, attributes: attributes) }
|
32
|
-
|
33
|
-
it { is_expected.to eql(true) }
|
34
|
-
|
35
|
-
it 'is symmetric' do
|
36
|
-
is_expected.to eql(other == object)
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
context 'with an object having a different attributes' do
|
41
|
-
let(:other_attributes) { [:text] }
|
42
|
-
let(:other) { described_class.new(data, attributes: other_attributes) }
|
43
|
-
|
44
|
-
it { is_expected.to eql(true) }
|
45
|
-
|
46
|
-
it 'is symmetric' do
|
47
|
-
is_expected.to eql(other == object)
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
context 'with an object having a different attributes' do
|
52
|
-
let(:other_data) { [2] }
|
53
|
-
let(:other) { described_class.new(other_data, attributes: attributes) }
|
54
|
-
|
55
|
-
it { is_expected.to eql(false) }
|
56
|
-
|
57
|
-
it 'is symmetric' do
|
58
|
-
is_expected.to eql(other == object)
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
context 'with an equivalent object responding to_ary' do
|
63
|
-
let(:other) { data }
|
64
|
-
|
65
|
-
it { is_expected.to eql(true) }
|
66
|
-
|
67
|
-
it 'is symmetric' do
|
68
|
-
is_expected.to eql(other == object)
|
69
|
-
end
|
70
|
-
end
|
71
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
RSpec.describe TTY::Table::Row, '#height' do
|
4
|
-
let(:object) { described_class.new row }
|
5
|
-
|
6
|
-
subject { object.height }
|
7
|
-
|
8
|
-
context 'single row' do
|
9
|
-
let(:row) { ['a1', 'b1'] }
|
10
|
-
|
11
|
-
it { expect(subject).to eql(1) }
|
12
|
-
end
|
13
|
-
|
14
|
-
context 'non escaped multiline' do
|
15
|
-
let(:row) { ["a1\na2\na3", 'b1'] }
|
16
|
-
|
17
|
-
it { expect(subject).to eql(3)}
|
18
|
-
end
|
19
|
-
|
20
|
-
context 'escaped multiline' do
|
21
|
-
let(:row) { ["a1\\na2\\na3", 'b1'] }
|
22
|
-
|
23
|
-
it { expect(subject).to eql(1) }
|
24
|
-
end
|
25
|
-
end
|
data/spec/unit/row/new_spec.rb
DELETED
@@ -1,39 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
RSpec.describe TTY::Table::Row, '#new' do
|
4
|
-
let(:object) { described_class }
|
5
|
-
|
6
|
-
subject { object.new data }
|
7
|
-
|
8
|
-
context 'with no arguments' do
|
9
|
-
let(:data) { [] }
|
10
|
-
|
11
|
-
it { is_expected.to be_instance_of(object) }
|
12
|
-
|
13
|
-
it { is_expected.to be_empty }
|
14
|
-
|
15
|
-
it { expect(subject.attributes).to eq([]) }
|
16
|
-
|
17
|
-
it { expect(subject.data).to eq({}) }
|
18
|
-
end
|
19
|
-
|
20
|
-
context 'with Array argument' do
|
21
|
-
let(:data) { ['a'] }
|
22
|
-
|
23
|
-
it { is_expected.to be_instance_of(object) }
|
24
|
-
|
25
|
-
it { expect(subject.attributes).to eq([0]) }
|
26
|
-
|
27
|
-
it { expect(subject.to_hash).to eq({0 => "a"}) }
|
28
|
-
end
|
29
|
-
|
30
|
-
context 'with Hash argument' do
|
31
|
-
let(:data) { {id: 'a'} }
|
32
|
-
|
33
|
-
it { should be_instance_of(object) }
|
34
|
-
|
35
|
-
it { expect(subject.attributes).to eq([:id]) }
|
36
|
-
|
37
|
-
it { expect(subject.to_hash).to eq({:id => 'a'}) }
|
38
|
-
end
|
39
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
RSpec.describe TTY::Table::Row, '#to_ary' do
|
4
|
-
let(:object) { described_class.new data }
|
5
|
-
let(:data) { ['a', 'b'] }
|
6
|
-
|
7
|
-
subject { object.to_ary }
|
8
|
-
|
9
|
-
it { is_expected.to be_instance_of(Array) }
|
10
|
-
|
11
|
-
it { is_expected.to eq(data) }
|
12
|
-
end
|
data/spec/unit/to_s_spec.rb
DELETED
@@ -1,56 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
|
5
|
-
RSpec.describe TTY::Table, '#to_s' do
|
6
|
-
let(:header) { ['h1', 'h2', 'h3'] }
|
7
|
-
let(:rows) { [['a1', 'a2', 'a3'], ['b1', 'b2', 'b3']] }
|
8
|
-
|
9
|
-
subject(:table) { described_class.new(header, rows) }
|
10
|
-
|
11
|
-
context 'without renderer' do
|
12
|
-
it 'displayes basic table' do
|
13
|
-
expect(table.render(:basic)).to eq unindent(<<-EOS)
|
14
|
-
h1 h2 h3
|
15
|
-
a1 a2 a3
|
16
|
-
b1 b2 b3
|
17
|
-
EOS
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
context 'without border' do
|
22
|
-
it 'displays table' do
|
23
|
-
expect(table.to_s).to eq unindent(<<-EOS)
|
24
|
-
h1 h2 h3
|
25
|
-
a1 a2 a3
|
26
|
-
b1 b2 b3
|
27
|
-
EOS
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
context 'with ascii border' do
|
32
|
-
it 'displays table' do
|
33
|
-
expect(table.render(:ascii)).to eq unindent(<<-EOS)
|
34
|
-
+--+--+--+
|
35
|
-
|h1|h2|h3|
|
36
|
-
+--+--+--+
|
37
|
-
|a1|a2|a3|
|
38
|
-
|b1|b2|b3|
|
39
|
-
+--+--+--+
|
40
|
-
EOS
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
context 'with unicode border' do
|
45
|
-
it 'displays table' do
|
46
|
-
expect(table.render(:unicode)).to eq unindent(<<-EOS)
|
47
|
-
┌──┬──┬──┐
|
48
|
-
│h1│h2│h3│
|
49
|
-
├──┼──┼──┤
|
50
|
-
│a1│a2│a3│
|
51
|
-
│b1│b2│b3│
|
52
|
-
└──┴──┴──┘
|
53
|
-
EOS
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end # to_s
|
@@ -1,33 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
RSpec.describe TTY::Table::Transformation, '#extract_tuples' do
|
4
|
-
let(:object) { described_class }
|
5
|
-
let(:header) { ['Header1', 'Header2'] }
|
6
|
-
let(:rows) { [['a1', 'a2'], ['b1', 'b2']] }
|
7
|
-
|
8
|
-
subject { object.extract_tuples(value) }
|
9
|
-
|
10
|
-
context 'when rows' do
|
11
|
-
let(:value) { [rows] }
|
12
|
-
|
13
|
-
it { expect(subject[:header]).to be_nil }
|
14
|
-
|
15
|
-
it { expect(subject[:rows]).to eql(rows) }
|
16
|
-
end
|
17
|
-
|
18
|
-
context 'when header and rows' do
|
19
|
-
let(:value) { [header, rows] }
|
20
|
-
|
21
|
-
it { expect(subject[:header]).to eql(header) }
|
22
|
-
|
23
|
-
it { expect(subject[:rows]).to eql(rows) }
|
24
|
-
end
|
25
|
-
|
26
|
-
context 'when hash' do
|
27
|
-
let(:value) { [[{'Header1' => ['a1', 'a2'], 'Header2' => ['b1', 'b2'] }]] }
|
28
|
-
|
29
|
-
it { expect(subject[:header]).to eql(header) }
|
30
|
-
|
31
|
-
it { expect(subject[:rows]).to eql(rows) }
|
32
|
-
end
|
33
|
-
end
|
data/spec/unit/utf_spec.rb
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
RSpec.describe TTY::Table, 'unicode support' do
|
4
|
-
it "measures utf characters correctly for :basic" do
|
5
|
-
table = TTY::Table[['こんにちは', 'a2'], ['b1','選択']]
|
6
|
-
expect(table.render(:basic)).to eq unindent(<<-EOS)
|
7
|
-
こんにちは a2
|
8
|
-
b1 選択
|
9
|
-
EOS
|
10
|
-
end
|
11
|
-
|
12
|
-
it "measure utf characters correctly for :ascii" do
|
13
|
-
table = TTY::Table[['こんにちは', 'a2'], ['b1','選択']]
|
14
|
-
expect(table.render(:ascii)).to eq unindent(<<-EOS)
|
15
|
-
+----------+----+
|
16
|
-
|こんにちは|a2 |
|
17
|
-
|b1 |選択|
|
18
|
-
+----------+----+
|
19
|
-
EOS
|
20
|
-
end
|
21
|
-
|
22
|
-
it "measure utf characters correctly for :unicode" do
|
23
|
-
table = TTY::Table[['こんにちは', 'a2'], ['b1','選択']]
|
24
|
-
expect(table.render(:unicode)).to eq unindent(<<-EOS)
|
25
|
-
┌──────────┬────┐
|
26
|
-
│こんにちは│a2 │
|
27
|
-
│b1 │選択│
|
28
|
-
└──────────┴────┘
|
29
|
-
EOS
|
30
|
-
end
|
31
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
RSpec.describe TTY::Table::Validatable, '#validate_options!' do
|
4
|
-
let(:described_class) { Class.new { include TTY::Table::Validatable } }
|
5
|
-
|
6
|
-
subject { described_class.new.validate_options! options }
|
7
|
-
|
8
|
-
context 'with empty rows' do
|
9
|
-
let(:options) { {rows: []} }
|
10
|
-
|
11
|
-
it { expect { subject }.not_to raise_error() }
|
12
|
-
end
|
13
|
-
|
14
|
-
context 'with invalid rows type' do
|
15
|
-
let(:options) { {rows: 1 } }
|
16
|
-
|
17
|
-
it { expect { subject }.to raise_error(TTY::Table::InvalidArgument) }
|
18
|
-
end
|
19
|
-
|
20
|
-
context 'with empty header' do
|
21
|
-
let(:options) { {header: []} }
|
22
|
-
|
23
|
-
it { expect { subject }.to raise_error(TTY::Table::InvalidArgument) }
|
24
|
-
end
|
25
|
-
|
26
|
-
context 'with invalid header type' do
|
27
|
-
let(:options) { {header: 1} }
|
28
|
-
|
29
|
-
it { expect { subject }.to raise_error(TTY::Table::InvalidArgument) }
|
30
|
-
end
|
31
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
RSpec.describe TTY::Table::Validatable do
|
4
|
-
let(:described_class) { Class.new { include TTY::Table::Validatable } }
|
5
|
-
let(:rows) { [['a1', 'a2'], ['b1']] }
|
6
|
-
|
7
|
-
subject { described_class.new }
|
8
|
-
|
9
|
-
it 'raises no exception' do
|
10
|
-
rows[1] << ['b2']
|
11
|
-
expect { subject.assert_row_sizes(rows) }.not_to raise_error
|
12
|
-
end
|
13
|
-
|
14
|
-
it 'raises exception for mismatched rows' do
|
15
|
-
expect { subject.assert_row_sizes(rows) }.
|
16
|
-
to raise_error(TTY::Table::DimensionMismatchError)
|
17
|
-
end
|
18
|
-
|
19
|
-
it "raises exception when :header key has wrong data type" do
|
20
|
-
options = {header: 'h1'}
|
21
|
-
expect { subject.validate_options!(options) }.
|
22
|
-
to raise_error(TTY::Table::InvalidArgument)
|
23
|
-
end
|
24
|
-
|
25
|
-
it "raises exception when :rows key has wrong data type" do
|
26
|
-
options = {rows: 'a1'}
|
27
|
-
expect { subject.validate_options!(options) }.
|
28
|
-
to raise_error(TTY::Table::InvalidArgument)
|
29
|
-
end
|
30
|
-
end
|
data/tasks/console.rake
DELETED
data/tasks/coverage.rake
DELETED
data/tasks/spec.rake
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
begin
|
4
|
-
require 'rspec/core/rake_task'
|
5
|
-
|
6
|
-
desc 'Run all specs'
|
7
|
-
RSpec::Core::RakeTask.new(:spec) do |task|
|
8
|
-
task.pattern = 'spec/{unit,integration}{,/*/**}/*_spec.rb'
|
9
|
-
end
|
10
|
-
|
11
|
-
namespace :spec do
|
12
|
-
desc 'Run unit specs'
|
13
|
-
RSpec::Core::RakeTask.new(:unit) do |task|
|
14
|
-
task.pattern = 'spec/unit{,/*/**}/*_spec.rb'
|
15
|
-
end
|
16
|
-
|
17
|
-
desc 'Run integration specs'
|
18
|
-
RSpec::Core::RakeTask.new(:integration) do |task|
|
19
|
-
task.pattern = 'spec/integration{,/*/**}/*_spec.rb'
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
rescue LoadError
|
24
|
-
%w[spec spec:unit spec:integration].each do |name|
|
25
|
-
task name do
|
26
|
-
$stderr.puts "In order to run #{name}, do `gem install rspec`"
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
data/tty-table.gemspec
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
lib = File.expand_path('../lib', __FILE__)
|
2
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
-
require 'tty/table/version'
|
4
|
-
|
5
|
-
Gem::Specification.new do |spec|
|
6
|
-
spec.name = 'tty-table'
|
7
|
-
spec.version = TTY::Table::VERSION
|
8
|
-
spec.authors = ["Piotr Murach"]
|
9
|
-
spec.email = ["me@piotrmurach.com"]
|
10
|
-
spec.summary = %q{A flexible and intuitive table generator}
|
11
|
-
spec.description = %q{A flexible and intuitive table generator}
|
12
|
-
spec.homepage = "https://piotrmurach.github.io/tty/"
|
13
|
-
spec.license = "MIT"
|
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']
|
27
|
-
spec.test_files = spec.files.grep(%r{^(spec|features)/})
|
28
|
-
spec.require_paths = ["lib"]
|
29
|
-
|
30
|
-
spec.required_ruby_version = '>= 2.0.0'
|
31
|
-
|
32
|
-
spec.add_dependency 'equatable', '~> 0.6'
|
33
|
-
spec.add_dependency 'necromancer', '~> 0.5'
|
34
|
-
spec.add_dependency 'pastel', '~> 0.7.2'
|
35
|
-
spec.add_dependency 'tty-screen', '~> 0.7'
|
36
|
-
spec.add_dependency 'strings', '~> 0.1.5'
|
37
|
-
|
38
|
-
spec.add_development_dependency 'bundler', '>= 1.5.0'
|
39
|
-
spec.add_development_dependency 'rake'
|
40
|
-
spec.add_development_dependency 'rspec', '~> 3.1'
|
41
|
-
end
|