script/perl-ExtUtils-MakeMaker-META_MERGE-GitHub.pl untested

filter: Statementstmt 0.0% 0 / 35 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 10 MC/DCmcdc n/a Subroutinesub 0.0% 0 / 4 Podpod n/a totaltotal 0.0% 0 / 53 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 #!/usr/local/bin/perl
2 use strict;
3 use warnings;
4 use ExtUtils::MakeMaker::META_MERGE::GitHub;
5 use Data::Dumper qw{Dumper};
6  
7 my $login_default = ""; #future
8 my $host_default = ""; #future
9 my $owner_default = "";
10 my $repo_default = "";
11 my @return = qx{git remote -v 2> /dev/null};
12 if (@return) {
13 my $line = $return[0];
14 chomp $line;
15 my @parts = split /\s+/, $line;
16 my $git = $parts[1];
17 if ($git =~ m/\A([^:]+)@([^:]+):([^\/]+)\/([^\.]+)\.git\Z/) {
18 $login_default = $1;
19 $host_default = $2;
20 $owner_default = $3;
21 $repo_default = $4;
22 } else {
23 warn(qq{Warning: git url "$git" not matched\n});
24 }
25 } else {
26 warn(qq{Warning: git repository not found in path\n});
27 }
28  
29 my $syntax = qq{Syntax: $0 owner repository_name\n};
30 my $owner = shift || $owner_default or die($syntax);
31 my $repo = shift || $repo_default or die($syntax);
32 my $mm = ExtUtils::MakeMaker::META_MERGE::GitHub->new(owner=>$owner, repo=>$repo);
33 my %META_MERGE = $mm->META_MERGE;
34 print Dumper(\%META_MERGE);
35  
36 __END__