File tree 4 files changed +48
-0
lines changed
4 files changed +48
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ Revision history for {{$dist->name}}
3
3
{{$NEXT}}
4
4
- restrict [MetaYAML] to metaspec v1.4, [MetaJSON] to v2.0+, as other
5
5
version combinations are not well-supported by the toolchain
6
+ - [MetaJSON] is now in [@Basic], with special handling to handle the
7
+ possibility the plugin is loaded twice
6
8
7
9
6.006 2016-07-04 10:56:36-04:00 America/New_York
8
10
- add some documentation to Dist::Zilla::App::Tester (thanks, Alberto
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ use Moose;
5
5
with ' Dist::Zilla::Role::FileGatherer' ;
6
6
use Moose::Util::TypeConstraints;
7
7
8
+ use List::Util ' first' ;
8
9
use namespace::autoclean;
9
10
10
11
=head1 DESCRIPTION
@@ -54,6 +55,12 @@ sub gather_files {
54
55
55
56
my $zilla = $self -> zilla;
56
57
58
+ # gracefully handle there being more than one of us (e.g. one via [@Basic])
59
+ if ((first { $_ -> isa(__PACKAGE__ ) } @{ $self -> zilla-> plugins }) != $self ) {
60
+ $self -> log (' doing nothing: another [MetaJSON] already ran...' );
61
+ return ;
62
+ }
63
+
57
64
require JSON::MaybeXS;
58
65
require Dist::Zilla::File::FromCode;
59
66
require CPAN::Meta::Converter;
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ sub configure {
14
14
PruneCruft
15
15
ManifestSkip
16
16
MetaYAML
17
+ MetaJSON
17
18
License
18
19
Readme
19
20
ExtraTests
@@ -45,6 +46,7 @@ It includes the following plugins with their default configuration:
45
46
* L<Dist::Zilla::Plugin::PruneCruft>
46
47
* L<Dist::Zilla::Plugin::ManifestSkip>
47
48
* L<Dist::Zilla::Plugin::MetaYAML>
49
+ * L<Dist::Zilla::Plugin::MetaJSON>
48
50
* L<Dist::Zilla::Plugin::License>
49
51
* L<Dist::Zilla::Plugin::Readme>
50
52
* L<Dist::Zilla::Plugin::ExtraTests>
Original file line number Diff line number Diff line change
1
+ use strict;
2
+ use warnings;
3
+
4
+ use Test::More 0.88;
5
+ use if $ENV {AUTHOR_TESTING }, ' Test::Warnings' ;
6
+ use Test::DZil;
7
+ use Test::Fatal;
8
+ use Path::Tiny;
9
+
10
+ {
11
+ my $tzil = Builder-> from_config(
12
+ { dist_root => ' does-not-exist' },
13
+ {
14
+ add_files => {
15
+ ' source/dist.ini' => simple_ini(
16
+ ' @Basic' ,
17
+ ' MetaJSON' ,
18
+ ),
19
+ },
20
+ },
21
+ );
22
+
23
+ $tzil -> chrome-> logger-> set_debug(1);
24
+ is(
25
+ exception { $tzil -> build },
26
+ undef ,
27
+ ' build proceeds normally' ,
28
+ );
29
+
30
+ my $build_dir = path($tzil -> tempdir)-> child(' build' );
31
+ ok(-e $build_dir -> child(' META.json' ), ' META.json was created successfully' );
32
+
33
+ diag ' got log messages: ' , explain $tzil -> log_messages
34
+ if not Test::Builder-> new-> is_passing;
35
+ }
36
+
37
+ done_testing;
You can’t perform that action at this time.
0 commit comments