From: Matthew Kerwin Date: 2013-05-29T07:52:52+09:00 Subject: Re: GEM and module? Could a GEM be a module? Henry Maddocks wrote in post #1110429: > On 29/05/2013, at 1:11 AM, Denis BEURIVE wrote: > >> I have written a library that calculates dates based on CRON >> specifications. I'd like to publish it as a GEM. >> >> In order to avoid name collisions, I create a module ("Cron") that holds >> all the classes that build the library. In fact the is two classes : >> >> Cron::Calendar >> Cron::NoNextExecution > > It is good practice to wrap your classes in a module. Lots of gems do > this. Agreed. If someone wants the Calendar and NoNextExecution classes in the main namespace it's trivial to do: require 'cron' include Cron But it's impossible to do the inverse. >> Is it correct to say : "my GEM is a module" ? > > Your gem is gem, it doesn't matter if there is a module. You could say: "my gem defines a module ..." -- Posted via http://www.ruby-forum.com/.