From: Patrick Gundlach Date: 2006-02-09T22:43:23+09:00 Subject: Re: distributing native and ruby version of a library Hi Phil (and David), [...] > How about in your rb/mylib.rb file you do something like: > > begin > require 'ext/mylib_base' > rescue > require 'lib/mylib_base' > end > > Where ext/mylib_base would be the shared lib created from the C file and > lib/mylib_base would be the Ruby implementation. > > The user of mylib just does: > > require 'mylib' > > ...and it's all transparent to the user whether or not the C version or the > ruby version is used. OK, that makes sense. Thanks. I wonder if this could be combined with the setup.rb from RAA ( When I run ruby setup.rb config setup.rb tries to create the c-extension in ext/mylib/... but this might fail if the user doesn't have the necessary libraries installed. Is there a way in setup.rb to say 'keep going if you can't create the c extension'? I mean as a configuration file or alike, not as a parameter passed to setup.rb. This way the c-extension will installed only if available. Patrick