Project

General

Profile

« Previous | Next » 

Revision f7217dcd

Added by Marc Dequènes almost 15 years ago

  • ID f7217dcdffe4d0fc4711c30a59da1f76064cc40a

[evol] move display options out of object management into the display functions, and display binary field presence

View differences:

lib/ldap_shadows/display_utils.rb
module Display
def self.display_fields(attr_data, options = {})
attr_data.each_pair do |key, val|
next if attr_data[:expert] and options[:expert]
field_name = Translator.translate_field_name(key)
field_name += " [#{key}]" if options[:handles]
puts field_name + ": " + (val.is_a?(Array) ? val.sort.collect{|v| v.to_s }.join(", ") : val.to_s)
str = field_name
str += " [#{key}]" if options[:handles]
if val[:binary] and options[:skip_binary]
str += " -> #{val[:value].size} file(s) available"
else
str += ": " + (val[:multiple] ? val[:value].sort.collect{|v| v.to_s }.join(", ") : val[:value].to_s)
end
puts str
end
end
......
puts "#{rel}: " + item.send(rel).collect{|g| g.name }.join(", ")
end
else
obj_info, obj_aspects = item.organized_data(:expert => options[:expert], :skip_binary => true)
obj_info, obj_aspects = item.organized_data
display_fields(obj_info, options)

Also available in: Unified diff