AnyEvent-Riak

 view release on metacpan or  search on metacpan

pbc/generate_doc.pl  view on Meta::CPAN

    }
    if (/^\s+(.*)$/) {
        my $item = $1;
        $item =~ s/ = \d+;$//;
        if ($enum_name) {
            push @{$enums{$enum_name} //= []}, $item;
            next;
        }
        my ($p1, $type, $name) = split(/\s+/, $item);
        defined $name or
          say STDERR "$c ($_)";
        $current_pod .= "=item $name\n\n";
        $type = $mapper{$type} // $type;
        if (exists $enums{$type}) {
            $type = 'one of ' . join(', ', map { "'$_'" } @{$enums{$type}} )
        }
        $current_pod .= "$p1, $type\n\n";
        $current_comment
          and $current_pod .= $current_comment;
        $postfix_comment
          and $current_pod .= ($current_comment ? '. ': '') . $postfix_comment;
        $postfix_comment || $postfix_comment
          and $current_pod .= "\n\n";
        $current_comment = '';
        next;
    }
}

$pod .= $methods_pod . $responses_pod . $objects_pod;

say $pod;

sub _from_camel {
    my $s = $_[0];
    $s =~ s/(.)([A-Z])([a-z])/$1 . '_' . lc($2) . $3/ge;
    $s =~ s/^([A-Z])([a-z])/lc($1) . $2/e;
    $s;
}



( run in 1.215 second using v1.01-cache-2.11-cpan-483215c6ad5 )