Sha256: 32d9ae8b5e51f9fe6fa8fc3ec239733a907387992477bdbcfb050758a5091cc2

Contents?: true

Size: 425 Bytes

Versions: 1

Compression:

Stored size: 425 Bytes

Contents

# Require Gemfile gems

def safe_eval(*args)

  # require 'stringio'
  # old_values = [$stderr,$VERBOSE]
  # $stderr = StringIO.new
  # $VERBOSE= false

  ::Thread.new{

    safe_ok= false
    begin
      $SAFE= 3
      safe_ok= true
    rescue
    end
    if safe_ok
      eval(*args)
    end

  }.value

ensure
  # $stderr = old_values[0]
  # $VERBOSE= old_values[1]

end


safe_eval " puts('hello world'); Process.exit! "

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
procemon-2.0.0 test/test.rb