| 1 | #line 1 | ||||||||||||
| 2 | package Module::Install::GithubMeta; | ||||||||||||
| 3 | 5 | ▶ | |||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 5 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | 5 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | 5 | ▶ | use Cwd; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | 5 | ▶ | use base qw(Module::Install::Base); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 8 | use vars qw($VERSION); | ||||||||||||
| 9 | 5 | ||||||||||||
| 10 | $VERSION = '0.30'; | ||||||||||||
| 11 | 0 | ▶ | |||||||||||
|
Subroutine
githubmeta: not called CC=8 SCAR=42.8
Pod
undocumented
| |||||||||||||
| 12 | 0 | sub githubmeta { | |||||||||||
| 13 | 0 | ▶ | my $self = shift; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 14 | 0 | ▶ | return unless $Module::Install::AUTHOR; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 15 | 0 | ▶ | return unless _under_git(); | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 16 | 0 | ▶ | return unless $self->can_run('git'); | ||||||||||
|
Condition0%0/2
shift() || 'origin'
MC/DC0%0/1
shift() || 'origin'
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||
| 17 | 0 | my $remote = shift || 'origin'; | |||||||||||
| 18 | 0 | local $ENV{LC_ALL}='C'; | |||||||||||
| 19 | 0 | ▶ | local $ENV{LANG}='C'; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 20 | 0 | ▶ | return unless my ($git_url) = `git remote show -n $remote` =~ /URL: (.*)$/m; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 21 | 0 | return unless $git_url =~ /github\.com/; # Not a Github repository | |||||||||||
| 22 | 0 | my $http_url = $git_url; | |||||||||||
| 23 | 0 | $git_url =~ s![\w\-]+\@([^:]+):!git://$1/!; | |||||||||||
| 24 | 0 | $http_url =~ s![\w\-]+\@([^:]+):!https://$1/!; | |||||||||||
| 25 | 0 | $http_url =~ s!\.git$!/!; | |||||||||||
| 26 | 0 | ▶ | $self->repository( $git_url ); | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 27 | 0 | $self->homepage( $http_url ) unless $self->homepage(); | |||||||||||
| 28 | return 1; | ||||||||||||
| 29 | } | ||||||||||||
| 30 | 0 | ▶ | |||||||||||
|
Subroutine
_under_git: not called CC=5 SCAR=34.0
| |||||||||||||
| 31 | 0 | ▶ | sub _under_git { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 32 | 0 | return 1 if -e '.git'; | |||||||||||
| 33 | 0 | my $cwd = getcwd; | |||||||||||
| 34 | 0 | my $last = $cwd; | |||||||||||
| 35 | 0 | my $found = 0; | |||||||||||
| 36 | 0 | ▶ | while (1) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 37 | 0 | chdir '..' or last; | |||||||||||
| 38 | 0 | ▶ | my $current = getcwd; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 39 | 0 | last if $last eq $current; | |||||||||||
| 40 | 0 | ▶ | $last = $current; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 41 | 0 | if ( -e '.git' ) { | |||||||||||
| 42 | 0 | $found = 1; | |||||||||||
| 43 | last; | ||||||||||||
| 44 | } | ||||||||||||
| 45 | 0 | } | |||||||||||
| 46 | 0 | chdir $cwd; | |||||||||||
| 47 | return $found; | ||||||||||||
| 48 | } | ||||||||||||
| 49 | 5 | ||||||||||||
| 50 | 'Github'; | ||||||||||||
| 51 | __END__ | ||||||||||||