VM help

Hello,

Can anyone out there point me to some tutorial or examples on how to
use the Ruby VM? Most specifically, how to separate the VM into
multiple contexts with their own set of global objects and maybe how
to use the stack functions.

thx

AC

On 10/24/2009 07:46 PM, Alexander Cohen wrote:

Can anyone out there point me to some tutorial or examples on how to
use the Ruby VM? Most specifically, how to separate the VM into
multiple contexts with their own set of global objects and maybe how
to use the stack functions.

I don’t think there is an easy way to sandbox multiple contexts and
still use global variables etc. You would at least have to hack the
interpreter, I guess. What are you trying to accomplish?

Kind regards

robert

On Oct 25, 2009, at 5:05 AM, Robert K. wrote:

On 10/24/2009 07:46 PM, Alexander Cohen wrote:

Can anyone out there point me to some tutorial or examples on how
to use the Ruby VM? Most specifically, how to separate the VM
into multiple contexts with their own set of global objects and
maybe how to use the stack functions.

I don’t think there is an easy way to sandbox multiple contexts and
still use global variables etc. You would at least have to hack the
interpreter, I guess. What are you trying to accomplish?

I am adding ruby to be used as a scripting language in WebKit/WebCore.
It’s really working great but it’s not feasable for anything else than
playing around if i can’t sandbox multiple contexts. I could build the
ruby VM directly into the core and hack it for multiple contexts but i
was hoping i would not need to do that. Are there any other options
out there?

AC

Alexander Cohen wrote:

I am adding ruby to be used as a scripting language in WebKit/WebCore.
It’s really working great but it’s not feasable for anything else than
playing around if i can’t sandbox multiple contexts. I could build the
ruby VM directly into the core and hack it for multiple contexts but i
was hoping i would not need to do that. Are there any other options
out there?

Google for “ruby sandbox” and you should find the sandbox gem - e.g.
second hit I get is
http://flouri.sh/2009/4/4/how-to-set-up-the-ruby-sandbox

It’s a C extension but requires only one small patch to the ruby
interpreter.

IIRC it was one of _why’s projects - to skip a long (and possibly
unfinished) story, he destroyed his own code repositories. However there
appear to be various forks available on github.

gem sources

*** CURRENT SOURCES ***

http://gems.rubyforge.org/
http://gems.github.com/

gem search --remote sandbox

*** REMOTE GEMS ***

bdimcheff-sandbox (0.1.1)
file_sandbox (0.5)
nkryptic-sandbox (0.2.4)

Regards,

Brian.

Also google “ruby freaky freaky sandbox”

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs