Path to this page:
./
devel/ruby-rbx-require-relative,
Ruby 1.9s require_relative for Rubinius and MRI 1.8
Branch: pkgsrc-2011Q3,
Version: 0.0.5,
Package name: ruby19-rbx-require-relative-0.0.5,
Maintainer: pkgsrc-usersRuby 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.
Required to run:[
lang/ruby19-base]
Master sites:
SHA1: 7be5a5694f1042195532798f36c1104c259e682b
RMD160: dbd206854ed0595de79f503903d0db0723ab28b1
Filesize: 8.5 KB
Version history: (Expand)
- (2011-10-04) Package added to pkgsrc.se, version ruby19-rbx-require-relative-0.0.5 (created)