Sha256: 95684534a522165e6e2bc60188d8b1b2669f3686b3de4fe83676aeab532841d0
Contents?: true
Size: 1.33 KB
Versions: 12
Compression:
Stored size: 1.33 KB
Contents
#!/usr/bin/env ruby require 'enumerator' def method_list list = [] ObjectSpace.each_object(Module) do |klass| insta_methods = klass.public_instance_methods(true) + klass.private_instance_methods(true) + klass.protected_instance_methods(true) class_methods = klass.public_methods(true) + klass.private_methods(true) + klass.protected_methods(true) klass.ancestors[1..-1].each do |ancestor| #next unless ancestor.is_a?(Module) if ancestor.is_a?(Class) insta_methods -= ancestor.public_instance_methods(true) + ancestor.private_instance_methods(true) + ancestor.protected_instance_methods(true) class_methods -= ancestor.public_methods(true) + ancestor.private_methods(true) + ancestor.protected_methods(true) end end class_methods -= Kernel.public_methods(true) + Kernel.private_methods(true) + Kernel.protected_methods(true) class_methods.map!{|c| "#{klass}." + c} insta_methods.map!{|c| "#{klass}#" + c} list.concat(class_methods) list.concat(insta_methods) end return list end ARGV.each{ |lib| require lib } puts method_list.sort.join("\n")
Version data entries
12 entries across 12 versions & 1 rubygems