I’ve been teaching myself Ruby using David Black’s book, “The
Well-Grounded Rubyist”. 5 chapters in or so, things are going well.
However, things would be going even better if I was able to get
started on the project that’s motivating my course of study: there’s a
C library I’d like to write Ruby bindings for.
The Black book, while appropriate in pace and tone for an experienced
programmer, doesn’t cover any sort of Ruby C API. The pickaxe book
does, but before I go and buy a copy of that, I’d like to know if
those pickaxe chapters are really the canonical reference. That seems
weird.
What I’m looking for is the analogue to these pages:
Even if you don’t learn from it, the PickAxe Edition 1 Online will give
you an idea of the kind of coverage you can expect in the PickAxe later
editions. When I get the chance later, I’ll write back to let you know
what is actually in the later edition. I think I did buy the book.
does, but before I go and buy a copy of that, I’d like to know if
Doxygen dump…
Marvin H.
If you download the Ruby source, there’s a file called README.EXT
which gives a pretty good, detailed treatment of the Ruby C API.
Better than anything I’ve seen online. Here it is in the Ruby SVN: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8/README.EXT
On Sun, Feb 14, 2010 at 01:11:42AM +0900, Mat B. wrote:
If you download the Ruby source, there’s a file called README.EXT
which gives a pretty good, detailed treatment of the Ruby C API.
That’s exactly the kind of thing I was looking for. On its own, it’s
much more useful than the Doxygen dump – but it also makes the
Doxygen dump itself more useful.
For what it’s worth, I think that README should be given greater
prominence,
as I was unable to discover such an important document despite some
fairly
diligent web searching before asking for help here.
Basically you can use anything that enlists the API for ruby extensions,
I had a hard time figuring all
out when embedding ruby into my window manager (subtle) and writing the
C extension:
I think I’m going to need Rake, as the build process for this library is
very
involved. The Perl bindings use Module::Build, the pure-Perl successor
to
ExtUtils::MakeMaker, beause doing complicated stuff with MakeMaker is a
nightmare. I’m expecting to need something analogous for the Ruby
bindings.
I also intend to publish a gem later. It seems like docs.rubygems.org
is a
good place to start, though it references a non-existent
“DeveloperGuide”
(sigh).