tags:

views:

43

answers:

1

With the change to 1.9.2, the current directory is no longer in the load path. The announcement suggests against relying on the current directory in your code, but gives no suggestions for alternatives. What is a "better" way to keep code constrained than separate files linked with require?

A: 

If you're talking about the current directory being missing from the search path when using require, try require_relative instead.


require_related was accepted into the core in this conversation. It's part of some security changes because $: no longer includes '.' in the search path.

It was announced as being part of the kernel in the 1.9.2 notes, in the Kernel section.

It's documented as an extension to Kernel but works like the regular require statement only it's relative to the calling script's directory.

Greg