AnnoCPAN

 view release on metacpan or  search on metacpan

lib/AnnoCPAN/DBI.pm  view on Meta::CPAN

    # if people reload, submit twice, or are otherwise repetitive
    my @notes   = $self->search(
        note    => $data->{note},
        ip      => $data->{ip},
        pod     => $data->{pod},
        section => $data->{section},
    );
    return if @notes;

    # create the note
    my $note    = $self->SUPER::create($data);
    AnnoCPAN::DBI::NotePos->create({ 
        note => $note, section => $section, 
        score => SCALE, status => ORIGINAL });

    $self->reset_dbh;
    unless (fork) {
        # child process
        nice(+19);
        close STDIN;
        close STDOUT;

lib/AnnoCPAN/DBI.pm  view on Meta::CPAN

        for my $pv ($pod->podvers) {
            if ($pv->id != $podver->id) { # note was not added here
                $note->guess_section($pv);
            }
        }
        exit;
    }
    return $note; # only parent returns
}

sub simple_create { shift->SUPER::create(@_) }
sub simple_update { shift->SUPER::update(@_) }

sub guess_section {
    my ($self, $podver) = @_;

    # delete cached html
    $podver->flush_cache;

    # XXX version check might go here
    my $ref_section = $self->section or return;
    my $orig_cont = $ref_section->content;

lib/AnnoCPAN/DBI.pm  view on Meta::CPAN

        return 1;
    }
    return;
}

sub update {
    my $self = shift;
    for my $pv ($self->pod->podvers) {
        $pv->flush_cache;
    }
    $self->SUPER::update(@_);
}

sub delete {
    my $self = shift;
    for my $pv ($self->pod->podvers) {
        $pv->flush_cache;
    }
    $self->SUPER::delete(@_);
}

sub ref_notepos {
    my ($self) = @_;
    AnnoCPAN::DBI::NotePos->retrieve(note => $self, section => $self->section);
}

sub html {
    my ($self) = @_;

lib/AnnoCPAN/Dist.pm  view on Meta::CPAN

are printed to STDOUT and STDERR when extracting the file.

=cut

sub new {
    my ($class, $fname, %options) = @_;
    
    return unless $fname =~ m{(authors/id/.*)};
    my $rel_pathname = $1;
    # let CPAN::DistnameInfo do the guessing
    my $self = $class->SUPER::new($fname);
    $self->{verbose}        = $options{verbose};
    $self->{rel_pathname}   = $rel_pathname;

    # XXX should make sure we like the filename...

    $self;
}

=item $obj->archive



( run in 1.107 second using v1.01-cache-2.11-cpan-49f99fa48dc )