Skip to content

Ruby 1.9's require_relative for rubinius and MRI 1.8. Compatibility on 1.9..2

License

Notifications You must be signed in to change notification settings

rocky/rbx-require-relative

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ruby 1.9’s relative_relative for Rubinus and MRI 1.8

Here we add in Module RequireRelative method: require_relative, and abs_file. Example:

require 'rubygems'; require 'require_relative'
require_relative './lib/foo' 
absolute_path = RequireRelative.abs_file

But why abs_file? Well, recall that __FILE__ does not give an absolute path. So if you have chdir’d before using __FILE__, you might not be able to retrieve the full path.

The latest version is at http://github.com/rocky/rbx-require-relative/

About

Ruby 1.9's require_relative for rubinius and MRI 1.8. Compatibility on 1.9..2

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages