Couple of questions

Hi,

Is there a ruby equivalent of perl’s Data::Dumper? I’m only
interested in producing a human readable output of the objects tree,
not in evaling the data back into the program in some way.

Is there a way to list the current modules/objects available from
within the program? Python has something like this ISTR, an array
called dir or somesuch.

Thanks

···


tom@alkali.spamfree.org
remove ‘spamfree.’ to respond

Is there a ruby equivalent of perl's Data::Dumper? I'm only
interested in producing a human readable output of the objects tree,
not in evaling the data back into the program in some way.

You can look at pp (it's in 1.7)

   http://www.ruby-lang.org/en/raa-list.rhtml?name=pp

Is there a way to list the current modules/objects available from
within the program? Python has something like this ISTR, an array
called __dir__ or somesuch.

See the module ObjectSpace

    http://www.ruby-lang.org/en/man-1.4/ObSpace.html

Guy Decoux

Both just what I wanted, thanks!

···

On Sun, 18 Aug 2002 11:27:27 GMT, ts decoux@moulon.inra.fr wrote:

Is there a ruby equivalent of perl’s Data::Dumper? I’m only
interested in producing a human readable output of the objects tree,
not in evaling the data back into the program in some way.

You can look at pp (it’s in 1.7)

http://www.ruby-lang.org/en/raa-list.rhtml?name=pp

Is there a way to list the current modules/objects available from
within the program? Python has something like this ISTR, an array
called dir or somesuch.

See the module ObjectSpace

http://www.ruby-lang.org/en/man-1.4/ObSpace.html


tom@alkali.spamfree.org
remove ‘spamfree.’ to respond