Bare with me as I try to articulate this.
I am currently finishing up a new version of the wedge
gem. However
I am not satisfied with the naming and namespace usage of the project,
but I can’t figure out the best approach.
Essentially what the project does is let you inject “loaders”, or
“load wedges” if your prefer, into Ruby’s require/load mechanism.
While any object that responds to the proper minimal interface can be
a loader/load-wedge, generally one is written using a base class which
provides some useful boilerplate methods, e.g.
class MyLoader < Loader
…
end
Under the hood there are alternate #require and #load methods, as well
as two extra #find and #search methods which can be using to lookup
loadable files.
The system also comes with a few pre-built load wedges, one such
example is the RubyWedge (or RubyLoader).
So the code is essentially ready, I just can’t figure out how to
organize it. One idea is to use Load as toplevel namespace:
module Load
def self.require
def self.load
def self.find
def self.search
class Wedge
end
class RubyWedge < Wedge
end
end
But then Load.load
seams pretty silly and would I rename the project
to ‘load’ or ‘load_wedge’ ?
Another was to rename ‘Wedge’ to ‘Loader’ which is a more
comprehensible name, but then I’m really lost as to what overall
namespace to use.
On a whim I even considered:
module Free
def self.require
def self.load
def self.find
def self.search
class Loader
end
class RubyLoader < Loader
end
end
Get it? Unfortunately (well maybe) ‘free’ is already a taken gem name.
But maybe ‘freeloader’ can work?
OTOH, the gem effects Ruby is such a core way that I have even
considered putting these in RbConifg (which is all but empty anyway) b/
c loading actually depends of some of the information that
RbConfig::CONFIG provides (i.e. the site locations).
module RbConfig
def self.require
def self.load
def self.find
def self.search
class Loader
end
class RubyLoader < Loader
end
end
In that case I think RbConfig.find
is too generic and would need to
be RbConifg.load_find
or something like that. But maybe it’s just a
plain bad idea to use this namespace.
Of course, there’s also toplevel/Kernel, maybe I should just forego a
namespace altogether. But then, I still have to have a reasonable name
for the project. Would it be ‘loader’ instead of ‘wedge’?
As you can see I’ve gone round and round with ideas and nothing has
really struck me as the “Ah ha!” right way to go. So I’ve turned to
the ruby community for any suggestions. Appreciate any guidance others
can give.