module Kernel
Public Instance Methods
require_relative(path)
click to toggle source
# File lib/awsbase/require_relative.rb, line 7 def require_relative(path) desired_path = File.expand_path('../' + path.to_str, caller[0]) shortest = desired_path $:.each do |path| path += '/' if desired_path.index(path) == 0 candidate = desired_path.sub(path, '') shortest = candidate if candidate.size < shortest.size end end require shortest end