<html> <head> <title>P4/Ruby</title> </head> <body> <h2>P4/Ruby - Programmers Guide</h2> <a name="_toc"></a> <h3>Contents</h3> <a href="#intro">Introduction</a><br> <a href="#classes">Classes Defined</a><br> <a href="#support">Support</a><br> <hr> <a name="intro"></a> <h3>Introduction</h3> P4/Ruby is an extension to the <a href="http://www.ruby-lang.org">Ruby</a> programming language which allows direct access to the Perforce API from within Ruby scripts. <p> 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. <a name="classes"></a> <h3>Classes Defined</h3> P4/Ruby defines several Ruby classes. <p> <a href="P4.html">P4</a> is the main class used for configuring your environment and running commands. <p> <a href="P4Exception.html">P4Exception</a> is used as part of error reporting and is derived from the Ruby <b>RuntimeError</b> class. <p> 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. <p> <ul> <li><a href="P4DepotFile.html">P4DepotFile</a> <li><a href="P4Revision.html">P4Revision</a> <li><a href="P4Integration.html">P4Integration</a> </ul> <p> <hr> <a name="support"></a> <h3>Support</h3> Contact the author <a href="mailto:tony@smee.org">Tony Smith</a> directly for support. I'll respond as quickly as I'm able. All feedback and suggestions are most welcome. </body> </html>
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#9 | 5791 | Tony Smith |
Add experimental support for passing a block to P4#run_resolve. The block is passed a P4::MergeData object encapsulating the context of each merge performed. The block should evaluate to a string indicating the desired result of the merge: 'ay', 'at', 'am', 's', etc. The P4::MergeData object contains information about the files involved in the merge and can invoke an external merge tool. This is still experimental at this stage so the interface may change as it evolves. |
||
#8 | 4680 | Tony Smith |
Make P4Ruby return new P4::Spec objects instead of plain old hashes when parse_forms mode is in use. A P4::Spec object is derived from Hash so should be backwards compatible with previous code. P4::Spec provides limited fieldname validation on forms and accessor methods for quick and easy access to the fields in the form. The accessor methods are all prefixed with '_' to avoid colliding with methods from the Hash parent class. This is a little ugly, but deriving from hash is a big win, so it's worth it. This change also fixes a minor bug found along the way. Spec parsing and formatting wouldn't work with labels, branches, depots and groups unless you'd previously run a P4::fetch_label( <label> ), P4::fetch_branch( <branch> ) etc. etc. This is because the spec parsing code internally runs one of these commands in order to grab the specdef from the server but it wasn't providing a spec name. i.e. it was using 'p4 client -o' and assuming that this would work for other types of spec too. It does, but not for all spec types. So, now the spec parsing code will use a bogus name for the spec types that require it. |
||
#7 | 4675 | Tony Smith |
A little doc tweaking. The docs frontpage for P4Ruby now looks a little more appealing and has an improved structure. |
||
#6 | 4660 | Tony Smith | Some doc tidying. | ||
#5 | 4653 | Tony Smith |
More documentation tweaks. Just makes the pages look more like the reference pages in the 'Pickaxe book' |
||
#4 | 4255 | Tony Smith |
P4Ruby doc reformatting. Now uses CSS instead of 1x1 image and too many tables. Could no doubt be improved upon, but it's a start. |
||
#3 | 2426 | Tony Smith | Doc beautifying for P4Ruby. | ||
#2 | 1411 | Tony Smith | Document API version requirements for P4/Ruby | ||
#1 | 1324 | Tony Smith |
P4/Ruby documentation update. Changed doc layout and added in docs for newly added methods and classes. |