From: nobu.nokada@... Date: 2001-12-15T00:19:00+09:00 Subject: [ruby-talk:28511] Re: Package Naming (loading) At Fri, 14 Dec 2001 23:59:16 +0900, Barnett, Aaron wrote: > my concerns on this topic are not along the lines of move files, i agree > with the comments below. mine are more along the lines of dynammic loading, > in the 'plugins' sense. in java i can load a class and get an instance of > it if i know its name, having only a string containing the name to guide me. > this makes me happy. in ruby, i may know that i want a class called 'Foo', > but i have know idea where it is. it may be in Foo.rb, or foo.rb, or > utils.rb... > > i have an application that uses subclasses of a class called Action. the > subclass name is given in a action mapping file. Where action_name is the class name and actions[action_name] means the library name to be loaded, require actions[action_name] action = Object action_name.split("::").each do |name| action = action.const_get(name) end action Nobu Nakada