File Coverage

blib/lib/Dist/Zilla/App/Command/update.pm
Criterion Covered Total %
statement 7 9 77.7
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 10 12 83.3


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