File Coverage

blib/lib/Dist/Zilla/App/Command/update.pm
Criterion Covered Total %
statement 9 20 45.0
branch 0 2 0.0
condition n/a
subroutine 3 6 50.0
pod 3 3 100.0
total 15 31 48.3


line stmt bran cond sub pod time code
1             package Dist::Zilla::App::Command::update;
2              
3 1     1   13388 use strict;
  1         2  
  1         40  
4 1     1   4 use warnings;
  1         2  
  1         57  
5             our $VERSION = '0.05';
6              
7 1     1   437 use Dist::Zilla::App -command;
  1         35633  
  1         12  
8              
9 0     0 1   sub abstract { "update generated files by building and then removing the build" }
10              
11             sub opt_spec {
12 0     0 1   [ 'trial' => 'build a trial release' ],
13             }
14              
15             sub execute {
16 0     0 1   my ($self, $opt) = @_;
17 0           my $zilla;
18             {
19 0 0         local $ENV{TRIAL} = $opt->trial ? 1 : 0;
  0            
20 0           $zilla = $self->zilla;
21             }
22 0           $self->log("update: building into tmpdir");
23 0           my ($built_in) = $self->zilla->ensure_built_in_tmpdir;
24 0           $self->log("update: removing $built_in");
25 0           $built_in->rmtree;
26             }
27              
28             1;
29             __END__
30              
31             =encoding utf-8
32              
33             =head1 NAME
34              
35             Dist::Zilla::App::Command::update - A Dist::Zilla (and hence Dist::Milla)
36             command to update generated files
37              
38             =head1 SYNOPSIS
39              
40             $ dzil update [--trial]
41             $ milla update # my use case
42              
43             =head1 DESCRIPTION
44              
45             This command is approximated by
46              
47             $ dzil build --no-tgz [--trial]
48             $ rm -rf Your-Package-x.yz/
49              
50             but it builds inside a temporary directory. If you've ever used C<dzil build
51             && dzil clean> to update generated files, now you can use C<dzil update>.
52             That's all!
53              
54             =head1 OPTIONS
55              
56             =head2 --trial
57              
58             Build a trial release, as if C<dzil build> was called with --trial.
59              
60             =head1 AUTHOR
61              
62             Thomas Sibley E<lt>tsibley@cpan.orgE<gt>
63              
64             =head1 COPYRIGHT
65              
66             Copyright 2014- Thomas Sibley
67              
68             =head1 LICENSE
69              
70             This library is free software; you can redistribute it and/or modify
71             it under the same terms as Perl itself.
72              
73             =head1 SEE ALSO
74              
75             L<dzil>
76              
77             L<Dist::Zilla>
78              
79             L<milla>
80              
81             L<Dist::Milla>
82              
83             =cut