Games-Sudoku-General

 view release on metacpan or  search on metacpan

inc/My/Module/Recommend.pm  view on Meta::CPAN

package My::Module::Recommend;

use strict;
use warnings;

use Carp;
use My::Module::Recommend::Any qw{ __any };

my @optionals = (
    __any( 'Clipboard'		=> <<'EOD' ),
      This module is needed to exchange data with the system clipboard.
      If you do not intend to use the copy() or paste() methods, you do
      not need to install this module.
EOD
);

sub optionals {
    return ( map { $_->modules() } @optionals );
}

sub recommend {
    my $need_some;
    foreach my $mod ( @optionals ) {
	defined( my $msg = $mod->recommend() )
	    or next;
	$need_some++
	    or warn <<'EOD';

The following optional modules were not available:
EOD
	warn "\n$msg";
    }
    $need_some
	and warn <<'EOD';

It is not necessary to install these now. If you decide to install them
later, this software will make use of them when it finds them.

EOD

    return;
}

1;

__END__

=head1 NAME

My::Module::Recommend - Recommend modules to install. 

=head1 SYNOPSIS

 use lib qw{ inc };
 use My::Module::Recommend;
 My::Module::Recommend->recommend();

=head1 DETAILS

This package generates the recommendations for optional modules. It is
intended to be called by the build system. The build system's own
mechanism is not used because we find its output on the Draconian side.

=head1 METHODS

This class supports the following public methods:

=head2 optionals

 say for My::Module::Recommend->optionals();



( run in 2.493 seconds using v1.01-cache-2.11-cpan-2398b32b56e )