Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is documentation on the embedding API for the Ruby interpreter? [closed]

I am looking for a comprehensive, online, documentation resource regarding the embedding of the Ruby interpreter into C or C++ programs, and the API(s) for that purpose.

The section on this in the Pickaxe book is quite good, but my version refers to Ruby 1.8 and I am interested in the range of current ruby versions i.e. 1.8.x, 1.9.x, and 2.0, and there are a number of differences between the handling of embedding across that range of versions.

For reference, the Ruby interpreter in question is the main Ruby interpreter from http://www.ruby-lang.org/en/

I have found on stackoverflow a number of specific questions related to aspects of this (error handling) (state reset) (c++): what I seek is the documentation, if any, from which such answers were gleaned!

There is a Ruby 1.8 and Unix centric guide, too.

There is documentation for the C API of Ruby, used in writing extensions, and also in embedding. This can be found on github (ruby 2.0) and (ruby 1.9) but handling variations in version seems left to the reader

The chapter on extending ruby in the Pickaxe book is now available online as a PDF.

like image 903
grrussel Avatar asked May 22 '13 07:05

grrussel


1 Answers

Not quite what you are looking for, I guess, but have you had a look at mruby? A ruby version specifically meant for embedding into C code. This might be easier to work with than the full MRI ruby interpreter.

like image 53
harald Avatar answered Jan 01 '23 21:01

harald