Bernard Simon > App-Followme-1.06 > App::Followme

Download:
App-Followme-1.06.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: 1.06   Source   Latest Release: App-Followme-1.10

NAME ^

App::Followme - Update a static website

SYNOPSIS ^

    use App::Followme;
    my $app = App::Followme->new(\%configuration);
    $app->run($directory);

DESCRIPTION ^

See App::Followme::Guide for more information on how to install and configure followme.

This class reads and processes the configuration files in a website and as a result of that runs the modules named in them.

The configuration file for followme is followme.cfg in the top directory of your site. It contains the names of the Perl modules that are run when the followme command is run:

    run_before = App::Followme::FormatPages
    run_before = App::Followme::ConvertPages

Perl modules are run in the order they appear in the configuration file. If they are named run_before then they are run before modules in configuration files in subdirectories. If they are named run_after, they are run after modules in configuration files in subdirectories. See App::Followme::Guide for an overview of the available modules.

A larger website will be spread across several folders. Each folder can have its own configuration file. If they contain modules, they will be run on that folder and all the subfolders below it.

Followme is run from the folder it is invoked from if it is called with no arguments, or if it is run with arguments, it will run on the folder passed as an argument or the folder the file passed as an argument is contained in. Followme looks for its configuration files in all the directories above the directory it is run from and runs all the modules it finds in them. But they are are only run on the folder it is run from and subfolders of it. Followme only looks at the folder it is run from to determine if other files in the folder need to be updated. So after changing a file, it should be run from the directory containing the file.

When followme is run, it searches the directories above it for configuration files. The topmost file defines the top directory of the website. It reads each configuration file it finds and then starts updating the directory passed as an argument to run, or if no directory is passed, the directory the followme script is run from.

Configuration file lines are organized as lines containing

    NAME = VALUE

and may contain blank lines or comment lines starting with a #. Values in configuration files are combined with those set in the files in directories above it.

The run_before and run_after parameters contain the names of modules to be run on the directory containing the configuration file and possibly its subdirectories. There may be more than one run_before or run_after parameter in a configuration file. They are run in order, starting with the modules in the topmost configuration file. Each module to be run must have new and run methods. An object of the module's class is created by calling the new method with the a reference to a hash containing the configuration parameters. The run method is then called with the directory as its argument.

CONFIGURATION ^

The following parameter is used from the configuration:

configuration_file

The name of the file containing the configuration data. The default value is followme.cfg. The followme script derives the value of this parameter from the name of the script, so by adding a link to the script, you can have different sets of configuration files.

LICENSE ^

Copyright (C) Bernie Simon.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHOR ^

Bernie Simon <bernie.simon@gmail.com>

syntax highlighting: