| Dist-Zilla documentation | Contained in the Dist-Zilla distribution. |
Dist::Zilla::Role::File - something that can act like a file
version 4.200008
This role describes a file that may be written into the shipped distribution.
This is the name of the file to be written out.
This is a string describing when and why the file was added to the distribution. It will generally be set by a plugin implementing the FileInjector role.
This is the mode with which the file should be written out. It's an integer
with the usual chmod semantics. It defaults to 0644.
Ricardo SIGNES <rjbs@cpan.org>
This software is copyright (c) 2011 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.
| Dist-Zilla documentation | Contained in the Dist-Zilla distribution. |
package Dist::Zilla::Role::File; BEGIN { $Dist::Zilla::Role::File::VERSION = '4.200008'; } # ABSTRACT: something that can act like a file use Moose::Role; use Moose::Util::TypeConstraints; use namespace::autoclean; has name => ( is => 'rw', isa => 'Str', # Path::Class::File? required => 1, ); has added_by => ( is => 'ro', ); my $safe_file_mode = subtype( as 'Int', where { not( $_ & 0002) }, message { "file mode would be world-writeable" } ); has mode => ( is => 'rw', isa => $safe_file_mode, default => 0644, ); requires 'content'; no Moose::Role; 1; __END__