/usr/share/perl5/Dist/Zilla/Dist/Minter.pm is in libdist-zilla-perl 5.043-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | package Dist::Zilla::Dist::Minter;
# ABSTRACT: distribution builder; installer not included!
$Dist::Zilla::Dist::Minter::VERSION = '5.043';
use Moose 0.92; # role composition fixes
extends 'Dist::Zilla';
use File::pushd ();
use Path::Class;
use namespace::autoclean;
sub _setup_default_plugins {
my ($self) = @_;
unless ($self->plugin_named(':DefaultModuleMaker')) {
require Dist::Zilla::Plugin::TemplateModule;
my $plugin = Dist::Zilla::Plugin::TemplateModule->new({
plugin_name => ':DefaultModuleMaker',
zilla => $self,
});
push @{ $self->plugins }, $plugin;
}
}
sub _new_from_profile {
my ($class, $profile_data, $arg) = @_;
$arg ||= {};
my $config_class =
$arg->{config_class} ||= 'Dist::Zilla::MVP::Reader::Finder';
Class::Load::load_class($config_class);
$arg->{chrome}->logger->log_debug(
{ prefix => '[DZ] ' },
"reading configuration using $config_class"
);
require Dist::Zilla::MVP::Assembler::Zilla;
require Dist::Zilla::MVP::Section;
my $assembler = Dist::Zilla::MVP::Assembler::Zilla->new({
chrome => $arg->{chrome},
zilla_class => $class,
section_class => 'Dist::Zilla::MVP::Section', # make this DZMA default
});
for ($assembler->sequence->section_named('_')) {
$_->add_value(name => $arg->{name});
$_->add_value(chrome => $arg->{chrome});
$_->add_value(_global_stashes => $arg->{_global_stashes})
if $arg->{_global_stashes};
}
my $module = String::RewritePrefix->rewrite(
{ '' => 'Dist::Zilla::MintingProfile::', '=', => '' },
$profile_data->[0],
);
Class::Load::load_class($module);
my $profile_dir = $module->profile_dir($profile_data->[1]);
$assembler->sequence->section_named('_')->add_value(root => $profile_dir);
my $seq = $config_class->read_config(
$profile_dir->file('profile'),
{
assembler => $assembler
},
);
my $self = $seq->section_named('_')->zilla;
$self->_setup_default_plugins;
return $self;
}
sub _mint_target_dir {
my ($self) = @_;
my $name = $self->name;
my $dir = dir($name);
$self->log_fatal("./$name already exists") if -e $dir;
return $dir = $dir->absolute;
}
sub mint_dist {
my ($self, $arg) = @_;
my $name = $self->name;
my $dir = $self->_mint_target_dir;
# XXX: We should have a way to get more than one module name in, and to
# supply plugin names for the minter to use. -- rjbs, 2010-05-03
my @modules = do {
(my $module_name = $name) =~ s/-/::/g;
({ name => $module_name });
};
$self->log("making target dir $dir");
$dir->mkpath;
my $wd = File::pushd::pushd($self->root);
$_->before_mint for @{ $self->plugins_with(-BeforeMint) };
for my $module (@modules) {
my $minter = $self->plugin_named(
$module->{minter_name} || ':DefaultModuleMaker'
);
$minter->make_module({ name => $module->{name} })
}
$_->gather_files for @{ $self->plugins_with(-FileGatherer) };
$_->set_file_encodings for @{ $self->plugins_with(-EncodingProvider) };
$_->prune_files for @{ $self->plugins_with(-FilePruner) };
$_->munge_files for @{ $self->plugins_with(-FileMunger) };
$self->_check_dupe_files;
$self->log("writing files to $dir");
for my $file (@{ $self->files }) {
$self->_write_out_file($file, $dir);
}
$_->after_mint({ mint_root => $dir })
for @{ $self->plugins_with(-AfterMint) };
$self->log("dist minted in ./$name");
}
__PACKAGE__->meta->make_immutable;
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
Dist::Zilla::Dist::Minter - distribution builder; installer not included!
=head1 VERSION
version 5.043
=head1 AUTHOR
Ricardo SIGNES <rjbs@cpan.org>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2016 by Ricardo SIGNES.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut
|