Module: Kernel
- Defined in:
- lib/require_relative.rb
Overview
On 1.9.2 platforms we don’t do anything.
Instance Method Summary collapse
Instance Method Details
#require_relative(suffix) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# 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 |