Sounds good! Looks like this is what I was looking for. thanks,
-vivek. On Thu, Oct 29, 2009 at 5:42 AM, Yoko Harada <[email protected]> wrote: > Hi Vivek, > > On Thu, Oct 29, 2009 at 12:13 AM, Vivek Pandey <[email protected]> > wrote: > > From inside GlassFish, we call Ruby.evalScriptlet(String) for parsing > ruby > > code and getting back IRubyObject. Whats the equivalent API to take > > InputStream instead of String? > > At many times we need to parse the complete Ruby file, such as in case of > > rackup script. So instead of reading the file in to String, is there any > API > > as efficient as evalScript() or better to pass the InputStream instead of > > String? > > thanks, > > -vivek. > > Have a look at embedding API wiki, > http://kenai.com/projects/jruby-embed/pages/Home. Embedding API have > been a part of JRuby since 1.4.0RC1. You can load scripts from a > String, Reader, InputStream and classpath using embedding API. Also, > embedding API has a parse-once-eval-many-times feature, which might be > useful for a web application. See, servlet section, > ttp://kenai.com/projects/jruby-embed/pages/ServletExamples, of > embedding API. > > Let me warn you this. Soon, the default local context scope will be > changed to singleton from threadsafe(ThreadLocal) in JRuby trunk, > 1.5.0.dev. So, you might need to specify LocalContextScope.THREADSAFE > when you instantiate ScriptingContainer. > > -Yoko > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > >
