diff options
-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 + |