P4Ruby

Introduction

P4Ruby is an extension to the Ruby programming language that allows you to run Perforce commands from within Ruby scripts, and get the results in a Ruby-friendly format.

The main features are:

  • Get Perforce data and forms in hashes and arrays.

  • Edit Perforce forms by modifying hashes.

  • Exception based error handling.

  • Controllable handling of warnings such as "File(s) up-to-date." on a sync.

  • Run as many commands on a connection as required.

  • The output of a command is returned as a Ruby array. For non-tagged output, the elements of the array are strings. For tagged output, the elements of the array are Ruby hashes. For forms, the output is an array of P4::Spec objects.

  • Thread-safe and thread-friendly; you can have multiple instances of the P4 class running in different threads.

  • Exception-based error handling. Trap P4Exceptions for complete, high-level error handling.

The most recent release of P4Ruby is 2014.1.