Method: Hostlist#sort_by_domainname

Defined in:
lib/mofa/hostlist.rb

#sort_by_domainnameObject



82
83
84
85
86
87
88
# File 'lib/mofa/hostlist.rb', line 82

def sort_by_domainname
  sortable = {}
  @list.each do |hostname|
    sortable.store(hostname.split(/\./).reverse.join('.'), hostname)
  end
  @list = sortable.keys.sort.collect { |s| sortable[s] }
end