Hi Marvin,

One of the interesting things about ruby is that you can effectively open up a 
class or module and add to it at any time. This is usually referred to as 
monkey patching. The only way there would be conflicts is if you had two 
modules defining the same function. Even in that case, you wouldn't get an 
error, you would just have the last module overwrite any prior modules. But as 
long as the modules define separate functions, or sub modules, you shouldn't 
have any problems.

-Joe Fox
codenoise.com


On Jan 5, 2012, at 7:06 AM, Marvin Humphrey <[email protected]> wrote:

> Greets,
> 
> I'd like to release a gem foo-bar, which contains the classes
> Foo::Bar::Stuff and Foo::Bar::Things.  Is it possible to do this without
> claiming the namespace "Foo"?
> 
> The motivation here is to release multiple *unrelated* gems under the same
> top-level namespace.  None of them should require a prerequisite 'foo'.
> 
> I'm having difficulty seeing how this would work because it doesn't seem to be
> possible to create a class "Foo::Bar" unless a class or module named "Foo"
> already exists.  Thus, each gem would need to create "Foo", presumably
> introducing a conflict if they are ever loaded within the same process.
> 
> Marvin Humphrey
> 
> -- 
> SD Ruby mailing list
> [email protected]
> http://groups.google.com/group/sdruby

-- 
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby

Reply via email to