Alt-CPAN-Uploader-tinyua
    
    
  
  
  
view release on metacpan or search on metacpan
bin/cpan-upload view on Meta::CPAN
$arg{password} = $opt->password if $opt->_specified('password');
if (
  ! $arg{password}
  and defined $from_file->{user}
  and ($arg{user} eq uc $from_file->{user})
) {
  $arg{password} = $from_file->{password};
}
$arg{debug}  = 1 if $opt->verbose;
$arg{subdir} = $opt->directory if defined $opt->directory;
$arg{ $_ } = $opt->$_ for grep { defined $opt->$_ } qw(dry_run http_proxy);
if (! $arg{password}) {
  require Term::ReadKey;
  local $| = 1;
  print "PAUSE Password: ";
  Term::ReadKey::ReadMode('noecho');
  chop($arg{password} = <STDIN>);
lib/CPAN/Uploader.pm view on Meta::CPAN
  $uploader->upload_file($file);
Valid arguments are:
  user       - (required) your CPAN / PAUSE id
  password   - (required) your CPAN / PAUSE password
  subdir     - the directory (under your home directory) to upload to
  http_proxy - uri of the http proxy to use
  upload_uri - uri of the upload handler; usually the default (PAUSE) is right
  debug      - if set to true, spew lots more debugging output
This method attempts to actually upload the named file to the CPAN.  It will
raise an exception on error.
=cut
sub upload_file {
  my ($self, $file, $arg) = @_;
  Carp::confess(q{don't supply %arg when calling upload_file on an object})
lib/CPAN/Uploader.pm view on Meta::CPAN
    if ($response->status eq '404') {
      die $self->target, "'s CGI for handling messages seems to have moved!\n",
        "(HTTP response code of 404 from the ", $self->target, " web server)\n",
        "It used to be: ", $uri, "\n",
        "Please inform the maintainer of @{[__PACKAGE__]}.\n";
    } else {
      die "request failed with error code ", $response->status,
        "\n  Message: ", $response->reason, "\n";
    }
  } else {
    $self->log_debug($_) for (
      "Looks OK!",
      "----- RESPONSE BEGIN -----\n" .
      $response->content . "\n" .
      "----- RESPONSE END -------\n"
    );
    $self->log($self->target . " add message sent ok [" . $response->status . "]");
  }
}
lib/CPAN/Uploader.pm view on Meta::CPAN
screen.  The message should not end in a newline, as one will be added as
needed.
=cut
sub log {
  shift;
  print "$_[0]\n"
}
=method log_debug
This method behaves like C<L</log>>, but only logs the message if the
CPAN::Uploader is in debug mode.
=cut
sub log_debug {
  my $self = shift;
  return unless $self->{debug};
  $self->log($_[0]);
}
1;
( run in 0.746 second using v1.01-cache-2.11-cpan-5dc5da66d9d )