Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #8845 (closed enhancement: fixed)

Opened 3 years ago

Last modified 2 years ago

[PATCH] Allow require statements to use gem names, e.g. 'activerecord' vs 'active_record'

Reported by: nicwilliams Assigned to: core
Priority: normal Milestone: 1.x
Component: ActiveRecord Version: edge
Severity: minor Keywords: gems require tiny
Cc:

Description

Currently, to load the activerecord gem you use require 'active_record'. This is very confusing, even though active_record matches to the internal module ActiveRecord.

If you accidently load the gem using require 'activerecord' it will fail. This is very annoying.

Here is a patch to allow people to load each of the rails gems (where the gem name doesn't match the loader name - all but 'rails').

Attachments

require_using_gem_name.patch (1.5 kB) - added by nicwilliams on 07/02/07 21:00:14.

Change History

07/02/07 21:00:14 changed by nicwilliams

  • attachment require_using_gem_name.patch added.

07/02/07 21:41:38 changed by norbert

  • keywords changed from gem gems rubygems require to gems require tiny verified.
  • summary changed from [patch] Allow require statements to use gem names, e.g. 'activerecord' vs 'active_record' to [PATCH] Allow require statements to use gem names, e.g. 'activerecord' vs 'active_record'.

Indeed an annoying problem which I have run into many a time. +1

07/19/07 12:32:13 changed by mpalmer

  • keywords changed from gems require tiny verified to gems require tiny.

+1 from me. It'd be nice if there were a cleaner way of implementing this than separate files, but the underscore/no-underscore confusion has bitten us all at one time or another.

07/19/07 12:34:42 changed by manfred

-1. There are tons of confusing library names out there, I think this will only create more confusion. The interpreter clearly tells you when it can't find the file.

09/22/07 18:15:08 changed by david

  • status changed from new to closed.
  • resolution set to fixed.

(In [7560]) Allow frameworks to be required by their gem name (closes #8845) [drnic]