| 1 | package Dist::Zilla::App::Command::gl 1.0002; | ||||||||||||||
| 2 | |||||||||||||||
| 3 | 1 | ▶ | use Modern::Perl; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 4 | 1 | ▶ | use Cwd qw(cwd); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 5 | 1 | ▶ | use Dist::Zilla::App -command; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 6 | |||||||||||||||
| 7 | ## no critic qw(ProhibitAmbiguousNames) | ||||||||||||||
| 8 | 0 | ▶ | sub abstract {'use the GitLab plugins from the command-line'} | ||||||||||||
|
Subroutine
abstract: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||
| 9 | 0 | ▶ | sub description {'Use the GitLab plugins from the command-line'} | ||||||||||||
|
Subroutine
description: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||
| 10 | 0 | ▶ | sub usage_desc {'%c %o [ update | create [<repository>] ]'} | ||||||||||||
|
Subroutine
usage_desc: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||
| 11 | |||||||||||||||
| 12 | ## no critic qw(ProhibitCommaSeparatedStatements) | ||||||||||||||
| 13 | 0 | ▶ | sub opt_spec { | ||||||||||||
|
Subroutine
opt_spec: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||
| 14 | [ | ||||||||||||||
| 15 | 0 | 'profile|p=s', 'name of the profile to use', | |||||||||||||
| 16 | { default => 'default' } | ||||||||||||||
| 17 | ], | ||||||||||||||
| 18 | |||||||||||||||
| 19 | [ | ||||||||||||||
| 20 | 'provider|P=s', 'name of the profile provider to use', | ||||||||||||||
| 21 | { default => 'Default' } | ||||||||||||||
| 22 | ], | ||||||||||||||
| 23 | ; | ||||||||||||||
| 24 | } | ||||||||||||||
| 25 | ## use critic | ||||||||||||||
| 26 | 0 | ▶ | sub execute { | ||||||||||||
|
Subroutine
execute: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||
| 27 | 0 | my ( $self, $opt, $arg ) = @_; | |||||||||||||
| 28 | |||||||||||||||
| 29 | 0 | my $zilla = $self->zilla; | |||||||||||||
| 30 | |||||||||||||||
| 31 | $_->gather_files | ||||||||||||||
| 32 | 0 | ▶ | for eval { Dist::Zilla::App->VERSION('7.000') } | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 33 | ? $zilla->plugins_with( -FileGatherer ) | ||||||||||||||
| 34 | 0 | : @{ $zilla->plugins_with( -FileGatherer ) }; | |||||||||||||
| 35 | |||||||||||||||
| 36 | 0 | ▶ | if ( $arg->[0] eq 'create' ) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 37 | 0 | require Dist::Zilla::Dist::Minter; | |||||||||||||
| 38 | |||||||||||||||
| 39 | 0 | my $minter = Dist::Zilla::Dist::Minter->_new_from_profile( | |||||||||||||
| 40 | [ $opt->provider, $opt->profile ], { | ||||||||||||||
| 41 | chrome => $self->app->chrome, | ||||||||||||||
| 42 | name => $zilla->name, | ||||||||||||||
| 43 | }, | ||||||||||||||
| 44 | ); | ||||||||||||||
| 45 | |||||||||||||||
| 46 | 0 | my $create = _find_plug( $minter, 'GitLab::Create' ); | |||||||||||||
| 47 | 0 | my $root = cwd(); | |||||||||||||
| 48 | 0 | my $repo = $arg->[1]; | |||||||||||||
| 49 | 0 | $create->after_mint( | |||||||||||||
| 50 | { | ||||||||||||||
| 51 | mint_root => $root, | ||||||||||||||
| 52 | repo => $repo, | ||||||||||||||
| 53 | description => $zilla->abstract | ||||||||||||||
| 54 | } | ||||||||||||||
| 55 | ); | ||||||||||||||
| 56 | } | ||||||||||||||
| 57 | elsif ( $arg->[0] eq 'update' ) { | ||||||||||||||
| 58 | 0 | _find_plug( $zilla, 'GitLab::Update' )->after_release; | |||||||||||||
| 59 | } | ||||||||||||||
| 60 | } | ||||||||||||||
| 61 | |||||||||||||||
| 62 | 0 | ▶ | sub _find_plug { | ||||||||||||
|
Subroutine
_find_plug: not called CC=3 SCAR=24.8
| |||||||||||||||
| 63 | 0 | my ( $self, $name ) = @_; | |||||||||||||
| 64 | |||||||||||||||
| 65 | 0 | foreach ( @{ $self->plugins } ) { | |||||||||||||
| 66 | 0 | ▶ | return $_ if $_->plugin_name =~ /$name/; | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 67 | } | ||||||||||||||
| 68 | } | ||||||||||||||
| 69 | |||||||||||||||
| 70 | 1 | 1; | |||||||||||||
| 71 | |||||||||||||||
| 72 | =pod | ||||||||||||||
| 73 | |||||||||||||||
| 74 | =encoding UTF-8 | ||||||||||||||
| 75 | |||||||||||||||
| 76 | =head1 NAME | ||||||||||||||
| 77 | |||||||||||||||
| 78 | Dist::Zilla::App::Command::gl - Use the GitLab plugins from the command-line | ||||||||||||||
| 79 | |||||||||||||||
| 80 | =head1 VERSION | ||||||||||||||
| 81 | |||||||||||||||
| 82 | version 1.0002 | ||||||||||||||
| 83 | |||||||||||||||
| 84 | =head1 SYNOPSIS | ||||||||||||||
| 85 | |||||||||||||||
| 86 | # create a new GitLab repository for your dist | ||||||||||||||
| 87 | $ dzil gl create [<repository>] | ||||||||||||||
| 88 | |||||||||||||||
| 89 | # update GitLab repo information | ||||||||||||||
| 90 | $ dzil gl update | ||||||||||||||
| 91 | |||||||||||||||
| 92 | =head1 AUTHOR | ||||||||||||||
| 93 | |||||||||||||||
| 94 | D Ruth Holloway <ruth@hiruthie.me> | ||||||||||||||
| 95 | |||||||||||||||
| 96 | =head1 COPYRIGHT AND LICENSE | ||||||||||||||
| 97 | |||||||||||||||
| 98 | This software is copyright (c) 2022 by D Ruth Holloway. | ||||||||||||||
| 99 | |||||||||||||||
| 100 | This is free software; you can redistribute it and/or modify it under | ||||||||||||||
| 101 | the same terms as the Perl 5 programming language system itself. | ||||||||||||||
| 102 | |||||||||||||||
| 103 | =cut | ||||||||||||||
| 104 | |||||||||||||||
| 105 | __END__ | ||||||||||||||