On Feb 22, 8:56 pm, ara.t.how... / noaa.gov wrote:
> On Fri, 23 Feb 2007, Hans Sjunnesson wrote:
> >> Ben
>
> > Helpful - yes, in finding out that using eval might not be what I'm
> > after.
> > I thought, at first, that a binding housed the entirety of a running
> > ruby process' context.
>
> > I'm wanting to run ruby snippets like the below:
>
> > require 'rake'
> > default = task :default do
> >  # do stuff
> > end
> > default.invoke
>
> > But for my problem, I might be better off using Kernel::system, and
> > invoking ruby in an external process, even though I'd really like my
> > little code-snippet to be able to access, for instance, the Logger
> > I've set up in my queue-system.
> > I might get away with that by modifying your BindingFactory to pass
> > objects into the created binding as local variables. But stuff like
> > rake modify the running context in more ways than setting local
> > variables.
>
> why don't you fork?
>
> -a
> --
> be kind whenever possible... it is always possible.
> - the dalai lama

Actually, that works perfectly. I was under the impression that
Kernel.fork wrapped native fork() and thus wasn't portable. But it
works well for what I need.