The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Test::AutoBuild::Monitor - Builder progress monitor

SYNOPSIS

  use Test::AutoBuild::Monitor

  my $rep = Test::AutoBuild::Monitor->new(
               name => "foo",
               label => "Some thing",
               enabled => 1,
               options => \%options,
               env => \%env);

  # Add a module to the repository
  $rep->module($module_name, $module);

  # Initialize the repository
  $rep->init();

  # Checkout / update the module
  my $changed = $rep->export($name, $module);

DESCRIPTION

This module provides the API for interacting with the source control repositories. A repository implementation has to be able to do two main things

 * Get a checkout of a new module
 * Update an existing checkout, determining if any
   changes where made

CONFIGURATION

The valid configuration options for the repositories block are

METHODS

my $monitor = Test::AutoBuild::Monitor->new(name => $name, label => $label, [enabled => $enabled,] [options => \%options,] [env => \%env]);

This method creates a new monitor. The name parameter specifies a short alpha-numeric name for the monitor. The label parameter specifies an arbitrary label for presenting to usres. The optional options argument is a hashref of implementation specific options. The optional env argument is a hashref of environment variables to set when handling notifications.

$monitor->init(%params);

This method initializes the monitor object & is called automatically from the new method with the named parameters passed to that method.

my $name = $monitor->name([$newname]);

Retrieves the name of this monitor, a short alpha-numeric token. If the optional $newname parameter is specified then the name is updated.

my $name = $monitor->label([$newname]);

Retrieves the name of this monitor, a short alpha-numeric token. If the optional $newname parameter is specified then the name is updated.

my $name = $monitor->is_enabled([$state]);

Returns a true value if this monitor is marked as enabled. If the optional $status parameter is specified then the enabled state is updated. If this method returns a false value, then the notify method will not call process, effectively becoming a no-op

my $monitor->notify($event_name, @args);

Send a notification to this monitor. The $event_name parameter is a short alpha-numeric token representing the event triggering this notification. The @args params are arbitrary data items specific to this event. If the is_enabled method returns a true value, this method will invoke the proces method to actually handle the event, otherwise it will be a no-op

my $monitor->process($event_name, @args);

This method must be implemented by sub-classes to provide the notification processing they require. The default implementation will simply call die. The arguments are the same as those for the notify method.

my $value = $rep->option($name[, $value]);

When run with a single argument, retuns the option value corresponding to the name specified in the first argument. If a second argument is supplied, then the option value is updated.

my $value = $rep->env($name[, $value]);

When run with a single argument, retuns the environment variable corresponding to the name specified in the first argument. If a second argument is supplied, then the environment variable is updated.

AUTHORS

Daniel Berrange <dan@berrange.com>

COPYRIGHT

Copyright (C) 2005 Daniel Berrange <dan@berrange.com>

SEE ALSO

perl(1), Test::AutoBuild::Monitor::CommandLine, Test::AutoBuild::Monitor::Log4perl, Test::AutoBuild::Monitor::Pipe