Skip to content

Commit

Permalink
Added MetaConfig data to consumers.
Browse files Browse the repository at this point in the history
   This however requires a TRIAL releases, as this change module requires ::Plugin
   to already be composed in, but our tests and documentation unfortunately instructed
   users to compose it in *before* that, leading to a breakage.
  • Loading branch information
kentfredric committed May 1, 2016
1 parent fd831bc commit edbd3ac
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 5 deletions.
6 changes: 5 additions & 1 deletion Changes
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
Revision history for {{$dist->name}}

{{$NEXT}}
- Added MetaConfig data to consumers.
- This however requires a TRIAL releases, as this change module requires ::Plugin to already be composed in, but our
tests and documentation unfortunately instructed users to compose it in *before* that, leading to a breakage.

[Dependencies::Stats]
- Dependencies changed since 1.001001, see misc/*.deps* for details
- configure: +1 (recommends: ↑1)
- develop: +14 ↑3 -3 (recommends: +1, suggests: ↑2)
- runtime: ↓1 -1 (recommends: +2)
- test: +1 (recommends: +1 ↑1 ↓1)
- test: +2 (recommends: +1 ↑1 ↓1)

1.001001 2014-08-15T21:39:24Z
[00 Trivial]
Expand Down
2 changes: 2 additions & 0 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ my %WriteMakefileArgs = (
"Dist::Zilla::File::FromCode" => 0,
"Dist::Zilla::Role::FileInjector" => 0,
"Dist::Zilla::Role::InstallTool" => 0,
"Dist::Zilla::Role::Plugin" => 0,
"Dist::Zilla::Tester" => 0,
"ExtUtils::MakeMaker" => 0,
"File::Spec" => 0,
Expand All @@ -57,6 +58,7 @@ my %FallbackPrereqs = (
"Dist::Zilla::File::InMemory" => 0,
"Dist::Zilla::Role::FileInjector" => 0,
"Dist::Zilla::Role::InstallTool" => 0,
"Dist::Zilla::Role::Plugin" => 0,
"Dist::Zilla::Tester" => 0,
"ExtUtils::MakeMaker" => 0,
"File::Spec" => 0,
Expand Down
2 changes: 1 addition & 1 deletion README.mkdn
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ version 1.001002
Dist::Zilla::Plugin::FooBar;

use Moose;
with 'Dist::Zilla::Role::Tempdir';
with 'Dist::Zilla::Role::FileInjector';
with 'Dist::Zilla::Role::InstallTool';
with 'Dist::Zilla::Role::Tempdir';

sub setup_installer {
my ( $self, $arg ) = @_ ;
Expand Down
16 changes: 13 additions & 3 deletions lib/Dist/Zilla/Role/Tempdir.pm
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,21 @@ our $VERSION = '1.001002';

# AUTHORITY

use Moose::Role;
use Moose::Role qw( around with );
use Path::Tiny qw(path);
use Dist::Zilla::Tempdir::Dir;
use Scalar::Util qw( blessed );
use namespace::autoclean;

around dump_config => sub {
my ( $orig, $self, @args ) = @_;
my $config = $self->$orig(@args);
my $payload = $config->{ +__PACKAGE__ } = {};
$payload->{ q[$] . __PACKAGE__ . '::VERSION' } = $VERSION;
return $config;
};

no Moose::Role;
=method capture_tempdir
Creates a temporary and dumps the current state of Dist::Zilla's files into it.
Expand All @@ -37,6 +46,8 @@ Make sure to look at L<< C<Dist::Zilla::Tempdir::Item>|Dist::Zilla::Tempdir::Ite
=cut



sub capture_tempdir {
my ( $self, $code, $args ) = @_;

Expand All @@ -60,7 +71,6 @@ sub capture_tempdir {
return $tdir->files;
}

no Moose::Role;
1;

=head1 SYNOPSIS
Expand All @@ -69,9 +79,9 @@ no Moose::Role;
Dist::Zilla::Plugin::FooBar;
use Moose;
with 'Dist::Zilla::Role::Tempdir';
with 'Dist::Zilla::Role::FileInjector';
with 'Dist::Zilla::Role::InstallTool';
with 'Dist::Zilla::Role::Tempdir';
sub setup_installer {
my ( $self, $arg ) = @_ ;
Expand Down
1 change: 1 addition & 0 deletions misc/Changes.deps
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ This file contains changes in REQUIRED dependencies for standard CPAN phases (co
- perl 5.006

[Added / test requires]
- Dist::Zilla::Role::Plugin
- perl 5.006

[Changed / runtime requires]
Expand Down
1 change: 1 addition & 0 deletions misc/Changes.deps.all
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ This file contains ALL changes in dependencies in both REQUIRED / OPTIONAL depen
- Dist::Zilla 5

[Added / test requires]
- Dist::Zilla::Role::Plugin
- perl 5.006

[Changed / configure recommends]
Expand Down
2 changes: 2 additions & 0 deletions t/01-poc.t
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ EOF

package Dist::Zilla::Plugin::TestTempDir;
use Moose;
with 'Dist::Zilla::Role::Plugin';
with 'Dist::Zilla::Role::Tempdir';
with 'Dist::Zilla::Role::FileInjector';
with 'Dist::Zilla::Role::InstallTool';


sub setup_installer {
my ( $self, $arg ) = @_;

Expand Down
1 change: 1 addition & 0 deletions t/02-poc-oo.t
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ EOF

package Dist::Zilla::Plugin::TestTempDir;
use Moose;
with 'Dist::Zilla::Role::Plugin';
with 'Dist::Zilla::Role::Tempdir';
with 'Dist::Zilla::Role::FileInjector';
with 'Dist::Zilla::Role::InstallTool';
Expand Down
1 change: 1 addition & 0 deletions t/03-from-code.t
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ my $called_capture = 0;
package Dist::Zilla::Plugin::TestTempDir;
use Moose;
use Path::Tiny qw(path);
with 'Dist::Zilla::Role::Plugin';
with 'Dist::Zilla::Role::Tempdir';
with 'Dist::Zilla::Role::FileInjector';
with 'Dist::Zilla::Role::InstallTool';
Expand Down

0 comments on commit edbd3ac

Please sign in to comment.