<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>P4Ruby</title>
<link rel="stylesheet" type="text/css" href="docstyle.css" />
</head>
<body>
<h2>P4Ruby - Programmers Guide</h2>
<div>
<a name="_toc"></a>
<h3>Contents</h3>
<div class="index">
<a href="#intro">Introduction</a>
<a href="#features">Features at a glance</a>
<a href="#classes">Classes Defined</a>
<a href="#support">Support</a>
<a href="#requirements">Requirements</a>
</div>
</div>
<div>
<a name="intro"></a>
<h3>Introduction</h3>
<div class="indent">
<p>
P4Ruby is an extension to the <a href="http://www.ruby-lang.org">Ruby</a>
programming language that allows you to run Perforce commands from
within Ruby scripts, and get the results in a Ruby-friendly format.
</p>
<p>
P4Ruby 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
even distinguishes between errors and warnings - allowing you to ignore
warnings whilst still trapping errors.
</p>
<p>
If you're new to P4Ruby, the best place to start is with the
documentation for the
<a href="P4.html">P4 class</a>. This is the main Ruby class defined
by P4Ruby.
</p>
</div>
</div>
<div>
<a name="features"></a>
<h3>Features at a glance</h3>
<div>
<ul>
<li>
Connect once and run several commands.
</li>
<li>
The output of commands is returned as a Ruby array.
</li>
<li>
The elements of the array returned are strings or, where appropriate,
Ruby hashes.
</li>
<li>
Tagged mode output (i.e. 'p4 fstat' or 'p4 -Ztag changes') is
returned as a Ruby hash. See
<a href="P4.html#tagged">P4#tagged</a>.
</li>
<li>
Optionally converts all Perforce forms (changes/clients/labels etc.)
into Ruby hashes and back again. This allows you to fetch the
existing definition of an object, alter one or more fields in the hash
and use the modified hash to update Perforce. See
<a href="P4.html#parse_forms">P4#parse_forms</a>.
</li>
<li>
Thread-safe and thread-friendly - have multiple instances of
the P4 class running in different threads.
</li>
<li>
Exception-based error handling. Trap P4Exceptions for complete,
high-level error handling.
</li>
<li>
Connect once and run several commands
</li>
</ul>
</div>
</div>
<div>
<a name="classes"></a>
<h3>Classes Defined</h3>
<div>
<ul>
<li>
<a href="P4.html">P4</a>
<div class="itemdesc">
The main class used for executing Perforce commands. Almost
everything you do with P4Ruby will involve this class. If you're
new to P4Ruby, start here.
</div>
</li>
<li>
<a href="P4DepotFile.html">P4DepotFile</a>
<div class="itemdesc">
Utility class allowing quick and easy access to the attributes
of a file in the depot.
Returned by <span class="inlinecode">P4#run_filelog</span>.
</div>
</li>
<li>
<a href="P4Exception.html">P4Exception</a>
<div class="itemdesc">
Used as part of error reporting and is derived from the Ruby
<b>RuntimeError</b> class.
</div>
</li>
<li>
<a href="P4Integration.html">P4Integration</a>
<div class="itemdesc">
Utility class allowing quick and easy access to the attributes
of an integration record for a revision of a file in the depot.
Returned by <span class="inlinecode">P4#run_filelog</span>.
</div>
</li>
<li>
<a href="P4Revision.html">P4Revision</a>
<div class="itemdesc">
Utility class allowing quick and easy access to the attributes
of a revision of a file in the depot.
Returned by <span class="inlinecode">P4#run_filelog</span>.
</div>
</li>
<li>
<a href="P4MergeData.html">P4::MergeData</a>
<div class="itemdesc">
Class encapsulating the context of an individual merge during
execution of a 'p4 resolve'. Passed as a parameter to the
block passed to P4#run_resolve.
</div>
</li>
<li>
<a href="P4Spec.html">P4::Spec</a>
<div class="itemdesc">
Subclass of hash allowing quick and easy access to the fields
in a Perforce form (spec). Also checks that the fields that
are set are valid fields for the given type of spec.
Returned by
<span class="inlinecode">P4#fetch_<spec_type></span>.
</div>
</li>
</ul>
</div>
</div>
<div>
<a name="support"></a>
<h3>Support</h3>
<div class="indent">
<p>
Sign up to the
<a href="http://maillist.perforce.com/mailman/listinfo/p4ruby">p4ruby mailing list</a>
and post your question to the list. Alternatively, you can
contact the author <a href="mailto:[email protected]">Tony Smith</a> directly
for support. I'll respond as quickly as I'm able. All feedback and
suggestions are most welcome.
</p>
</div>
</div>
<div>
<a name="requirements"></a>
<h3>Requirements</h3>
<div class="indent">
<p>
Building P4Ruby requires version 2001.1 or later of the Perforce API and
a C++ compiler - ideally the same C++ compiler used to build the Perforce
API.
</p>
<p>
Running P4Ruby 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.
</p>
<p>
The more recent your server, the better as tagged output support is
continually being improved.
</p>
</div>
</div>
</body>
</html>
| # | Change | User | Description | Committed | |
|---|---|---|---|---|---|
| #2 | 14520 | tony |
Replace old P4Ruby documentation with a RELNOTES file, (and ultimately, Doug's new manual), and update the MANIFEST to match (and include the new tests) I've also removed the old installer files as our new installer won't use them. |
||
| #1 | 14480 | tony |
Add P4Ruby 1.5944 to main as start-point for the first productized release of P4Ruby |