Rex-Bundle

 view release on metacpan or  search on metacpan

lib/Rex/Bundle.pm  view on Meta::CPAN

   my $cwd = getcwd;
   chdir(_work_dir() . '/' . $dir);
   my @ret;

   my $found=0;

   my $meta_file = "META.yml";
   if(-f "MYMETA.yml") { $meta_file = "MYMETA.yml"; }

   if(-f $meta_file) {
      my $yaml = eval { local(@ARGV, $/) = ($meta_file); $_=<>; $_; };
      eval {
         my $struct = Load($yaml);
         push(@ret, $struct->{'configure_requires'});
         push(@ret, $struct->{'build_requires'});
         push(@ret, $struct->{'requires'});
         $found=1;
      };

      if($@) {
         print STDERR "Error parseing META.yml :(\n";

lib/Rex/Bundle.pm  view on Meta::CPAN

   } else {
      # no meta.yml found :(
      print STDERR "No META.yml found :(\n";
      @ret = ();
   }

   if(!$found) {
      if(-f "Makefile.PL") {
         no strict;
         no warnings 'all';
         my $makefile = eval { local(@ARGV, $/) = ("Makefile.PL"); <>; };
         my ($hash_string) = ($makefile =~ m/WriteMakefile\((.*?)\);/ms);
         my $make_hash = eval "{$hash_string}";
         if(exists $make_hash->{"PREREQ_PM"}) {
            push @ret, $make_hash->{"PREREQ_PM"};
         }
         use strict;
         use warnings;
      }
   }



( run in 0.479 second using v1.01-cache-2.11-cpan-49f99fa48dc )