I am currently (slowly) rewriting my old MUD.
While looking at require lines, it is rather tedious
to define the path to all addons - e. g. the path
to any given .rb file. I already am at about 150-200
.rb files or so and I still have to port around 200
more, and it already feels way too tedious to me (hence
why I so often pause on projects when they become too
But first things first - I require the MUD like so:
Now I also have a unicorn, which is (in the definition)
an animal. So it must also include module Animal, which
I put into std_animals.rb for now.
So the require right now is:
Perhaps I move this to another location, but here I was
wondering - this require-based way to specify the path
to the .rb in question is tedious. More importantly,
when I do happen to change the name or location of
that file, I have to change ALL other files too.
So I was wondering:
Is there some way to specify a default location to
be used on a per-project base?
And I could manually update just a special file, which
will act on whether the input is a Symbol or not.
I can perhaps patch require (how?), but I also want to
restore the original default way how require works
again after my MUD has been loaded.
I kind of need a template-to-filename mapper and it
should work only for the MUD here (let’s assume the
namespace is module MUD) and nowhere else, even if
I do happen to combine the MUD with other projects
How would I go about modifying require, and are there