tty-table 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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
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.10.0
4
+ version: 0.11.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: 2018-02-18 00:00:00.000000000 Z
11
+ date: 2019-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: equatable
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.5.0
19
+ version: '0.6'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.5.0
26
+ version: '0.6'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: necromancer
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.4.0
33
+ version: '0.5'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.4.0
40
+ version: '0.5'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: pastel
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -58,28 +58,28 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.6.4
61
+ version: '0.7'
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.6.4
68
+ version: '0.7'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: strings
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 0.1.0
75
+ version: 0.1.5
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 0.1.0
82
+ version: 0.1.5
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: bundler
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -87,9 +87,6 @@ dependencies:
87
87
  - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: 1.5.0
90
- - - "<"
91
- - !ruby/object:Gem::Version
92
- version: '2.0'
93
90
  type: :development
94
91
  prerelease: false
95
92
  version_requirements: !ruby/object:Gem::Requirement
@@ -97,9 +94,6 @@ dependencies:
97
94
  - - ">="
98
95
  - !ruby/object:Gem::Version
99
96
  version: 1.5.0
100
- - - "<"
101
- - !ruby/object:Gem::Version
102
- version: '2.0'
103
97
  - !ruby/object:Gem::Dependency
104
98
  name: rake
105
99
  requirement: !ruby/object:Gem::Requirement
@@ -130,22 +124,15 @@ dependencies:
130
124
  version: '3.1'
131
125
  description: A flexible and intuitive table generator
132
126
  email:
133
- - ''
127
+ - me@piotrmurach.com
134
128
  executables: []
135
129
  extensions: []
136
130
  extra_rdoc_files: []
137
131
  files:
138
- - ".gitignore"
139
- - ".rspec"
140
- - ".travis.yml"
141
132
  - CHANGELOG.md
142
- - CODE_OF_CONDUCT.md
143
- - Gemfile
144
133
  - LICENSE.txt
145
134
  - README.md
146
135
  - Rakefile
147
- - appveyor.yml
148
- - benchmarks/speed.rb
149
136
  - examples/alignment.rb
150
137
  - examples/basic.rb
151
138
  - examples/orientation.rb
@@ -261,6 +248,7 @@ files:
261
248
  - spec/unit/renderer/basic/render_spec.rb
262
249
  - spec/unit/renderer/basic/resizing_spec.rb
263
250
  - spec/unit/renderer/basic/separator_spec.rb
251
+ - spec/unit/renderer/basic/single_row_separator_spec.rb
264
252
  - spec/unit/renderer/basic/truncation_spec.rb
265
253
  - spec/unit/renderer/basic/wrapping_spec.rb
266
254
  - spec/unit/renderer/border_spec.rb
@@ -293,7 +281,13 @@ files:
293
281
  homepage: https://piotrmurach.github.io/tty/
294
282
  licenses:
295
283
  - MIT
296
- metadata: {}
284
+ metadata:
285
+ allowed_push_host: https://rubygems.org
286
+ bug_tracker_uri: https://github.com/piotrmurach/tty-table/issues
287
+ changelog_uri: https://github.com/piotrmurach/tty-table/blob/master/CHANGELOG.md
288
+ documentation_uri: https://www.rubydoc.info/gems/tty-table
289
+ homepage_uri: https://piotrmurach.github.io/tty/
290
+ source_code_uri: https://github.com/piotrmurach/tty-table
297
291
  post_install_message:
298
292
  rdoc_options: []
299
293
  require_paths:
@@ -309,8 +303,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
309
303
  - !ruby/object:Gem::Version
310
304
  version: '0'
311
305
  requirements: []
312
- rubyforge_project:
313
- rubygems_version: 2.5.1
306
+ rubygems_version: 3.0.3
314
307
  signing_key:
315
308
  specification_version: 4
316
309
  summary: A flexible and intuitive table generator
@@ -389,6 +382,7 @@ test_files:
389
382
  - spec/unit/renderer/basic/render_spec.rb
390
383
  - spec/unit/renderer/basic/resizing_spec.rb
391
384
  - spec/unit/renderer/basic/separator_spec.rb
385
+ - spec/unit/renderer/basic/single_row_separator_spec.rb
392
386
  - spec/unit/renderer/basic/truncation_spec.rb
393
387
  - spec/unit/renderer/basic/wrapping_spec.rb
394
388
  - spec/unit/renderer/border_spec.rb
