kentnl / File-ShareDir-ProjectDistDir

Simple set-and-forget using of a '/share' directory in your projects root
Other
5 stars 5 forks source link

fix POD example of strict mode import #15

Closed mjemmeson closed 9 years ago

mjemmeson commented 9 years ago

Hi,

One of the strict mode examples doesn't work. I'm not especially familiar with Sub::Exporter but I think you meant the following:

use File::ShareDir::ProjectDistDir 'dist_dir' => { strict => 1 };

Which does seem to set strict mode.

thanks, Michael

kentfredric commented 9 years ago

Can you expand what you mean by "Doesn't work"? What behaviour did you see, what did you expect to see?

A failing test here would be very useful.

Also, can you try:

  use File::ShareDir::ProjectDistDir 'dist_dir' => defaults => { strict => 1 };

As though while being irregular, I expect that should work.

kentfredric commented 9 years ago

Ok, I think I've replicated your issue myself =).

Path::Tiny paths require defined, positive-length parts at ....

^ Is this what you were seeing by chance?

kentfredric commented 9 years ago

Oh. As a footnote: If you had plans on using this in a CPAN Dist, I would try to dissuade you from that choice due to all the problems we've faced using heuristics to determine where the sharedir is.

A much, much better option is Test::File::ShareDir, where the sharedir is only used in development and there's no runtime magic turning up for users.