eac_cli 0.38.1 → 0.39.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8a58c5ccac3080dd986b2727ce365a7979a801f059016faa0f7fe8dd8b86e1d3
4
- data.tar.gz: 06cb591e776e862bfcbe048fb524f05a8bd06b3e85a86a14c28df40654355eba
3
+ metadata.gz: 4eb32e4256c41224161c945741a0f3d2b3118c1cadaa1f3803d06a963c014f73
4
+ data.tar.gz: adbea33366cb3f15a78d034d9e6fe1e717ea04d1d7a5d00def1233eecc4ab10d
5
5
  SHA512:
6
- metadata.gz: 3ebf30f86ad003589e75880af90d75058a55c9e76ed386f0a1972c175ed22c2ea8c135c765ff2cf1d7476591126eac66ea680b6f38c96a95a800069a140060fd
7
- data.tar.gz: 1d2ea1f751023f5a11e2ef8465bab272429e29088e27123830fae2cb041d7ce4524c931c08a2088597664edc638bf6eb775c7a8e2b6ede1af05e09fe02bc7d7f
6
+ metadata.gz: 3c45d3e0176a8f85691d7d64d54a4cfe7febeb25e982af587824afe84ce368515983dbb3a308aec46c0603340c2afeab6fccce914faaa4d2fc3fdce38177963c
7
+ data.tar.gz: 864ed661fddcae5c1e7ee6f1b1b81b6d20d98d184d6c24cecd8a7641b0afa9a28aa39215764b43a3dd5d7316ad7dcae02cdfcdd42fb6af47a8aae67183e62773
@@ -20,6 +20,12 @@ module EacCli
20
20
  columns.map(&:to_s)
21
21
  end
22
22
 
23
+ # @param row [Object]
24
+ # @return [Object]
25
+ def build_row(_row)
26
+ raise_abstract_method __method__
27
+ end
28
+
23
29
  # @return [Array<Hash<String, String>>]
24
30
  def build_rows
25
31
  rows.map { |row| build_row(row) }
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+ require 'eac_cli/runner_with/output_list/base_formatter'
5
+ require 'tty/table'
6
+
7
+ module EacCli
8
+ module RunnerWith
9
+ module OutputList
10
+ class TtyFormatter < ::EacCli::RunnerWith::OutputList::BaseFormatter
11
+ # @param row [Object]
12
+ # @return [Array]
13
+ def build_row(row)
14
+ build_columns.map { |c| row.send(c) }
15
+ end
16
+
17
+ # @return [String]
18
+ def to_output
19
+ "#{tty_table_output}\n"
20
+ end
21
+
22
+ # @return [TTY::Table]
23
+ def tty_table
24
+ ::TTY::Table.new(build_columns, build_rows)
25
+ end
26
+
27
+ # @return [String]
28
+ def tty_table_output
29
+ tty_table.render(:unicode, multiline: true) do |renderer|
30
+ renderer.border.separator = ->(row) { ((row + 1) % columns.count).zero? }
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -11,6 +11,7 @@ module EacCli
11
11
 
12
12
  FORMATS = {
13
13
  'csv' => ::EacCli::RunnerWith::OutputList::CsvFormatter,
14
+ 'tty' => ::EacCli::RunnerWith::OutputList::TtyFormatter,
14
15
  'yaml' => ::EacCli::RunnerWith::OutputList::YamlFormatter
15
16
  }.freeze
16
17
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacCli
4
- VERSION = '0.38.1'
4
+ VERSION = '0.39.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eac_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.38.1
4
+ version: 0.39.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esquilo Azul Company
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-08 00:00:00.000000000 Z
11
+ date: 2023-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize
@@ -70,6 +70,20 @@ dependencies:
70
70
  - - ">="
71
71
  - !ruby/object:Gem::Version
72
72
  version: 0.119.2
73
+ - !ruby/object:Gem::Dependency
74
+ name: tty-table
75
+ requirement: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - "~>"
78
+ - !ruby/object:Gem::Version
79
+ version: '0.12'
80
+ type: :runtime
81
+ prerelease: false
82
+ version_requirements: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - "~>"
85
+ - !ruby/object:Gem::Version
86
+ version: '0.12'
73
87
  - !ruby/object:Gem::Dependency
74
88
  name: eac_ruby_gem_support
75
89
  requirement: !ruby/object:Gem::Requirement
@@ -158,6 +172,7 @@ files:
158
172
  - lib/eac_cli/runner_with/output_list.rb
159
173
  - lib/eac_cli/runner_with/output_list/base_formatter.rb
160
174
  - lib/eac_cli/runner_with/output_list/csv_formatter.rb
175
+ - lib/eac_cli/runner_with/output_list/tty_formatter.rb
161
176
  - lib/eac_cli/runner_with/output_list/yaml_formatter.rb
162
177
  - lib/eac_cli/runner_with/subcommands.rb
163
178
  - lib/eac_cli/runner_with/subcommands/definition_concern.rb