On Jun 7, 2006, at 5:19 PM, Michael Judge wrote:

>
>   ["a","b"].each do |name|
>     sandbox = Module.new { require "#{name}.rb" }
>
>     survey = sandbox::Survey.new
>
>     puts survey.name
>   end
>
> This is what I'd like to do, but 'name' is out of scope and when I
> hardcode it, it seems like require is pulling class Survey from the  
> file
> into the global namespace rather than the anonymous module's  
> namespace.
> It's weird.
>
> Anyone have a solution for requiring a file into a different  
> namespace?
>
> -- 
> Posted via http://www.ruby-forum.com/.
>

Search the mailing list archives, this was discussed very recently.