# Ruby Bezel - Experiment in Dependency Heaven

**URL:** <https://www.ruby-forum.com/t/ruby-bezel-experiment-in-dependency-heaven/183802>\
**Category:** Ruby\
**Created:** [February 20, 2010, 2:18pm UTC](https://www.ruby-forum.com/t/ruby-bezel-experiment-in-dependency-heaven/183802 "2010-02-20T14:18:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tcsnide](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/eb8c5e/32.png) [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Post date:** [February 20, 2010, 2:18pm UTC](https://www.ruby-forum.com/t/ruby-bezel-experiment-in-dependency-heaven/183802/1 "2010-02-20T14:18:24Z")

</div>

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](http://github.com/proutils/bezel)
