P4/Ruby

## P4/Ruby - Programmers Guide

### Contents

Introduction
Classes Defined
Support

### Introduction

P4/Ruby is an extension to the Ruby programming language which allows direct access to the Perforce API from within Ruby scripts.

P4/Ruby is designed to work in a Ruby-like way as far as possible. It has support for Ruby exceptions to make error handling as easy as possible and smooths out a few of the rough edges in Perforce's error reporting to make it even easier.

### Requirements

Building P4/Ruby requires version 2001.1 or later of the Perforce API. Running P4/Ruby requires a 99.2 or later Perforce server to be of any real use to you. Earlier servers did not support tagged output in the same way.

### Classes Defined

P4/Ruby defines several Ruby classes.

P4 is the main class used for configuring your environment and running commands.

P4Exception is used as part of error reporting and is derived from the Ruby RuntimeError class.

The following utility classes defined by P4/Ruby are used to provide a structured interface for examining the results of certain specific Perforce commands. Currently the only command that enjoys this support is "p4 filelog", but others will be added on an as-needed basis.

- P4DepotFile
- P4Revision
- P4Integration

### Support

Contact the author Tony Smith directly for support. I'll respond as quickly as I'm able. All feedback and suggestions are most welcome.