Skip to content

Instantly share code, notes, and snippets.

@Linux-cpp-lisp
Created June 7, 2012 19:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Linux-cpp-lisp/2890984 to your computer and use it in GitHub Desktop.
Save Linux-cpp-lisp/2890984 to your computer and use it in GitHub Desktop.
Basic Sandboxing
require("timeout")
t=Thread.new(codeStr) do |code|
$SAFE=4
Timeout::timeout(5) {eval code} rescue nil
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment