Ruby Bezel - Experiment in Dependency Heaven

I

Intransition

Hi--

I've been playing around with an alternative for loading dependent
libraries in Ruby --something that's been sitting in the back of my
mind for some time, but I hadn't taken the time to attempt a serious
implementation until now.

The core idea is pretty simple. Instead of loading a dependency into
the toplevel, Bezel loads it into an anonymous module. This then gives
the programmer a handle with which to use the library. This is done
via the #lib method. Eg. Lets say you have a gem with this basic
layout:

lib/
foo.rb

And foo.rb looks like:

class FooThing
...
end

Then with 'bezel' pre-loaded:

module MyApp
FooDependency = lib('foo', '1.0')
FooDependency::FooThing ...
...
end

This load technique completely removes any worry about version
conflicts --you can use different versions of the same library in a
single process.

But this is a major shift in the way we are accustomed to loading
libraries, so there are some important aspects to consider, such as
core extensions being outside the scope of Bezel, and the need to use
Bezel's #import method to load support files within a library.

Learn more at: http://github.com/proutils/bezel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top