checkcase.rb
Path: checkcase.rb
Modified: Fri Sep 26 16:12:32 BST 2003

Introduction

Name: checkcase.rb

Author: Tony Smith <tony@perforce.com>

Description

    Example trigger to ensure that new files being added are
    consistent in their use of case w.r.t. existing directories.

    This implementation is reasonably efficient as it only uses
    "p4 depots" and "p4 dirs" commands and restricts itself to
    looking only at the paths that it needs to.

Requires

    Ruby
    P4Ruby
    P4Triggers module

Example ‘triggers’ section:

    Triggers:
      checkcase  //...  "ruby whatever/checkcase.rb %changelist%"

Note

    For triggers I recommend you use a P4CONFIG file rather than hard coding
    username/password in the script itself. This script assumes you've taken
    that advice.
Required files
P4    P4Triggers   
Classes and Modules
Class CaseTrigger