[#3986] Re: Principle of least effort -- another Ruby virtue. — Andrew Hunt <andy@...>

> Principle of Least Effort.

14 messages 2000/07/14

[#4043] What are you using Ruby for? — Dave Thomas <Dave@...>

16 messages 2000/07/16

[#4139] Facilitating Ruby self-propagation with the rig-it autopolymorph application. — Conrad Schneiker <schneik@...>

Hi,

11 messages 2000/07/20

[ruby-talk:04066] Re: Exit in eRuby

From: Shugo Maeda <shugo@...>
Date: 2000-07-17 05:17:39 UTC
List: ruby-talk #4066
Hi,

At Wed, 14 Jun 2000 15:39:48 +0900,
Park Hee Sob <phasis@mail.com> wrote:
> When I tested following code with eRuby 0.0.8, eRuby error occurred.
> Can't I exit in middle of eRuby script?
(snip)
> /tmp/test.rhtml.PNQ3Oo:7:in `exit': SystemExit<br>
> <div class="backtrace">from /tmp/test.rhtml.PNQ3Oo:7<br></div>


Sorry, this is a bug.
Please apply this patch.

Shugo

diff -u -r1.9 eruby_main.c
--- eruby_main.c	2000/05/30 02:36:05	1.9
+++ eruby_main.c	2000/07/17 05:17:24
@@ -653,7 +653,7 @@
     rb_define_singleton_method(rb_defout, "cancel", defout_cancel, 0);
     eruby_init();
     script = eruby_load(eruby_filename, 0, &state);
-    if (state) {
+    if (state && !rb_obj_is_kind_of(ruby_errinfo, rb_eSystemExit)) {
 	error_print(state, eruby_mode, script);
 	if (!NIL_P(script))
 	    unlink(RSTRING(script)->ptr);


In This Thread

Prev Next