🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: pl.comp.lang.ruby
2 messages
2 total messages Started by Zorro Sat, 08 Mar 2008 14:20
mikto ruby
#966
Author: Zorro
Date: Sat, 08 Mar 2008 14:20
2 lines
858 bytes
wie ktoś jak uzywa sie embeded ruby?
np. w C?
Re: mikto ruby
#967
Author: 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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads