GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  GIT::REPOSITORY::PLUGIN (3)

.ds Aq ’

NAME

Git::Repository::Plugin - Base class for Git::Repository plugins

CONTENTS

SYNOPSIS



    package Git::Repository::Plugin::Hello;

    use Git::Repository::Plugin;
    our @ISA = qw( Git::Repository::Plugin );

    sub _keywords { return qw( hello hello_gitdir ) }

    sub hello        { return "Hello, git world!\n"; }
    sub hello_gitdir { return "Hello, " . $_[0]->git_dir . "!\n"; }

    1;



DESCRIPTION

Git::Repository::Plugin allows one to define new methods for Git::Repository, that will be imported in the Git::Repository namespace.

The SYNOPSIS provides a full example.

The documentation of Git::Repository describes how to load plugins with all the methods they provide, or only a selection of them.

METHODS

Git::Repository::Plugin provides a single method:

    install



    $plugin->install( @keywords );



Install all keywords provided in the Git::Repository namespace.

If called with an empty list, will install all available keywords.

SUBCLASSING

    Adding methods to Git::Repository

When creating a plugin, the new keywords (i.e. methods) that are added by the plugin to Git::Repository must be returned by a _keywords() method.

    Adding attributes to Git::Repository

Git::Repository is a blessed hash reference.

If extra attributes are needed, the recommended name for the hash key (to avoid name clashes between plugins) is _plugin_name_attribute, where name is the plugin lowercase name, and attribute is the attribute name.

AUTHOR

Philippe Bruhat (BooK) <book@cpan.org>

ACKNOWLEDGEMENTS

Thanks to Todd Rinaldo, who wanted to add more methods to Git::Repository, which made me look for a solution that would preserve the minimalism of Git::Repository.

After a not-so-good design using @ISA (so Git::Repository would inherit the extra methods), further discussions with Aristotle Pagaltzis and a quick peek at Dancer’s plugin management helped me come up with the current design. Thank you Aristotle and the Dancer team.

Further improvements to the plugin system proposed by Aristotle Pagaltzis.

COPYRIGHT

Copyright 2010-2016 Philippe Bruhat (BooK), all rights reserved.

LICENSE

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 GIT::REPOSITORY::PLUGIN (3) 2016-03-12

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.