App-git-ship
view release on metacpan or search on metacpan
lib/App/git/ship.pm view on Meta::CPAN
}
$self->abort("Could not figure out what kind of project this is from '$file'");
}
sub dump {
return Data::Dumper->new([$_[1]])->Indent(1)->Terse(1)->Sortkeys(1)->Dump;
}
sub new {
my $self = shift->SUPER::new(@_);
open $self->{STDOUT}, '>&STDOUT';
open $self->{STDERR}, '>&STDERR';
return $self;
}
sub render_template {
my ($self, $name, $args) = @_;
my $template = $self->_get_template($name) or $self->abort("Could not find template for $name");
# Render to string
lib/App/git/ship/perl.pm view on Meta::CPAN
/^$VERSION_RE\s*/ or next;
$self->config(next_version => $1);
last;
}
}
$self->run_hook('before_ship');
$self->system(qw(git add Makefile.PL), $changelog);
$self->system(qw(git add README.md)) if -e 'README.md';
$self->system(qw(git commit -a -m), $self->_changes_to_commit_message);
$self->SUPER::ship(@_); # after all the changes
$uploader->upload_file($dist_file);
$self->run_hook('after_ship');
}
sub start {
my $self = shift;
my $changelog = $self->config('changelog_filename');
if (my $file = $_[0]) {
$file = $file =~ m!^.?lib! ? path($file) : path(lib => $file);
lib/App/git/ship/perl.pm view on Meta::CPAN
unless (-e $file) {
my $work_dir = lc($self->config('project_name')) =~ s!::!-!gr;
mkdir $work_dir;
chdir $work_dir or $self->abort("Could not chdir to $work_dir");
$self->config('main_module_path')->dirname->make_path;
open my $MAINMODULE, '>>', $self->config('main_module_path')
or $self->abort("Could not create %s", $self->config('main_module_path'));
}
}
$self->SUPER::start(@_);
$self->render_template('.travis.yml');
$self->render_template('.perltidyrc', {template_from_home => 1});
$self->render_template('cpanfile');
$self->render_template('Changes') if $changelog eq 'Changes';
$self->render_template('MANIFEST.SKIP');
$self->render_template('t/00-basic.t');
$self->system(qw(git add .perltidyrc .travis.yml cpanfile MANIFEST.SKIP t), $changelog);
$self->system(qw(git commit --amend -C HEAD --allow-empty)) if @_;
$self;
}
( run in 0.253 second using v1.01-cache-2.11-cpan-a9ef4e587e4 )