i managet to make the metakit (Metakit embedded database library) work
from ruby
by using swig. it was my first usage of swig and the result is not
“rubyish”, but the basic test works (can store and retrieve data).
is there any interest in this (i.e. would you like the instructions on
how i have done it)?.
i managet to make the metakit (Metakit embedded database library) work
from ruby
by using swig. it was my first usage of swig and the result is not
“rubyish”, but the basic test works (can store and retrieve data).
is there any interest in this (i.e. would you like the instructions on
how i have done it)?.
vlad
I’m interested, although I’m perfectly happy with SQLite and its Ruby
bindings. I’m just starting to get my feet wet with SWIG, so I’m
interested in that as well.
note, the mk4so will depend on the location of libmk4.so, to build the
“proper” way, copy the mk4_wrap.o and libmk4.so to a common directory,
cd there and do:
g++ -shared mk4_wrap.o libmk4.so -o mk4.so
(this way, if ld can find the libmk4.so, the mk4.so will load)
from ruby:
require ‘mk4’
include Mk4 # optional
(the mk4.so has to be somewhere ruby can find it)
notes: i am not sure whether the removal of definitions affects the
function of metakit extension but a basic test works.
vlad
ps: if you are interested, i can send you the generated wrapper (so you
can diff it against yours to see what i removed) + simple test script by
e-mail…
forgot one thing, the metakit can be built as static library
(–disable-shared option for configure), and the swig wrapper library
linked against that - this way the ruby shared object (mk4.so) will not
depend on the shared library libmk4.so (basically the ruby mk4.so will
have all the functions of metakit in it)…
vlad
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.