data/.gitignore DELETED
@@ -1,14 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
10
- *.bundle
11
- *.so
12
- *.o
13
- *.a
14
- mkmf.log
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --color
2
- --require spec_helper
3
- --warnings
@@ -1,26 +0,0 @@
1
- ---
2
- language: ruby
3
- sudo: false
4
- cache: bundler
5
- before_install: "gem update bundler"
6
- bundler_args: --without yard benchmarks
7
- script: "bundle exec rake ci"
8
- rvm:
9
- - 2.0.0
10
- - 2.1.10
11
- - 2.2.8
12
- - 2.3.6
13
- - 2.4.3
14
- - 2.5.0
15
- - ruby-head
16
- - jruby-9.1.1.0
17
- - jruby-head
18
- matrix:
19
- allow_failures:
20
- - rvm: ruby-head
21
- - rvm: jruby-head
22
- fast_finish: true
23
- branches:
24
- only: master
25
- notifications:
26
- email: false
@@ -1,49 +0,0 @@
1
- # Contributor Code of Conduct
2
-
3
- As contributors and maintainers of this project, and in the interest of
4
- fostering an open and welcoming community, we pledge to respect all people who
5
- contribute through reporting issues, posting feature requests, updating
6
- documentation, submitting pull requests or patches, and other activities.
7
-
8
- We are committed to making participation in this project a harassment-free
9
- experience for everyone, regardless of level of experience, gender, gender
10
- identity and expression, sexual orientation, disability, personal appearance,
11
- body size, race, ethnicity, age, religion, or nationality.
12
-
13
- Examples of unacceptable behavior by participants include:
14
-
15
- * The use of sexualized language or imagery
16
- * Personal attacks
17
- * Trolling or insulting/derogatory comments
18
- * Public or private harassment
19
- * Publishing other's private information, such as physical or electronic
20
- addresses, without explicit permission
21
- * Other unethical or unprofessional conduct
22
-
23
- Project maintainers have the right and responsibility to remove, edit, or
24
- reject comments, commits, code, wiki edits, issues, and other contributions
25
- that are not aligned to this Code of Conduct, or to ban temporarily or
26
- permanently any contributor for other behaviors that they deem inappropriate,
27
- threatening, offensive, or harmful.
28
-
29
- By adopting this Code of Conduct, project maintainers commit themselves to
30
- fairly and consistently applying these principles to every aspect of managing
31
- this project. Project maintainers who do not follow or enforce the Code of
32
- Conduct may be permanently removed from the project team.
33
-
34
- This code of conduct applies both within project spaces and in public spaces
35
- when an individual is representing the project or its community.
36
-
37
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
38
- reported by contacting a project maintainer at [email]. All
39
- complaints will be reviewed and investigated and will result in a response that
40
- is deemed necessary and appropriate to the circumstances. Maintainers are
41
- obligated to maintain confidentiality with regard to the reporter of an
42
- incident.
43
-
44
- This Code of Conduct is adapted from the [Contributor Covenant][homepage],
45
- version 1.3.0, available at
46
- [http://contributor-covenant.org/version/1/3/0/][version]
47
-
48
- [homepage]: http://contributor-covenant.org
49
- [version]: http://contributor-covenant.org/version/1/3/0/
data/Gemfile DELETED
@@ -1,17 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec
4
-
5
- group :tools do
6
- gem 'yard', '~> 0.9.12'
7
- end
8
-
9
- group :metrics do
10
- gem 'coveralls', '~> 0.8.21'
11
- gem 'simplecov', '~> 0.14.1'
12
- gem 'yardstick', '~> 0.9.9'
13
- end
14
-
15
- group :benchmarks do
16
- gem 'benchmark-ips', '~> 2.7.2'
17
- end
@@ -1,21 +0,0 @@
1
- ---
2
- install:
3
- - SET PATH=C:\Ruby%ruby_version%\bin;%PATH%
4
- - ruby --version
5
- - gem --version
6
- - bundle install
7
- build: off
8
- test_script:
9
- - bundle exec rake ci
10
- environment:
11
- matrix:
12
- - ruby_version: "200"
13
- - ruby_version: "200-x64"
14
- - ruby_version: "21"
15
- - ruby_version: "21-x64"
16
- - ruby_version: "22"
17
- - ruby_version: "22-x64"
18
- - ruby_version: "23"
19
- - ruby_version: "23-x64"
20
- - ruby_version: "24"
21
- - ruby_version: "24-x64"
@@ -1,39 +0,0 @@
1
- # coding: utf-8
2
-
3
- require 'benchmark'
4
- require 'benchmark/ips'
5
-
6
- require_relative '../lib/tty-table'
7
-
8
- header = [:name, :color]
9
- rows = (1..100).map { |n| ["row#{n}", "red"] }
10
- table = TTY::Table.new(header, rows)
11
-
12
- # Benchmark speed of table operations
13
- Benchmark.ips do |r|
14
- r.report("Ruby #to_s") do
15
- rows.to_s
16
- end
17
-
18
- r.report("TTY #render") do
19
- table.render
20
- end
21
-
22
- r.report("TTY #render ASCII") do
23
- table.render(:ascii)
24
- end
25
-
26
- r.report("TTY #render Unicode") do
27
- table.render(:unicode)
28
- end
29
-
30
- r.report("TTY #render Color") do
31
- table.render(:ascii, border: {style: :red})
32
- end
33
- end
34
-
35
- # Ruby #to_s 2588.6 (±12.2%) i/s - 12948 in 5.084883s
36
- # TTY #render 20.8 (±9.6%) i/s - 104 in 5.030159s
37
- # TTY #render ASCII 18.1 (±16.5%) i/s - 89 in 5.041230s
38
- # TTY #render Unicode 18.0 (±16.7%) i/s - 88 in 5.029868s
39
- # TTY #render Color 11.7 (±17.1%) i/s - 58 in 5.071654s