From: El Gato Date: 2007-05-05T08:27:29+09:00 Subject: Re: Playing with Webrick Jano Svitok wrote: > > This is code from ERB handler: > > private > def evaluate(erb, servlet_request, servlet_response) > Module.new.module_eval{ > meta_vars = servlet_request.meta_vars > query = servlet_request.query > erb.result(binding) > } > end > > 1. Webrick defines new module and thus new binding for each request, > so that request do not interfere with each other. If you'd use one > binding it would work different (whether it's good or not depends on > your needs) Yeah, it appears that if I just monkey patch and skip the enclosing Module.new.module_eval things work as I'd like (full access to variables and methods). I just feel like I must be doing something really dirty here, though I'm not smart enough to understand exactly what. Has anyone done anything like this with webrick before? I really don't need the whole Rails framework (or probably even camping for that matter). Plus, I'm partially trying to avoid getting the admins to install gems, and I'm partially just trying to understand how this would work. I'm still looking through Rails stuff to see how they do it... haven't found it yet. That's a pretty big code base. -- Posted via http://www.ruby-forum.com/.