From: David Garamond Date: 2004-02-01T22:52:30+09:00 Subject: Re: check whether a class is defined, listing all classes Robert Klemme wrote: >>But what if the class name to be checked is a string? >>("Test::Unit::TestCase")? > > irb(main):005:0> eval "defined? " + "Test::Unit::TestCase" > => nil > irb(main):006:0> require 'test/unit/testcase' > => true > irb(main):007:0> eval "defined? " + "Test::Unit::TestCase" > => "constant" Hm, I should've added that I didn't want to involve 'eval'. But then why not, I'll just need to check the input using a simple regexp. After all, almost everything in Ruby (require, load, irb, class_eval) is using eval anyway... Thanks again. -- dave