U
unbewust
I'm presently writing C extension to Ruby (under and for Mac OS X).
i do have a Ruby Module called "ROSXUtils" and i want to return a
class coming from another C ext to Ruby. The class being RAliasFile.
i don't know exactly how to do that.
for the time being i've put the class RAliasFile under a sub-directory
"lib" of my ext/ (of the Module ROSXUtils) :
ext/
extconf.rb
lib/
extconf.rb
dll_p.c
dll_p.h
raliasfile.bundle
raliasfile.c
rosxutils.bundle
rosxutils.c
UnixUtils.c
UnixUtils.h
BUT, for the time being in order to use, from C, the RAliasFile class,
i'm obliged to use :
rb_eval_string("require '/absolute/path/to/raliasfile'");
then to return an instance of this class :
VALUE alias = rb_eval_string("RAliasFile.new(arg)");
this works but isn't elegant ???
what could be the best way to instantiate a class being a C ext to
Ruby from a module being also a C ext to Ruby ???
also is my dir hierarchy shown above the best way ?
i'd like better having the class RAliasFile included in the
rmosxutils.bundle...
any comment appreciated ;-)
Yvon
i do have a Ruby Module called "ROSXUtils" and i want to return a
class coming from another C ext to Ruby. The class being RAliasFile.
i don't know exactly how to do that.
for the time being i've put the class RAliasFile under a sub-directory
"lib" of my ext/ (of the Module ROSXUtils) :
ext/
extconf.rb
lib/
extconf.rb
dll_p.c
dll_p.h
raliasfile.bundle
raliasfile.c
rosxutils.bundle
rosxutils.c
UnixUtils.c
UnixUtils.h
BUT, for the time being in order to use, from C, the RAliasFile class,
i'm obliged to use :
rb_eval_string("require '/absolute/path/to/raliasfile'");
then to return an instance of this class :
VALUE alias = rb_eval_string("RAliasFile.new(arg)");
this works but isn't elegant ???
what could be the best way to instantiate a class being a C ext to
Ruby from a module being also a C ext to Ruby ???
also is my dir hierarchy shown above the best way ?
i'd like better having the class RAliasFile included in the
rmosxutils.bundle...
any comment appreciated ;-)
Yvon