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 | 4df2b9adf1cadee1aa9b386885559f1604aaa973 (patch) | |
| tree | 46126571465a5520c046f0e3cfaabeef1f269a5c | |
| parent | 4a30a04247269cc3f7c43969677e6a513dcc789f (diff) | |
| download | ruby-4df2b9adf1cadee1aa9b386885559f1604aaa973.tar.gz ruby-4df2b9adf1cadee1aa9b386885559f1604aaa973.tar.xz ruby-4df2b9adf1cadee1aa9b386885559f1604aaa973.zip | |
* lib/require_relative.rb: new file.
git-svn-id: http://svn.ruby-lang.org/repos/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 000000000..34b094851 --- /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 + |
