The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

mcbain2pod - Generate a POD file for a McBain API

SYNOPSIS

        # in the command line
        $ mcbain2pod -o myapi.pod MyAPI
 

DESCRIPTION

mcbain2pod is a simple command line utility to automatically generate documentation in POD format for a McBain API.

This is pretty simply at the moment, it will describe basic usage of your API, and will list all routes and methods defined by the API (in all its topics, not just the root one), using the description given to them during definition (if any), and list the parameters they except to receive.

Usage is simply, just give the script the package name of your API. The script will try to find it in @INC, which you can manipulate using the -I switch (see "OPTIONS").

OPTIONS

-I, --include

Specify a directory for @INC where to search for the API

-o, -output

Print the generated POD into the specified file instead of to standard output

-h, --help

Display usage information

NAME

$api

USAGE

You can use the $api API in several ways, the easiest being directly from Perl code. See McBain::Directly for more information.

A simple example:

        use $api;

        my \$result = $api->call('GET:/some_route', \%params);

You can also load $api as a RESTful web service (with McBain::WithPSGI), as a Gearman worker (with McBain::WithGearmanXS), and possibly other McBain::With* modules available from CPAN.

ROUTES

The following routes are provided by this API:

";

my $routes = $McBain::INFO{$api};

foreach my $route (sort keys %$routes) { foreach my $method (sort keys %{$routes->{$route}}) { my $opts = $routes->{$route}->{$method}; print "=head2 $method $route\n\n"; if ($opts->{description}) { print "$opts->{description}\n\n"; } else { print "No description provided\n\n"; } if ($opts->{params}) { print "Expects the following parameters:\n\n=over\n\n"; foreach my $param (sort keys %{$opts->{params}}) { print "=item * $param: ", join(', ', keys %{$opts->{params}->{$param}}), "\n\n"; } print "=back\n\n"; } } }

print "=cut\n";

SEE ALSO

McBain

BUGS AND LIMITATIONS

Please report any bugs or feature requests to bug-McBain@rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=McBain.

SUPPORT

You can find documentation for this module by invoking it with the -h switch:

        mcbain2pod -h
 

AUTHOR

Ido Perlmuter <ido@ido50.net>

LICENSE AND COPYRIGHT

Copyright (c) 2013, Ido Perlmuter ido@ido50.net.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either version 5.8.1 or any later version. See perlartistic and perlgpl.

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

DISCLAIMER OF WARRANTY

BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.