diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-02-15 06:29:32 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-02-15 06:29:32 +0000 |
commit | b0333388ab089e70be9109434ba5a6961b08fa60 (patch) | |
tree | 46126571465a5520c046f0e3cfaabeef1f269a5c | |
parent | 748beee825447256e1aa7dd1458ba317fabbd18f (diff) | |
download | ruby-b0333388ab089e70be9109434ba5a6961b08fa60.tar.gz |
* lib/require_relative.rb: new file.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15483 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | lib/require_relative.rb | 6 |
2 files changed, 10 insertions, 0 deletions
@@ -1,3 +1,7 @@ +Fri Feb 15 15:29:03 2008 Tanaka Akira <akr@fsij.org> + + * lib/require_relative.rb: new file. + Fri Feb 15 15:23:12 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> * ext/iconv/iconv.c (iconv_convert): check upper bound. a patch from diff --git a/lib/require_relative.rb b/lib/require_relative.rb new file mode 100644 index 0000000000..34b0948514 --- /dev/null +++ b/lib/require_relative.rb @@ -0,0 +1,6 @@ +def require_relative(relative_feature) + /:/ =~ caller.first + absolute_feature = File.expand_path(File.join(File.dirname($`), relative_feature)) + require absolute_feature +end + |