Dist::Zilla::Role::MintingProfile::ShareDir - something that keeps its minting profile in a sharedir


Dist-Zilla documentation Contained in the Dist-Zilla distribution.

Index


Code Index:

NAME

Top

Dist::Zilla::Role::MintingProfile::ShareDir - something that keeps its minting profile in a sharedir

VERSION

Top

version 4.200008

DESCRIPTION

Top

This role includes Dist::Zilla::Role::MintingProfile, providing a profile_dir method that looks in the module's ShareDir.

AUTHOR

Top

Ricardo SIGNES <rjbs@cpan.org>

COPYRIGHT AND LICENSE

Top


Dist-Zilla documentation Contained in the Dist-Zilla distribution.

package Dist::Zilla::Role::MintingProfile::ShareDir;
BEGIN {
  $Dist::Zilla::Role::MintingProfile::ShareDir::VERSION = '4.200008';
}
# ABSTRACT: something that keeps its minting profile in a sharedir
use Moose::Role;
with 'Dist::Zilla::Role::MintingProfile';

use File::ShareDir;
use Path::Class;


sub profile_dir {
  my ($self, $profile_name) = @_;

  my $profile_dir = dir( File::ShareDir::module_dir($self->meta->name) )
                  ->subdir( $profile_name );

  return $profile_dir if -d $profile_dir;

  confess "Can't find profile $profile_name via $self";
}

no Moose::Role;
1;

__END__