Sha256: d8c6552d07303121a0c3ce6fdb42ca207f3e138210e22516ed2cc7ae7a3fbc81

Contents?: true

Size: 704 Bytes

Versions: 3

Compression:

Stored size: 704 Bytes

Contents

#!/usr/bin/env rubytask

# List core methods
#
# Output a list of all methods.

def list
  index_methods
  puts method_list_outline
end

# Read in the facets directory and sort-out per class

METHODS = {}
MTHPATH = "lib/facets/core"

def index_methods
  Dir.chdir(MTHPATH) do
    dg = Dir.glob('*/**/*.rb')
    dg.each { |f|
      klass, *meth= f.split('/')
      METHODS[ klass ] ||= []
      METHODS[ klass ] << "#{meth.join('/').chomp('.rb')}"
    }
    METHODS.keys.each { |k| METHODS[k].sort! }
  end
end

def method_list_outline
  s = ''
  METHODS.keys.sort.each { |k|
  ms = METHODS[k].collect{|m| m.gsub(%r{^self\/},'::')}.sort
    s << "#{k}:\n"
    ms.each { |m| s << "  #{m}\n" }
  }
  s
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
facets-1.7.30 util/list
facets-1.7.38 util/list
facets-1.7.46 util/list