Dist-Zilla-BeLike-CSJEWELL

changeset 23:59601d1912fb

$archive is really a Path::Class::Dir.
author Curtis Jewell <csjewell@cpan.org>
date Fri Aug 13 12:15:41 2010 -0600 (2010-08-13)
parents e83e5c5ca9fd
children d6d5a4bafd13
files lib/Dist/Zilla/Plugin/CSJEWELL/FTPUploadToOwnSite.pm lib/Dist/Zilla/Plugin/CSJEWELL/SubversionDist.pm
line diff
     1.1 --- a/lib/Dist/Zilla/Plugin/CSJEWELL/FTPUploadToOwnSite.pm	Fri Aug 13 12:01:54 2010 -0600
     1.2 +++ b/lib/Dist/Zilla/Plugin/CSJEWELL/FTPUploadToOwnSite.pm	Fri Aug 13 12:15:41 2010 -0600
     1.3 @@ -36,6 +36,7 @@
     1.4  sub release {
     1.5  	my ( $self, $archive ) = @_;
     1.6  
     1.7 +	my $filename = $archive->stringify();
     1.8  	my $site     = $self->site();
     1.9  	my $siteinfo = Net::Netrc->lookup($site);
    1.10  	if ( not $siteinfo ) {
    1.11 @@ -59,15 +60,15 @@
    1.12  	  or $self->log_fatal(
    1.13  		'Could not change remote site directory to' . $self->directory() );
    1.14  
    1.15 -	my $remote_file = $ftp->put($archive);
    1.16 +	my $remote_file = $ftp->put($filename);
    1.17  
    1.18 -	if ( $remote_file ne $archive ) {
    1.19 +	if ( $remote_file ne $filename ) {
    1.20  		$self->log_fatal( 'Could not upload file: ' . $ftp->message() );
    1.21  	}
    1.22  
    1.23  	my $remote_size = $ftp->size($remote_file);
    1.24  	$remote_size ||= 0;
    1.25 -	my $local_size = -s $archive;
    1.26 +	my $local_size = -s $filename;
    1.27  
    1.28  	if ( $remote_size != $local_size ) {
    1.29  		$self->log( "Uploaded file is $remote_size bytes, "
     2.1 --- a/lib/Dist/Zilla/Plugin/CSJEWELL/SubversionDist.pm	Fri Aug 13 12:01:54 2010 -0600
     2.2 +++ b/lib/Dist/Zilla/Plugin/CSJEWELL/SubversionDist.pm	Fri Aug 13 12:15:41 2010 -0600
     2.3 @@ -28,18 +28,15 @@
     2.4  sub release {
     2.5  	my ( $self, $archive ) = @_;
     2.6  
     2.7 -	my $zilla = $self->zilla();
     2.8 -
     2.9 -	$self->log($archive);
    2.10 -
    2.11 -	my $remote_file = $self->directory() . $archive;
    2.12 +	my $filename    = $archive->stringify();
    2.13 +	my $remote_file = $self->directory() . $filename;
    2.14  	my $bot_name    = $self->name();
    2.15  	my ( $release, $version ) =
    2.16 -	  $archive =~ m/([\w-]+)-([\d_.]+)(?:-TRIAL)?.tar.gz/msx;
    2.17 -	$release   =~ s/-/::/gms;
    2.18 +	  $filename =~ m/([\w-]+)-([\d_.]+)(?:-TRIAL)?.tar.gz/msx;
    2.19 +	$release    =~ s/-/::/gms;
    2.20  	my $message = "[$bot_name] Importing upload file for $release $version";
    2.21  
    2.22 -	my $command = qq(svn import $archive $remote_file -m "$message" 2>&1);
    2.23 +	my $command = qq(svn import $filename $remote_file -m "$message" 2>&1);
    2.24  	if ( $self->fake_release() ) {
    2.25  		$self->log($command);
    2.26  	} else {