ruby picture

RCR 98: ruby_run() calls exit?

Submitted by legacy (Wed May 08 01:05:07 UTC 2002)

Abstract

This is a legacy RCR from Ruby Garden, submitted by Warden. Matz has declared these RCRs obsolete, and asked that their authors resubmit them in the new format.

I'm working on embedding ruby in c and I discovered that the ruby_run command calls exit once it's done. Now when using ruby as a pure interpreter, that's fine. But when I need to continue to run a program once ruby is done executing, I can't have it call exit.

Is there a way around ruby calling exit? Or can it be removed? This issue also exists there's an exception thrown by ruby. can we have ruby_run return an error code so that it's more easily embeddable?

Problem

(RCR imported from old format)

Proposal

Analysis

(RCR imported from old format)

Implementation

(RCR imported from old format)
ruby picture
Comments Current voting

This comes up on the mailing list quite frequently (root, 2002-05-07 23:45:11)

There are a number of suggested ways of solving the problem, such as using rb_eval_string_protect. Try >ruby-talk:15873 for one answer.

thanks (Warden, 2002-05-08 12:46:37)

Thanks. Lesson one children.... read the email lists :)


Strongly opposed 0
Opposed 0
Neutral 0
In favor 0
Strongly advocate 0
ruby picture
If you have registered at RCRchive, you may now sign in below. If you have not registered, you may sign up for a username and password. Registering enables you to submit new RCRs, and vote and leave comments on existing RCRs.
Your username:
Your password:

ruby picture

Powered by .