| 1 | # ---------------------------------------------------------------------- copyright and license --- | ||||||||||
| 2 | # | ||||||||||
| 3 | # file: lib/Dist/Zilla/Role/HgRunner.pm | ||||||||||
| 4 | # | ||||||||||
| 5 | # Copyright © 2015 Van de Bugger | ||||||||||
| 6 | # | ||||||||||
| 7 | # This file is part of perl-Dist-Zilla-PluginBundle-Author-VDB. | ||||||||||
| 8 | # | ||||||||||
| 9 | # perl-Dist-Zilla-PluginBundle-Author-VDB is free software: you can redistribute it and/or modify | ||||||||||
| 10 | # it under the terms of the GNU General Public License as published by the Free Software | ||||||||||
| 11 | # Foundation, either version 3 of the License, or (at your option) any later version. | ||||||||||
| 12 | # | ||||||||||
| 13 | # perl-Dist-Zilla-PluginBundle-Author-VDB is distributed in the hope that it will be useful, but | ||||||||||
| 14 | # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A | ||||||||||
| 15 | # PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||||||||||
| 16 | # | ||||||||||
| 17 | # You should have received a copy of the GNU General Public License along with | ||||||||||
| 18 | # perl-Dist-Zilla-PluginBundle-Author-VDB. If not, see <http://www.gnu.org/licenses/>. | ||||||||||
| 19 | # | ||||||||||
| 20 | # ---------------------------------------------------------------------- copyright and license --- | ||||||||||
| 21 | |||||||||||
| 22 | package Dist::Zilla::Role::Author::VDB::HgRunner; | ||||||||||
| 23 | |||||||||||
| 24 | 6 | ▶ | use Moose::Role; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 25 | 6 | ▶ | use namespace::autoclean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 26 | 6 | ▶ | use version 0.77; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 27 | |||||||||||
| 28 | # ABSTRACT: TODO | ||||||||||
| 29 | 6 | our $VERSION = 'v0.11.3.1'; # TRIAL VERSION | |||||||||
| 30 | |||||||||||
| 31 | 6 | ▶ | use Path::Tiny; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 32 | 6 | ▶ | use Carp qw{ croak }; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 33 | |||||||||||
| 34 | 6 | with 'Dist::Zilla::Role::Author::VDB::ProgramRunner'; | |||||||||
| 35 | |||||||||||
| 36 | # -------------------------------------------------------------------------------------------------- | ||||||||||
| 37 | |||||||||||
| 38 | #pod =method run_hg | ||||||||||
| 39 | #pod | ||||||||||
| 40 | #pod @stdout = @{ $self->run_hg( @arguments ) }; | ||||||||||
| 41 | #pod | ||||||||||
| 42 | #pod =cut | ||||||||||
| 43 | |||||||||||
| 44 | 0 | ▶ | sub run_hg { | ||||||||
|
Subroutine
run_hg: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||
| 45 | 0 | my ( $self, @args ) = @_; | |||||||||
| 46 | 0 | ▶ | @args > 0 or croak "run_hg: at least one argument expected"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 47 | 0 | my $root = path( $self->zilla->root ); | |||||||||
| 48 | 0 | ▶ | return $self->run_program( | ||||||||
|
Branch: 1 branch
| |||||||||||
| 49 | 'hg', | ||||||||||
| 50 | '--cwd', "$root", | ||||||||||
| 51 | $args[ 0 ] ne 'init' ? ( '-R', '.' ) : (), # `hg init` does not like `-R` option. | ||||||||||
| 52 | @args | ||||||||||
| 53 | ); | ||||||||||
| 54 | }; | ||||||||||
| 55 | |||||||||||
| 56 | # -------------------------------------------------------------------------------------------------- | ||||||||||
| 57 | |||||||||||
| 58 | 6 | 1; | |||||||||
| 59 | |||||||||||
| 60 | # -------------------------------------------------------------------------------------------------- | ||||||||||
| 61 | |||||||||||
| 62 | #pod =head1 COPYRIGHT AND LICENSE | ||||||||||
| 63 | #pod | ||||||||||
| 64 | #pod Copyright (C) 2015 Van de Bugger | ||||||||||
| 65 | #pod | ||||||||||
| 66 | #pod License GPLv3+: The GNU General Public License version 3 or later | ||||||||||
| 67 | #pod <http://www.gnu.org/licenses/gpl-3.0.txt>. | ||||||||||
| 68 | #pod | ||||||||||
| 69 | #pod This is free software: you are free to change and redistribute it. There is | ||||||||||
| 70 | #pod NO WARRANTY, to the extent permitted by law. | ||||||||||
| 71 | #pod | ||||||||||
| 72 | #pod | ||||||||||
| 73 | #pod =cut | ||||||||||
| 74 | |||||||||||
| 75 | # end of file # | ||||||||||
| 76 | |||||||||||
| 77 | __END__ | ||||||||||