embedding ruby - some questions

Discussion in 'Ruby' started by Basile STARYNKEVITCH, Aug 31, 2003.

  1. Dear All


    I am trying to embed Ruby inside an application, a GTK widget server
    which recieves ruby instructions to manage a Graphical User Interface
    - see http://starynkevitch.net/Basile/guisdoc.html for more; I just
    coded a Python based GTK widget server and want to port it to Ruby,
    which should be easy, since my code was designed to plug into several
    different scripting engines (provided they can load a script file and
    interpret a C string).

    I have some scoping problems; it seems that definition of functions
    parsed by rb_load_file are not visible later when evaluating a C
    string using rb_eval_string_protect? so I am running rb_load_file on a
    file (guisdemo_rubyscript in my code) which contains

    def start(welcomsg)
    $stderr.printf("start %s\n", welcomsg)
    #etc
    end

    and then I fo rb_eval_string_protect of a string like the following 2 lines
    #request1
    start("foobar")

    and the start function is unknown

    You can download my sample code (which uses ruby-gnome2-all-0.6.0 and
    ruby 1.8 [1]) under http://starynkevitch.net/Basile/guis-1.2.post1.tgz
    then add . to your $PATH, do a make; make a symbolic link fro ruguis
    to ruguis-scripter in your path and run

    ./guisdemo_rubyscript -T -D -p ./guisdemo_client


    Also, I would like ruby to avoid catching SIGINT; Can I do a simple
    signal(SIGINT,SIG_DFL) or should I be more careful? (when sent a
    SIGINT my app crashs inside Ruby).

    At last, I would like to be able to set the "source file name"
    (actually to a string like 'request#123') explicitly before calling
    rb_eval_string but tb_eval_string does a rb_source_filename already


    Note 1: even if ruby-gnome2-all-0.6.0 is not really for ruby-1.8 I
    believe this is not my problem, since it appears without calling any
    ruby-gnome2 (actually ruby-gtk2) primitives

    --

    Basile STARYNKEVITCH http://starynkevitch.net/Basile/
    email: basile<at>starynkevitch<dot>net
    aliases: basile<at>tunes<dot>org = bstarynk<at>nerim<dot>net
    8, rue de la Faïencerie, 92340 Bourg La Reine, France
    Basile STARYNKEVITCH, Aug 31, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jordi
    Replies:
    0
    Views:
    391
    jordi
    Jul 16, 2003
  2. Basile STARYNKEVITCH

    questions about embedding ruby

    Basile STARYNKEVITCH, Sep 1, 2003, in forum: Ruby
    Replies:
    3
    Views:
    131
  3. Charles Comstock
    Replies:
    1
    Views:
    111
    Lyle Johnson
    Jun 25, 2004
  4. Rolando Abarca

    questions about embedding ruby 1.9

    Rolando Abarca, Apr 21, 2009, in forum: Ruby
    Replies:
    5
    Views:
    218
    Rolando Abarca
    Apr 22, 2009
  5. Íßêïò Ãêñ33ê
    Replies:
    2
    Views:
    136
    Joel Goldstick
    Mar 5, 2013
Loading...

Share This Page