I would li开发者_如何转开发ke to create a small Rails application that would allow users to give a few snippets of code to benchmark in multiple implementations and versions of Ruby. I am capable of creating the application, I am just afraid of users mucking around in the filesystem or doing other destructive actions. Is there any way to prevent this?
There is $SAFE
:
The variable
$SAFE
determines Ruby's level of paranoia.
The various "safety levels" are noted at the link, there's also some examples (which still work) of using a thread, $SAFE
, and load
to wrap untrusted code. $SAFE on ruby might be worth a look as well.
精彩评论