NAME
Perl::Signature::Set - Create, store and check groups of signatures
DESCRIPTION
There are a number of cases where you might want to create and look after a whole bunch of signatures.
The most common of these is:
1. Generate signatures
2. Do some process that shouldn't change the files functionally
3. Test to make sure it didn't
Examples for 2. could be things like applying Perl::Tidy, merging in documentation-only patches from external sources, and other similar things.
Perl::Signature::Set lets you create an object that can store a while bunch of file signatures, save the set to a file, load it in again, and test the lot to check for changes.
Saving and Loading
For simplicity and easy of creation, Perl::Signature::Set has been implemented as a subclass of Config::Tiny.
METHODS
new
Creates a new Perl::Signature::Set object. Takes as an optional argument the normalization layer you wish to use.
Returns a new Perl::Signature::Set object.
layer
The layer
accessor returns the normalization layer that was used for all of the signatures in the object.
add $file
The add
method takes the name of a file to generate a signature for and add to the set.
Returns the actual Perl::Signature object created as a convenience, or undef
if the file has already been added, or on error.
files
The files
method provides all of the names of the files contained in the set, in default sorted order.
Returns a list of file names, or the null list if the set contains no files.
file $filename
The file
method is used to get the Perl::Signature object for a single named file.
Returns a Perl::Signature object, or undef
if the file is not in the set.
signatures
The signatures
method returns all of the Signature objects from the Set, in filename-sorted order.
Returns a list of Perl::Signature objects, or the null list if the set does not contain any Signature objects.
changes
The changes
method checks the signatures for each file and provides a hash listing the files that have changed as the key, and either "changed" or "removed" as the value.
Returns a HASH reference, false (''
) if there are no changes, or undef
on error.
SUPPORT
All bugs should be filed via the CPAN bug tracker at
http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Perl-Signature
For other issues, or commercial enhancement or support, contact the author.
AUTHORS
Adam Kennedy <adamk@cpan.org>
SEE ALSO
http://ali.as/, PPI, Perl::Signature, Perl::Compare
COPYRIGHT
Copyright 2005 - 2008 Adam Kennedy.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.