| 1 | package Dist::Zilla::PluginBundle::Codeberg 2.0102; | ||||||||||
| 2 | |||||||||||
| 3 | 2 | ▶ | use Modern::Perl; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 2 | ▶ | use Carp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 2 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 2 | our $AUTHORITY = 'cpan:GEEKRUTH'; # AUTHORITY | |||||||||
| 7 | 2 | extends 'Dist::Zilla::Plugin::Codeberg'; | |||||||||
| 8 | 2 | with 'Dist::Zilla::Role::PluginBundle::Easy'; | |||||||||
| 9 | |||||||||||
| 10 | has '+repo' => ( | ||||||||||
| 11 | lazy => 1, | ||||||||||
| 12 | 3 | ▶ | default => sub { $_[0]->payload->{repo} }, | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 13 | 2 | ); | |||||||||
| 14 | |||||||||||
| 15 | # Codeberg::Meta | ||||||||||
| 16 | |||||||||||
| 17 | has bugs => ( | ||||||||||
| 18 | is => 'ro', | ||||||||||
| 19 | isa => 'Bool', | ||||||||||
| 20 | lazy => 1, | ||||||||||
| 21 | 3 | ▶ | default => sub { | ||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
| |||||||||||
| 22 | 3 | ▶ | defined $_[0]->payload->{bugs} ? $_[0]->payload->{bugs} : 1; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 23 | }, | ||||||||||
| 24 | 2 | ); | |||||||||
| 25 | |||||||||||
| 26 | has fork => ( | ||||||||||
| 27 | is => 'ro', | ||||||||||
| 28 | isa => 'Bool', | ||||||||||
| 29 | lazy => 1, | ||||||||||
| 30 | 3 | ▶ | default => sub { | ||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
| |||||||||||
| 31 | 3 | ▶ | defined $_[0]->payload->{fork} ? $_[0]->payload->{fork} : 1; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 32 | }, | ||||||||||
| 33 | 2 | ); | |||||||||
| 34 | |||||||||||
| 35 | has p3rl => ( | ||||||||||
| 36 | is => 'ro', | ||||||||||
| 37 | isa => 'Bool', | ||||||||||
| 38 | lazy => 1, | ||||||||||
| 39 | 3 | ▶ | default => sub { | ||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
| |||||||||||
| 40 | 3 | ▶ | defined $_[0]->payload->{p3rl} ? $_[0]->payload->{p3rl} : 0; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 41 | }, | ||||||||||
| 42 | 2 | ); | |||||||||
| 43 | |||||||||||
| 44 | has metacpan => ( | ||||||||||
| 45 | is => 'ro', | ||||||||||
| 46 | isa => 'Bool', | ||||||||||
| 47 | lazy => 1, | ||||||||||
| 48 | 3 | ▶ | default => sub { | ||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
| |||||||||||
| 49 | 3 | ▶ | defined $_[0]->payload->{metacpan} ? $_[0]->payload->{metacpan} : 0; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 50 | }, | ||||||||||
| 51 | 2 | ); | |||||||||
| 52 | |||||||||||
| 53 | has meta_home => ( | ||||||||||
| 54 | is => 'ro', | ||||||||||
| 55 | isa => 'Bool', | ||||||||||
| 56 | lazy => 1, | ||||||||||
| 57 | 3 | ▶ | default => sub { | ||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
| |||||||||||
| 58 | 3 | ▶ | defined $_[0]->payload->{meta_home} ? $_[0]->payload->{meta_home} : 0; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 59 | }, | ||||||||||
| 60 | 2 | ); | |||||||||
| 61 | |||||||||||
| 62 | has remote => ( | ||||||||||
| 63 | is => 'ro', | ||||||||||
| 64 | isa => 'Maybe[Str]', | ||||||||||
| 65 | lazy => 1, | ||||||||||
| 66 | 3 | ▶ | default => sub { | ||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
| |||||||||||
| 67 | 3 | ▶ | defined $_[0]->payload->{remote} ? $_[0]->payload->{remote} : 'origin'; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 68 | }, | ||||||||||
| 69 | 2 | ); | |||||||||
| 70 | |||||||||||
| 71 | has wiki => ( | ||||||||||
| 72 | is => 'ro', | ||||||||||
| 73 | isa => 'Bool', | ||||||||||
| 74 | lazy => 1, | ||||||||||
| 75 | 3 | ▶ | default => sub { | ||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
| |||||||||||
| 76 | 3 | ▶ | defined $_[0]->payload->{wiki} ? $_[0]->payload->{wiki} : 0; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 77 | }, | ||||||||||
| 78 | 2 | ); | |||||||||
| 79 | |||||||||||
| 80 | 3 | ▶ | sub configure { | ||||||||
|
Subroutine
configure: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 81 | 3 | my $self = shift; | |||||||||
| 82 | |||||||||||
| 83 | 3 | $self->add_plugins( | |||||||||
| 84 | [ | ||||||||||
| 85 | 'Codeberg::Meta' => { | ||||||||||
| 86 | bugs => $self->bugs, | ||||||||||
| 87 | fork => $self->fork, | ||||||||||
| 88 | metacpan => $self->metacpan, | ||||||||||
| 89 | meta_home => $self->meta_home, | ||||||||||
| 90 | p3rl => $self->p3rl, | ||||||||||
| 91 | remote => $self->remote, | ||||||||||
| 92 | repo => $self->repo, | ||||||||||
| 93 | wiki => $self->wiki, | ||||||||||
| 94 | } | ||||||||||
| 95 | ], | ||||||||||
| 96 | |||||||||||
| 97 | [ | ||||||||||
| 98 | 'Codeberg::Update' => { | ||||||||||
| 99 | repo => $self->repo, | ||||||||||
| 100 | } | ||||||||||
| 101 | ] | ||||||||||
| 102 | ); | ||||||||||
| 103 | } | ||||||||||
| 104 | |||||||||||
| 105 | 2 | __PACKAGE__->meta->make_immutable; | |||||||||
| 106 | |||||||||||
| 107 | 2 | 1; | |||||||||
| 108 | |||||||||||
| 109 | =pod | ||||||||||
| 110 | |||||||||||
| 111 | =encoding UTF-8 | ||||||||||
| 112 | |||||||||||
| 113 | =head1 NAME | ||||||||||
| 114 | |||||||||||
| 115 | Dist::Zilla::PluginBundle::Codeberg - Access Codeberg functionality to maintain distros from Dist::Zilla | ||||||||||
| 116 | |||||||||||
| 117 | =head1 VERSION | ||||||||||
| 118 | |||||||||||
| 119 | version 2.0102 | ||||||||||
| 120 | |||||||||||
| 121 | =head1 SYNOPSIS | ||||||||||
| 122 | |||||||||||
| 123 | Configure git with your Codeberg credentials: | ||||||||||
| 124 | |||||||||||
| 125 | $ git config --global codeberg.user LoginName | ||||||||||
| 126 | $ git config --global codeberg.token AccessToken | ||||||||||
| 127 | |||||||||||
| 128 | Alternatively you can install L<Config::Identity> and write your credentials | ||||||||||
| 129 | in the (optionally GPG-encrypted) C<~/.codeberg> file as follows: | ||||||||||
| 130 | |||||||||||
| 131 | login LoginName | ||||||||||
| 132 | token AccessToken | ||||||||||
| 133 | |||||||||||
| 134 | Set up an access token on Codeberg, in your profile under "Personal Access Tokens." You | ||||||||||
| 135 | must grant the token the C<api> scope! | ||||||||||
| 136 | |||||||||||
| 137 | then, in your F<dist.ini>: | ||||||||||
| 138 | |||||||||||
| 139 | [@Codeberg] | ||||||||||
| 140 | repo = SomeRepo | ||||||||||
| 141 | |||||||||||
| 142 | =head1 DESCRIPTION | ||||||||||
| 143 | |||||||||||
| 144 | This bundle automatically adds the plugins | ||||||||||
| 145 | L<Codeberg::Meta|Dist::Zilla::Plugin::Codeberg::Meta> | ||||||||||
| 146 | and L<Codeberg::Update|Dist::Zilla::Plugin::Codeberg::Update>. | ||||||||||
| 147 | |||||||||||
| 148 | =head1 ATTRIBUTES | ||||||||||
| 149 | |||||||||||
| 150 | =over | ||||||||||
| 151 | |||||||||||
| 152 | =item C<bugs> | ||||||||||
| 153 | |||||||||||
| 154 | The META bugtracker web field will be set to the issue's page of the repository | ||||||||||
| 155 | on Codeberg, if this options is set to true (default) and if the Codeberg Issues happen to | ||||||||||
| 156 | be activated (see the Codeberg repository's C<Admin> panel). | ||||||||||
| 157 | |||||||||||
| 158 | =item C<fork> | ||||||||||
| 159 | |||||||||||
| 160 | If the repository is a Codeberg fork of another repository this option will make | ||||||||||
| 161 | all the information be taken from the original repository instead of the forked | ||||||||||
| 162 | one, if it's set to true (default). | ||||||||||
| 163 | |||||||||||
| 164 | =item C<metacpan> | ||||||||||
| 165 | |||||||||||
| 166 | The Codeberg homepage field will be set to the metacpan.org distribution URL | ||||||||||
| 167 | (e.g. C<https://metacpan.org/release/Dist-Zilla-Plugin-Codeberg>) if this option is set to true | ||||||||||
| 168 | (default is false). | ||||||||||
| 169 | |||||||||||
| 170 | This takes precedence over the C<p3rl> options (if both are | ||||||||||
| 171 | true, metacpan will be used). | ||||||||||
| 172 | |||||||||||
| 173 | =item C<meta_home> | ||||||||||
| 174 | |||||||||||
| 175 | The Codeberg homepage field will be set to the value present in the dist meta | ||||||||||
| 176 | (e.g. the one set by other plugins) if this option is set to true (default is | ||||||||||
| 177 | false). If no value is present in the dist meta, this option is ignored. | ||||||||||
| 178 | |||||||||||
| 179 | This takes precedence over the C<metacpan> and C<p3rl> options (if all | ||||||||||
| 180 | three are true, meta_home will be used). | ||||||||||
| 181 | |||||||||||
| 182 | =item C<p3rl> | ||||||||||
| 183 | |||||||||||
| 184 | The Codeberg homepage field will be set to the p3rl.org shortened URL | ||||||||||
| 185 | (e.g. C<https://p3rl.org/Dist::Zilla::PluginBundle::Codeberg>) if this option is set to true (default is | ||||||||||
| 186 | false). | ||||||||||
| 187 | |||||||||||
| 188 | =item C<remote> | ||||||||||
| 189 | |||||||||||
| 190 | Specifies the git remote name to be used when guessing the repo name (default C<origin>). | ||||||||||
| 191 | |||||||||||
| 192 | =item C<repo> | ||||||||||
| 193 | |||||||||||
| 194 | The name of the Codeberg repository. By default the name will be extracted from | ||||||||||
| 195 | the URL of the remote specified in the C<remote> option, and if that fails the | ||||||||||
| 196 | dist name (from dist.ini) is used. It can also be in the form C<user/repo> | ||||||||||
| 197 | when it belongs to another Codeberg user/organization. | ||||||||||
| 198 | |||||||||||
| 199 | =item C<wiki> | ||||||||||
| 200 | |||||||||||
| 201 | The META homepage field will be set to the URL of the wiki of the Codeberg | ||||||||||
| 202 | repository, if this option is set to true (default is false) and if the Codeberg | ||||||||||
| 203 | Wiki happens to be activated (see the Codeberg repository's C<Admin> panel). | ||||||||||
| 204 | |||||||||||
| 205 | =back | ||||||||||
| 206 | |||||||||||
| 207 | =head1 SEE ALSO | ||||||||||
| 208 | |||||||||||
| 209 | L<Dist::Zilla::Plugin::Codeberg::Meta>, L<Dist::Zilla::Plugin::Codeberg::Update> | ||||||||||
| 210 | |||||||||||
| 211 | =head1 ACKNOWLEDGEMENTS | ||||||||||
| 212 | |||||||||||
| 213 | Alessandro Ghedini <alexbio@cpan.org> made L<Dist::Zilla::PluginBundle::GitHub> from | ||||||||||
| 214 | which this module is created. Much of the underlying code is from that module. | ||||||||||
| 215 | |||||||||||
| 216 | =head1 AUTHOR | ||||||||||
| 217 | |||||||||||
| 218 | D Ruth Holloway <ruth@hiruthie.me> | ||||||||||
| 219 | |||||||||||
| 220 | =head1 COPYRIGHT AND LICENSE | ||||||||||
| 221 | |||||||||||
| 222 | This software is copyright (c) 2026 by D Ruth Holloway. | ||||||||||
| 223 | |||||||||||
| 224 | This is free software; you can redistribute it and/or modify it under | ||||||||||
| 225 | the same terms as the Perl 5 programming language system itself. | ||||||||||
| 226 | |||||||||||
| 227 | =cut | ||||||||||
| 228 | |||||||||||
| 229 | __END__ | ||||||||||