App-GitHubPullRequest

 view release on metacpan or  search on metacpan

lib/App/GitHubPullRequest.pm  view on Meta::CPAN

    die("You need the program '$bin' in your path to use this feature.\n");
}

# Return the base GitHub API URL as mentioned
# on http://developer.github.com/v3/
sub _api_url {
    my ($url) = @_;
    my $prefix = 'https://api.github.com/';
    # If no URL specified, just return the API URL
    return $prefix unless defined $url;
    # If URL already looks like a GitHub API URL, do nothing
    return $url if _is_api_url($url);
    # Create an API URL out of a partial URL as
    $url =~ s{^/*}{}; # Remove initial slashes, if any
    return $prefix . $url;
}

# Check if a URL is a GitHub API URL
sub _is_api_url {
    my ($url) = @_;
    croak("Please specify a URL to verify") unless $url;



( run in 0.443 second using v1.01-cache-2.11-cpan-64827b87656 )