From 43dd2eca15211bcf0032b006de71a9b85a225ba9 Mon Sep 17 00:00:00 2001 From: Mike DeAngelo Date: Tue, 7 Nov 2023 15:14:58 -0500 Subject: [PATCH] fix: remove eval from lib/gzr/commands/role/group_ls.rb --- lib/gzr/commands/role/group_ls.rb | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/gzr/commands/role/group_ls.rb b/lib/gzr/commands/role/group_ls.rb index b0a7ff6..0f3fa12 100644 --- a/lib/gzr/commands/role/group_ls.rb +++ b/lib/gzr/commands/role/group_ls.rb @@ -48,13 +48,8 @@ def execute(input: $stdin, output: $stdout) table_hash = Hash.new fields = field_names(@options[:fields]) table_hash[:header] = fields unless @options[:plain] - expressions = fields.collect { |fn| field_expression_hash(fn) } table_hash[:rows] = data.map do |row| - expressions.collect do |e| - v = eval "row#{e}" - next (v.join "\n") if v.kind_of? Array - v - end + field_expressions_eval(fields,row) end table = TTY::Table.new(table_hash) alignments = fields.collect do |k|