lib/gzr/commands/model/ls.rb in gazer-0.3.12 vs lib/gzr/commands/model/ls.rb in gazer-0.3.13
- old
+ new
@@ -45,14 +45,11 @@
end unless data && data.length > 0
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|
- eval "row#{e}"
- end
+ field_expressions_eval(fields,row)
end
table = TTY::Table.new(table_hash)
alignments = fields.collect do |k|
(k =~ /id$/) ? :right : :left
end