On Tue, Sep 30, 2008 at 4:07 PM, Austin Ziegler <[EMAIL PROTECTED]> wrote:
> On Tue, Sep 30, 2008 at 4:51 PM, Jim Freeze <[EMAIL PROTECTED]> 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.)

Are you sure? I thought require_gem was the same as require, in that
it required a file, but searched for it in the gem paths.

I have never created a gem that one could load with

  require 'gem_name'

because that would require my gem to have an init hook and that hook
is where the real require would happen. Maybe I am getting old and
forgetful, but I don't remember ever doing that for the gems that I
have written.

> 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.

Yes, I have seen this with activesupport.rb and active_support.rb

> 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".
>


-- 
Jim Freeze
_______________________________________________
Rubygems-developers mailing list
Rubygems-developers@rubyforge.org
http://rubyforge.org/mailman/listinfo/rubygems-developers

Reply via email to