Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

29 lines (25 sloc) 0.885 kB
module Rubinius
class CodeLoader
# Searches $LOAD_PATH for a file named +name+. Does not append any file
# extension to +name+ while searching. Used by #load to resolve the name
# to a full path to load. Also used by #require when the file extension is
# provided.
def search_load_path(name, loading)
$LOAD_PATH.each do |dir|
path = "#{dir}/#{name}"
return path if loadable? path
end
return nil
end
# requires files relative to the current directory. We do one interesting
# check to make sure it's not called inside of an eval.
def self.require_relative(name, scope)
script = scope.current_script
if script
require File.expand_path(name, File.dirname(script.data_path))
else
raise LoadError.new "Something is wrong in trying to get relative path"
end
end
end
end
Jump to Line
Something went wrong with that request. Please try again.