Sha256: 826c22476c922805d9b37503b848962553882696efa69aa2a84789700a0a27ce
Contents?: true
Size: 437 Bytes
Versions: 19
Compression:
Stored size: 437 Bytes
Contents
module Footing module Kernel # Safely evals text inside of a sandbox. # @see http://phrogz.net/programmingruby/taint.html Ruby safe level description. # @param [String] text The text to eval. # @param [Integer] level The safe level to apply. # @return [Object] def safe_eval(text, level=4) sandbox = lambda do $SAFE = level eval(text.to_s) end sandbox.call end end end
Version data entries
19 entries across 19 versions & 1 rubygems