From c1196fb400803c416ed8ec2c394d8b9de207df7c Mon Sep 17 00:00:00 2001 From: Denis Knauf Date: Wed, 31 Mar 2010 23:22:03 +0200 Subject: [PATCH] better metrics --- lib/safebox/safebox.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/safebox/safebox.rb b/lib/safebox/safebox.rb index a848bdb..bf36c83 100644 --- a/lib/safebox/safebox.rb +++ b/lib/safebox/safebox.rb @@ -31,12 +31,13 @@ module Safebox end def eval *paras, &exe - ret = self.run( *paras, &exe) - case ret.first + type, value = self.run( *paras, &exe) + case type when :exception # Really unsecure. Somebody can create an own exception with own #to_s, #class or #backtrace. - on_exception ret.last + on_exception value nil - when :value then ret.last + when :value then value + else # Not possible end end public :eval