lib/cjsonci/servant.rb in cjsonci-0.1.0 vs lib/cjsonci/servant.rb in cjsonci-0.2.0
- old
+ new
@@ -37,9 +37,21 @@
begin
eval_result = TOPLEVEL_BINDING.eval code.to_s
rescue Exception => ex
eval_result = ex
end
+
+ case eval_result.class.name
+ when "SignalException"
+ case eval_result.message
+ when "SIGTERM"
+ exit 0
+ end
+ when "SystemExit"
+ exit 0
+ end
+
+ eval_result
end
def self.format_message(result)
if result.is_a? Exception
{