On 2010.5.6 2:20 PM, Byrne Reese via RT wrote:
Show quoted text> I am the maintainer of Melody and a major contributor to Movable Type - a CMS powered by
> Perl. Our framework uses config.yaml files for its plugins, and I was hoping that the
> VERSION_FROM config attribute could be tweaked to support the following syntax for
> determining a version number:
>
> version: 1.0.1
Thanks for your suggestion, but I have to reject the idea. VERSION_FROM is a
heuristic tuned to skim Perl code. Trying to make it also figure out if the
thing in question is YAML and skim that is too far afield. It would also mess
with other heuristics that rely on VERSION_FROM being Perl code.
Your Makefile.PL can simply read the config.yaml file and set VERSION with it.
use YAML::Any qw(LoadFile);
my $Config_File = "config.yaml";
my $version = LoadFile($Config_File)->{version} ||
die "No version found in $Config_File";
WriteMakefile(
VERSION => $version,
...
);
--
54. "Napalm sticks to kids" is *not* a motivational phrase.
-- The 213 Things Skippy Is No Longer Allowed To Do In The U.S. Army
http://skippyslist.com/list/