P4Triggers.rb

Path: P4Triggers.rb
Last Update: Fri Nov 19 09:48:32 GMT 2004

Introduction

Name: P4Triggers.rb

Author: Tony Smith <tony@perforce.com>

Description

    A library for use when writing Perforce triggers. Methods and classes
    common to all my example triggers are to be found in here. The framework
    for a trigger is very simple:

    1. You derive your trigger class from P4Trigger
    2. You implement the validate() method to decide whether or not to
       allow the submit
    3. You send output to the user using the message() method
    4. You raise exceptions to report runtime errors P4Exceptions are
       already handled for you.
    5. Your trigger script should call P4Trigger#parse_change() and should use
       the value returned as its exit status.

    And that's all there is to it!

    The P4Change class merits some familiarisation because objects of this
    class are what you get when you call P4Trigger#change() and it's a
    very convenient way to examine the changelist being submitted.

    If you're just getting started with this framework, start by looking at
    the P4Trigger class and then look at P4Change.

Classes and Modules

Class FileType
Class P4
Class P4Change
Class P4Trigger

[Validate]