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

Version Path
facets-2.9.2 work/defunct/script/methods
facets-2.8.4 script/methods
facets-2.8.3 script/methods
facets-2.8.2 script/methods
facets-2.8.1 script/methods
facets-2.8.0 script/methods
facets-2.6.0 task/methods
facets-2.4.1 script/methods
facets-2.5.1 task/methods
facets-2.5.0 task/methods
facets-2.4.5 task/methods
facets-2.5.2 task/methods