#! /usr/bin/env ruby # # $Id: methodindex.rb,v 1.1 2003/03/27 12:59:54 fukumoto Exp $ # list = {} ObjectSpace.each_object(Module) do |mod| if mod.kind_of? Class _type = 'class' else _type = 'module' end mods = mod.to_s mods = "Errno::*" if /^Errno::/ === mods mod.singleton_methods.each do |m| m = "#{m} (#{_type} method)" list[m] ||= [] list[m] |= [mods] end mod.instance_methods.each do |m| list[m] ||= [] list[m] |= [mods] end mod.private_instance_methods.each do |m| m = "#{m} (private method)" list[m] ||= [] list[m] |= [mods] end end list.keys.sort.each do |m| print "#{m}\t#{list[m].join(', ')}\n" end