|
Classes implementing a generic database model on top of plain text files stored in Perforce.
Every record consists of fields/values and may have associated files. The data for each record is stored as both a job and a text file. The text file is always called <id>/record and any associated files are also stored alongside the record file. i.e. <id>/file1 <id>/file2.
Each table name is a folder name and all records for that table are stored in text files under that folder. i.e. <table>/<id>/record
All column names must also be fields in the jobspec so you can search for records using "p4 jobs -e".
NOTE: | When creating your jobspec, make sure that ALL field names are in lowercase. Ruby likes method names to be lowercase and it fits better as well as reducing scope for errors. |
The job version of any record contains only the latest version of that record for searching purposes.
WARNING: | This software is designed to have its OWN Perforce server to work with. DO NOT USE IT AGAINST AN EXISTING PERFORCE SERVER. |
For a quick start, take a look at the P4Table class as all your tables should be derived from it and the Jobspec rules below.
When creating your jobspec observe the following rules for any chance of success.
Below is the jobspec used for a FAX tracking application based on P4Ruby which should give you some idea of the possibilities.
# A Perforce Job Spec Specification. # # Updating this form can be dangerous! # See 'p4 help jobspec' for proper directions. Fields: 101 job word 32 required 102 status select 10 required 103 owner word 32 required 104 modified_date date 20 always 105 note text 0 optional 106 sender line 32 optional 107 fax_number line 32 optional 108 files text 80 optional 109 date_received date 20 once 110 date_closed date 20 optional
Values: status open/closed Presets: status open owner $user modified_date $now date_received $now
Comments:
Required files |
Classes and Modules |