Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add autogeneration_warning option #41

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions lib/Dist/Zilla/Role/TravisYML.pm
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,16 @@ has $_ => ( rw, isa => ArrayRef[Str], default => sub { [] } ) for (
@phases
);

has dzil_branch => ( rw, isa => Str );
has build_branch => ( rw, isa => Str, default => '/^build\/.*/' );
has notify_email => ( rw, isa => ArrayRef[Str], default => sub { [ 1 ] } );
has notify_irc => ( rw, isa => ArrayRef[Str], default => sub { [ 0 ] } );
has mvdt => ( rw, isa => Bool, default => 0 );
has test_authordeps => ( rw, isa => Bool, default => 0 );
has test_deps => ( rw, isa => Bool, default => 1 );
has support_builddir => ( rw, isa => Bool, default => 0 );
has sudo => ( rw, isa => Bool, default => 0 );
has dzil_branch => ( rw, isa => Str );
has build_branch => ( rw, isa => Str, default => '/^build\/.*/' );
has notify_email => ( rw, isa => ArrayRef[Str], default => sub { [ 1 ] } );
has notify_irc => ( rw, isa => ArrayRef[Str], default => sub { [ 0 ] } );
has mvdt => ( rw, isa => Bool, default => 0 );
has test_authordeps => ( rw, isa => Bool, default => 0 );
has test_deps => ( rw, isa => Bool, default => 1 );
has support_builddir => ( rw, isa => Bool, default => 0 );
has sudo => ( rw, isa => Bool, default => 0 );
has autogeneration_warning => ( rw, isa => Bool, default => 1 );

has irc_template => ( rw, isa => ArrayRef[Str], default => sub { [
"%{branch}#%{build_number} by %{author}: %{message} (%{build_url})",
Expand Down Expand Up @@ -352,6 +353,10 @@ sub build_travis_yml {
$travis_yml =~ s/^(\s+- )(5\.\d+|blead)$/$1'$2'/gm;
$travis_yml =~ s/^(\s+(?:- )?perl: )(5\.\d+|blead)$/$1'$2'/gm;

if ($self->autogeneration_warning) {
$travis_yml = "# Autogenerated from dist.ini by ".__PACKAGE__." - DO NOT EDIT!\n$travis_yml";
}

my $file = Path::Class::File->new($self->zilla->built_in, '.travis.yml');
$file->spew($travis_yml);
return $file;
Expand Down