Editing Topic: RCR149 Project: RCR | RCRchive home

RCR 149: require files that aren't .rb or .so

submitted by patsplat on 2003-07-24 20:32:04


This is a legacy RCR. If this is your RCR, please resubmit it using the new format and process.


It would be nice to be able to require files that don't end in '.rb'

Example: Say you want to share settings between ruby and perl.

ruby:

require 'my.settings'

perl:

do 'my.settings';

where 'my.settings' contains:

$tables = {
    'person' => [ 'first', 'last' ],
    'place'  => [ 'city', 'state' ]
}

This is a neat trick, but it feels wrong for the settings to be '.rb'.

Cheers,

patsplat



Back to RCRchive.


RCR Submission page and RCRchive powered by Ruby, Apache, RuWiki (modified), and RubLog