[Rubygems-developers] Gem Names not correlated to require name

Austin Ziegler halostatue at gmail.com
Tue Sep 30 17:07:20 EDT 2008

On Tue, Sep 30, 2008 at 4:51 PM, Jim Freeze <rubygems at freeze.org> wrote:
> One way (just one, mind you) is that if require_gem really required
> the gem. So, you would have
>  require_gem 'gem_name_here'
> and the gem did the requiring of the files internal.
> Just a thought.

No, no no no no.

That's what it used to do (with autoload).

This is bad, bad, bad, bad, bad. (Which is why it was deprecated.)

You shouldn't be using "require_gem" anyway; you should be using "gem"
to activate particular gems/versions.

I'd suggest that good practice would be including a dummy file that
matches your gem name, if appropriate.

That is, if I were to do this with PDF::Writer, I would make it so
that you could "require 'pdf-writer'" (since that's the name of the
gem), instead of "pdf/writer".

Not sure if it matters enough, though.

Austin Ziegler * halostatue at gmail.com * http://www.halostatue.ca/
               * austin at halostatue.ca * http://www.halostatue.ca/feed/
               * austin at zieglers.ca

More information about the Rubygems-developers mailing list