eac_cli 0.41.0 → 0.42.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e47dbd4933f71d029f4fd1f19d84db730ecd3040c866c89725c6d02b81571fb3
4
- data.tar.gz: 1b5093e85452bb32a228b94d4a71bc35fc0fd9c2f036d23d2c9f52e76b05047a
3
+ metadata.gz: 37dc288478a862aec6a0c885cdc8a36a61b25c706ee3da6b448985a3bcbf1286
4
+ data.tar.gz: 66c5be70d7e1ef6ee34c35e308f5d7356b0551289301a506675e61f1048bf279
5
5
  SHA512:
6
- metadata.gz: 5eb9b2c2faa3b1e6beb70f09e16caaedf0061fbbd565c72d18228061896e0996d18f0375d3f569ca1ef3dc0ec5d333ea9157f44192c10a8981fa6e2ffaf8e086
7
- data.tar.gz: b0120fe12a7dd9599a00f8288e7be2a6adde51796c4012f0a12b3df5f294c4bccd9bfb9e81becb8d562882b821e291906c9bbe010a076ee7d56fee57cf2ccb92
6
+ metadata.gz: 347342aa9fe0242a27aaf02fc209709e924a62fea1dcb452ddaae22ed186c01f59c0ec7b4bc0d9ad112b95618d563e5e4b636b4460385716ec8100ae3e72fd72
7
+ data.tar.gz: 5290b28584f6e1d139a89a5be84180877cf3356b0726593bf7e858192840ae494370a3b8fde58a7ca99a4984dec5df85564072a409fb2f1d84177b1a8d36f2b2
@@ -30,6 +30,17 @@ module EacCli
30
30
  def build_rows
31
31
  rows.map { |row| build_row(row) }
32
32
  end
33
+
34
+ # @param row [Object]
35
+ # @param column [String]
36
+ # @return [Object]
37
+ def build_value(row, column)
38
+ return row.send(column) if row.respond_to?(column)
39
+ return row.with_indifferent_access.fetch(column) if row.is_a?(::Hash)
40
+
41
+ raise ::ArgumentError, "Row \"#{row}\" do not respond to column \"#{column}\" neither " \
42
+ "is a Hash (Row: #{row}, Column: #{column})"
43
+ end
33
44
  end
34
45
  end
35
46
  end
@@ -10,7 +10,7 @@ module EacCli
10
10
  class CsvFormatter < ::EacCli::RunnerWith::OutputList::BaseFormatter
11
11
  # @return [Array]
12
12
  def build_row(row)
13
- build_columns.map { |c| row.send(c) }
13
+ build_columns.map { |c| build_value(row, c) }
14
14
  end
15
15
 
16
16
  # @return [String]
@@ -11,7 +11,7 @@ module EacCli
11
11
  # @param row [Object]
12
12
  # @return [Array]
13
13
  def build_row(row)
14
- build_columns.map { |c| row.send(c) }
14
+ build_columns.map { |c| build_value(row, c) }
15
15
  end
16
16
 
17
17
  # @return [String]
@@ -10,7 +10,7 @@ module EacCli
10
10
  class YamlFormatter < ::EacCli::RunnerWith::OutputList::BaseFormatter
11
11
  # @return [Hash<String, String>]
12
12
  def build_row(row)
13
- build_columns.inject({}) { |a, e| a.merge(e => row.send(e).to_s) }
13
+ build_columns.inject({}) { |a, e| a.merge(e => build_value(row, e).to_s) }
14
14
  end
15
15
 
16
16
  # @return [String]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacCli
4
- VERSION = '0.41.0'
4
+ VERSION = '0.42.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.41.0
4
+ version: 0.42.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: 2024-05-16 00:00:00.000000000 Z
11
+ date: 2024-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize
@@ -56,14 +56,14 @@ dependencies:
56
56
  requirements:
57
57
  - - "~>"
58
58
  - !ruby/object:Gem::Version
59
- version: '0.121'
59
+ version: '0.122'
60
60
  type: :runtime
61
61
  prerelease: false
62
62
  version_requirements: !ruby/object:Gem::Requirement
63
63
  requirements:
64
64
  - - "~>"
65
65
  - !ruby/object:Gem::Version
66
- version: '0.121'
66
+ version: '0.122'
67
67
  - !ruby/object:Gem::Dependency
68
68
  name: tty-table
69
69
  requirement: !ruby/object:Gem::Requirement