🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.ruby
Article #967

Re: mikto ruby

#967
From: Radosław Bułat
Date: Sat, 08 Mar 2008 16:18
28 lines
1459 bytes
Zorro pisze:
> wie ktoś jak uzywa sie embeded ruby?
> np. w C?

Według Pickaxe robisz to tak:

<code>
#include "ruby.h"

int main(void) {
   ruby_init();
   ruby_init_loadpath();
   ruby_script("embedded");
   rb_load_file("start.rb");
   ruby_run(); //pętla główna, funkcja nigdy nie zwróci sterowania
   exit(0);
}
</code>

W książce znajdziesz także opis jak zagnieździć interpreter bez 
wchodzenia w pętlę główną.

Dobrym źródłem o zagnieżdżaniu Rubiego jest: 
http://aeditor.rubyforge.org/ruby_cplusplus/index.html.

-- 
Radosław Bułat
http://radarek.jogger.pl - mój blog
Technical Details
Message-ID: <fque8m$5em$1@bobo.ds5.agh.edu.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!agh.edu.pl!news.agh.edu.pl!localhost!not-for-mail
References: <fqu7es$gpo$1@nemesis.news.neostrada.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!agh.edu.pl!news.agh.edu.pl!localhost!not-for-mail
From: Radosław Bułat <radarrek@poczta.fm>
Newsgroups: pl.comp.lang.ruby
Subject: Re: mikto ruby
Date: Sat, 08 Mar 2008 17:18:31 +0100
Organization: News serwer at news.ds5.agh.edu.pl
Lines: 28
Message-ID: <fque8m$5em$1@bobo.ds5.agh.edu.pl>
References: <fqu7es$gpo$1@nemesis.news.neostrada.pl>
NNTP-Posting-Host: 192.168.128.101
Mime-Version: 1.0
X-Trace: bobo.ds5.agh.edu.pl 1204993110 5590 192.168.128.101 (8 Mar 2008 16:18:30 GMT)
X-Complaints-To: abuse@localhost
NNTP-Posting-Date: Sat, 8 Mar 2008 16:18:30 +0000 (UTC)
User-Agent: Thunderbird 2.0.0.12 (X11/20080227)
In-Reply-To: <fqu7es$gpo$1@nemesis.news.neostrada.pl>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit