Module::Pluggable::Loader - Just load plugins, aware of development directories


Module-Pluggable-Loader documentation Contained in the Module-Pluggable-Loader distribution.

Index


Code Index:

NAME

Top

Module::Pluggable::Loader - Just load plugins, aware of development directories

VERSION

Top

version 1.100860

SYNOPSIS

Top

    use Module::Pluggable::Loader 'My::Plugin::Namespace';

DESCRIPTION

Top

This module is a simple loader for plugins found by Module::Pluggable. The search paths can be specified when using the module. Module::Pluggable's search_dirs option will be made aware of development directories found by Devel::SearchINC, if any exist.

The plugins will then be loaded, but not instantiated.

One use for this module is when defining test classes - see Test::Class - as plugins. You don't want to instantiate those classes, just load them and let Test::Class handle the rest.

FUNCTIONS

Top

import

Handles the calls to Module::Pluggable at compile-time, that is, when calling use() on this module.

INSTALLATION

Top

See perlmodinstall for information and options on installing Perl modules.

BUGS AND LIMITATIONS

Top

No bugs have been reported.

Please report any bugs or feature requests through the web interface at http://rt.cpan.org/Public/Dist/Display.html?Name=Module-Pluggable-Loader.

AVAILABILITY

Top

The latest version of this module is available from the Comprehensive Perl Archive Network (CPAN). Visit http://www.perl.com/CPAN/ to find a CPAN site near you, or see http://search.cpan.org/dist/Module-Pluggable-Loader/.

The development version lives at http://github.com/hanekomu/Module-Pluggable-Loader/. Instead of sending patches, please fork this project using the standard git and github infrastructure.

AUTHOR

Top

  Marcel Gruenauer <marcel@cpan.org>

COPYRIGHT AND LICENSE

Top


Module-Pluggable-Loader documentation Contained in the Module-Pluggable-Loader distribution.

use 5.008;
use strict;
use warnings;

package Module::Pluggable::Loader;
our $VERSION = '1.100860';
# ABSTRACT: Just load plugins, aware of development directories

sub import {
    my ($class, @namespaces) = @_;
    my $caller = (caller)[0];
    require Module::Pluggable;
    Module::Pluggable->import(
        package     => $caller,
        search_path => \@namespaces,
        (   @Devel::SearchINC::inc
            ? (search_dirs => \@Devel::SearchINC::inc)
            : ()
        ),
        require => 1
    );
    $caller->plugins;    # just load the plugins
}
1;


__END__