File Coverage

lib/App/gh.pm
Criterion Covered Total %
statement 18 28 64.2
branch 0 6 0.0
condition 0 6 0.0
subroutine 6 9 66.6
pod 0 3 0.0
total 24 52 46.1


line stmt bran cond sub pod time code
1             package App::gh;
2 2     2   22536 use warnings;
  2         4  
  2         68  
3 2     2   11 use strict;
  2         4  
  2         97  
4             our $VERSION = '0.66';
5 2     2   675 use App::gh::Config;
  2         5  
  2         56  
6 2     2   939 use App::gh::API;
  2         6  
  2         63  
7 2     2   23 use Net::GitHub;
  2         4  
  2         33  
8 2     2   11 use Cwd;
  2         4  
  2         538  
9             require App::gh::Git;
10              
11             my $GITHUB;
12              
13             sub config {
14 0     0 0   return "App::gh::Config";
15             }
16              
17             sub git {
18 0     0 0   return App::gh::Git->repository;
19             }
20              
21             sub github {
22 0     0 0   my $class = shift;
23 0           my $access_token = $class->config->github_access_token;
24 0 0 0       return $GITHUB ||= Net::GitHub->new( access_token => $access_token ) if $access_token;
25              
26 0           my $github_id = $class->config->github_id;
27 0           my $github_password = $class->config->github_password;
28              
29 0 0         die "Please configure your github.user in .gitconfig (see App::gh pod)\n"
30             unless $github_id;
31 0 0         die "Please configure your github.password in .gitconfig (See App::gh pod)\n"
32             unless $github_password;
33              
34 0   0       return $GITHUB ||= Net::GitHub->new( # Net::GitHub::V3
35             login => $github_id,
36             pass => $github_password,
37             # $class->config->github_token,
38             );
39             }
40              
41             1;
42             __END__