# File lib/require_relative.rb, line 34 def require_relative(suffix) # Rubinius::Location#file stores relative file names while # Rubinius::Location#scope.current_script.data_path stores the # absolute file name. It is possible (hopeful even) that in the # future that Rubinius will change the API to be more # intuitive. When that occurs, I'll change the below to that # simpler thing. scope = Rubinius::StaticScope.of_sender script = scope.current_script if script require File.join(File.dirname(script.data_path), suffix) else raise LoadError "Something is wrong in trying to get relative path" end end