This post originated from an RSS feed registered with Ruby Buzz
by Red Handed.
Original Post: The Thrilling Freaky-Freaky Sandbox Hack!!
Feed Title: RedHanded
Feed URL: http://redhanded.hobix.com/index.xml
Feed Description: sneaking Ruby through the system
Holy cats, I’m proud to offer you this sensational hack today. For me, this is monumental, as it culminates a number of sundry microhacks from the past few years and gets us a step closer to realizing Try Ruby out in the broader kingdoms. This is the sort of thing that will make you want to post spangly angel GIFs in the comments.
Okay, requires a compiler. Then: gem install sandbox --source code.whytheluckystiff.net
There are some security holes still being worked out on Ruby-Core, I need a few variables exposed. But, it’s looking really good. Many thanks to MenTaLguY who helped conceive this idea here in the comments.
So what are the implications? Oh, come on!
Load multiple Rails apps, Camping apps, Nitro apps into the same interpreter without polluting each other’s namespaces.
Allow Ruby code from users of your application without danger of affecting the app itself. (Scriptable wikis, markaby templates, ohhhh so many uses.)
Load several different versions of libraries at once (for testing and compatibility issues.)
Reloading an app within itself. (Fathom.)
Snapshoting an environment for reuse at a later stage. (The sandkit struct stores the whole environment.)
Eval has just become the least evil. alias docile eval!