The Freaky Freaky Sandbox
Clone and gut Ruby itself!
Have you ever wanted to clear out all of Ruby's objects for a moment, just a moment, and then bring everything back all of the sudden? FreakyFreaky can help you with that!
require 'sandbox'
ffbox = Sandbox.new
ffbox.eval %{
class Test
end
test = Test.new
}
test = Test.new
#=> NameError: uninitialized constant Test
But why is it FreakyFreaky? Well, see, that's just it. It swaps out Ruby's main symbol table. So, you know, it's pretty hard to predict all the myriad of ways this affects Ruby.
But, For Now…
For now, it appears to do its thing just fine. So let's keep playing with it.
- InstallingTheSandbox: patching Ruby 1.8.5 and building the sandbox.
- SafeSandbox: what safety does the sandbox offer?
- FeaturefulSandbox: what about just running normal Ruby code in a sandbox?
- EmbeddingTheSandbox: how do I use the sandbox within a larger applicatioN?
The Sandbox Mailing List
To join:
Send a message to sandbox@….
Cc: why@….
