ADAMK-Release

 view release on metacpan or  search on metacpan

lib/ADAMK/Release.pm  view on Meta::CPAN

	my $message = pop @_;
	my $cmd     = join ' ', @_;
	my $env     = $self->env(
		ADAMK_RELEASE     => 1,
		RELEASE_TESTING   => $ENV{RELEASE_TESTING}   ? 1 : 0,
		AUTOMATED_TESTING => $ENV{AUTOMATED_TESTING} ? 1 : 0,
	);
	print "> $cmd\n" if $self->verbose;
	my $rv = ! system( "$env $cmd" );
	if ( $rv or ! @_ ) {
		return $rv;
	}
	$self->error($message);
}

sub env {
	my $self = shift;
	my %env  = @_;
	join ' ', map { "$_=$env{$_}" } sort keys %env;
}

sub error {
	my $self    = shift;
	my $message = sprintf(shift, @_);
	Carp::croak($message);
}

sub prompt {
	my $self = shift;
	return IO::Prompt::Tiny::prompt(@_);
}

sub password {
	my $self     = shift;
	my $password = undef;
	if ( defined $_[0] ) {
		print "$_[0] ";
	}
	eval {
		Term::ReadKey::ReadMode('noecho');
		$password = <STDIN>;
	};
	Term::ReadKey::ReadMode(0);
	return undef if not defined $password;
	chomp($password);
	return $password;
}

1;

__END__

=head1 NAME

ADAMK::Release - 

=head1 DESCRIPTION

C<ADAMK::Release> is the backend behind the C<adamk-release> script that
is used to build distribution tarballs for modules with the minimalist
repository style.

=head1 AUTHORS

Adam Kennedy E<lt>adamk@cpan.orgE<gt>

=head1 SEE ALSO

L<http://ali.as/>

=head1 COPYRIGHT

Copyright 2013 Adam Kennedy.

This program is free software; you can redistribute
it and/or modify it under the same terms as Perl itself.

The full text of the license can be found in the
LICENSE file included with this module.



( run in 0.906 second using v1.01-cache-2.11-cpan-39bf76dae61 )