# workaround to allow require_relative in ruby < 1.9.2
unless Kernel.respond_to?(:require_relative)
module Kernel
def require_relative(path)
require File.join(File.dirname(caller[0]), path.to_str)
end
end
end
Thursday, November 29, 2012
Ruby require_relative Backwards Compatibility
The following snippet can be used when using require_relative within ruby to ensure it is backwards compatible with older versions which do not contain require_relative:
Subscribe to:
Comments (Atom)