package Dist::Zilla::Plugin::GitLab 1.0002;
use Modern::Perl;
use JSON::MaybeXS;
use Moose;
use Try::Tiny;
use HTTP::Tiny;
use Git::Wrapper;
use Class::Load qw(try_load_class);
has api => (
is
urn $repo;
}
sub _check_response {
my ( $self, $response ) = @_;
try {
my $json_text = decode_json( $response->{content} );
if ( !$response->{success} ) {
require Data::
->Terse(1)
->Sortkeys(1)->Dump
);
return;
}
return $json_text;
}
catch {
$self->log("Error: $_");
if ( $response
&& !$response
package Dist::Zilla::Plugin::GitLab::Meta 1.0002;
use Modern::Perl;
use JSON::MaybeXS;
use URL::Encode qw(url_encode_utf8);
use Moose;
extends 'Dist::Zilla::Plugin::GitLab';
with 'Dist::Zilla::Role:
epo_name.git"
: $repo->{http_url_to_repo};
if ( !$offline && $repo->{issues_enabled} == JSON->true() ) {
$bugtracker = "$html_url/-/issues";
}
my $meta;
$meta->{resources} =
ing UTF-8
=head1 NAME
Dist::Zilla::Plugin::GitLab::Meta - Add a GitLab repo's info to META.{yml,json}
=head1 VERSION
version 1.0002
=head1 SYNOPSIS
Configure git with your GitLab login name:
package Dist::Zilla::Plugin::GitLab::Create 1.0002;
use Modern::Perl;
use JSON::MaybeXS;
use Moose;
use Try::Tiny;
use Git::Wrapper;
use File::Basename;
extends 'Dist::Zilla::Plugin::GitLab';
with '
);
my $url = $self->api . '/projects';
$content = encode_json($params);
$headers->{'content-type'} = 'application/json';
$self->log_debug("Sending POST $url");
my $response = $htt
package Dist::Zilla::Plugin::GitLab::Update 1.0002;
use Modern::Perl;
use Carp;
use JSON::MaybeXS;
use Moose;
use List::Util qw(first);
use URL::Encode qw(url_encode_utf8);
extends 'Dist::Zilla::Plug
nt-type'} = 'application/json';
$self->log_debug("Sending PUT $url");
my $response = HTTP::Tiny->new->request(
'PUT', $url,
{
content => encode_json($params),
head