I would like to let my users create Ruby scripts that do computation on some data residing on the web server and then outputs results. The scripts are executed on the server. Is there any way to do this securely?
More specifically, I would like to:
- restrict the resources the script can use (memory and cpu), and limit its running time
- restrict which core classes the script can use (e.g. String, Fixnum, Float, Math etc)
- let the script access and return data
- output any errors to the user
Are there any libraries or projects that do what I'm asking for? If not in Ruby, maybe some other language?