File: list_classes.rb

package info (click to toggle)
freej 0.10git20100110-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 32,080 kB
  • ctags: 22,705
  • sloc: cpp: 156,254; ansic: 25,531; sh: 13,538; perl: 4,624; makefile: 3,278; python: 2,889; objc: 1,284; asm: 1,125; ruby: 126
file content (35 lines) | stat: -rwxr-xr-x 761 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/ruby1.9
require '.libs/Freej'

puts "Freej class methods:"
Freej.methods(false).sort.each do |m|
  puts "\t#{m.to_s}"
end

defines = Freej.constants.select{|x| Freej.const_get(x).kind_of? Fixnum}.sort
if defines.size > 0
  puts "Freej Defines:"
  defines.each do |c|
    puts "\t #{c.to_s}"
  end
end

puts "Freej Classes:"
Freej.constants.select{|x| Freej.const_get(x).kind_of? Class}.sort.each do |c|
  sc = Freej.const_get(c)
  puts "\t #{sc.to_s}"
  m = sc.methods(false)
  if m.size > 0 
    puts "\t\t class methods:"
    m.sort.each do |im|
      puts "\t\t\t #{im.to_s}"
    end
  end
  m = sc.instance_methods(false)
  if m.size > 0 
    puts "\t\t instance methods:"
    m.sort.each do |im|
      puts "\t\t\t #{im.to_s}"
    end
  end
end