Dist-Zilla-PluginBundle-ROKR

 view release on metacpan or  search on metacpan

lib/Dist/Zilla/Plugin/UpdateGitHub.pm  view on Meta::CPAN

32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
            return;
        }
    }
 
    my $uri = "https://github.com/api/v2/json/repos/show/$login/$repository";
    my $response = $agent->post( $uri,
        [ login => $login, token => $token, 'values[description]' => $description ] );
 
    unless ( $response->is_success ) {
        die $response->status_line, "\n",
            $response->decoded_content;
    }
 
    return $response;
}
 
sub release {
    my ( $self ) = @_;
     
    my $repository = $self->zilla->name;
    my $description = $self->zilla->abstract;
 
    eval {
        if ( my $response = $self->update( repository => $repository, description => $description ) ) {
            $self->log( "Updated github description:", $response->decoded_content );
        }
    };
    $self->log( "Unable to update github description: $@" ) if $@;
}
 
__PACKAGE__->meta->make_immutable;
no Moose;
1;
 
__END__



( run in 0.317 second using v1.01-cache-2.11-cpan-05444aca049 )