From: Jon Hart Date: 2012-01-05T10:48:57+09:00 Subject: Re: Including/selecting modules based on the methods they define --f46d04017253842b6104b5be2286 Content-Type: text/plain; charset=ISO-8859-1 On Wed, Jan 4, 2012 at 2:16 PM, Jon Hart wrote: > > Interesting. > > This gets me close, but for Go::Foo::Bar to be visible, I first have to > require that plugin. I'm looking to avoid loading every plugin unless > absolutely necessary, because I have this fear that there is a performance > hit that I'll incur by loading every plugin and including its namespace. > In my example, I only have two plugins, but in reality there can be dozens > or hundreds. > I was able to solve this by removing the imports from each plugin.rb, computing the module name as suggested, then including the module in go. For the use case of listing what plugins support what or ensuring that a given plugin supports the method, I used method_defined?. Thanks for your help. -jon --f46d04017253842b6104b5be2286--