NAME
Pinto::Store - Back-end storage for a Pinto repository
VERSION
version 0.015
DESCRIPTION
Pinto::Store is the default back-end for a Pinto repository. It basically just represents files on disk. You should look at Pinto::Store::Svn or Pinto::Store::Git for a more interesting example.
METHODS
is_initialized()
Returns true if the store appears to be initialized. In this base class, it simply means that the working directory exists. For other derived classes, this could mean that the working copy is up-to-date.
initialize()
This method is called before each batch of Pinto events, and is responsible for doing any setup work that is required by the Store. This could include making a directory on the file system, checking out or updating a working copy, cloning, or pulling commits. If the initialization fails, an exception should be thrown. The default implementation simply creates a directory. Returns a reference to this Store.
finalize(message => 'what happened')
This method is called after each batch of Pinto events and is responsible for doing any work that is required to commit the Store. This could include scheduling files for addition/deletion, pushing commits to a remote repository, and/or making a tag. If the finalization fails, an exception should be thrown. The default implementation merely logs the message. Returns a reference to this Store.
add( file => $some_file, source => $other_file )
Adds the specified file
(as a Path::Class::File) to this Store. The path to file
is presumed to be somewhere beneath the root directory of this Store. If the optional source
is given (also as a Path::Class::File), then that source
is first copied to file
. If source
is not specified, then the file
must already exist. Croaks on failure. Returns a reference to this Store.
remove( file => $some_file )
Removes the specified file
(as a Path::Class::File) from this Store. The path to file
is presumed to be somewhere beneath the root directory of this Store. Any empty directories above file
will also be removed. Croaks on failure. Returns a reference to this Store.
AUTHOR
Jeffrey Ryan Thalhammer <jeff@imaginative-software.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2011 by Imaginative Software Systems.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.