Top Level Namespace
Defined Under Namespace
Modules: Kernel, RequireRelative
Instance Method Summary collapse
Instance Method Details
#require_relative(suffix) ⇒ Object
53 54 55 56 57 58 59 |
# File 'lib/require_relative.rb', line 53 def require_relative(suffix) file = caller.first.split(/:\d/,2).first if /\A\((.*)\)/ =~ file # eval, etc. raise LoadError, "require_relative is called in #{$1}" end require File.join(File.dirname(file), suffix) end |