#!/usr/bin/perl -w

=head1 NAME

dh_rdoc - generates and installs Ruby documentation

=cut

use strict;
use Debian::Debhelper::Dh_Lib;

=head1 SYNOPSIS

B<dh_rdoc> [S<I<debhelper options>>] [B<-d>] [S<I<library dirs ...>>]

=head1 DESCRIPTION

dh_rdoc is a debhelper program that is responsible for generating
documentation, in both rdoc and RI formats.

=head1 CONFORMS TO

Debian policy, version 3.6.2.1

Ruby policy, unofficial proposed version

=cut

init();

foreach my $package (@{$dh{DOPACKAGES}}) {
    my $doc_dir = tmpdir($package)."/usr/share/doc/$package/rdoc";
    my $config  = pkgfile($package, 'rdoc');
    my @dirs = ('lib');
    if (-r $config) {
        open F, $config;
		local $/;
        @dirs = split(/\s/s, <F>);
        close F;
    }
    doit(qw(rdoc --all --inline-source --diagram --fileboxes --line-numbers --fmt=html -o), $doc_dir, @dirs);
}

=head1 SEE ALSO

L<debhelper(7)>

This program is a part of ruby-pkg-tools.

=head1 AUTHOR

Esteban Manchado Velzquez <zoso@debian.org>

=cut
