<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <html><head> <title>Class: P4Global</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link rel=StyleSheet href=".././rdoc-style.css" type="text/css" media="screen" /> <script type="text/javascript" language="JavaScript"> <!-- function popCode(url) { window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") } //--> </script> </head> <body bgcolor="white"> <table summary="Information on class" width="100%" border="0" cellspacing="0"> <tr class="title-row"> <td class="big-title-font"> <sup><font color="aqua">Class</font></sup> P4Global </td> <td align="right"> <table summary="layout" cellspacing="0" cellpadding="2"> <tr valign="top"> <td class="small-title-font">In:</td> <td class="small-title-font"> <a href="../files/P4table_rb.html" class="aqua"> P4table.rb </a> <br /> </td> </tr> <tr> <td class="small-title-font">Parent:</td> <td class="small-title-font"> Object </td> </tr> </table> </td> </tr> </table> <!-- banner header --> <div class="description"><p> This class just provides two globally accessible Perforce client instances without the use of global variables. One P4 client runs in tagged mode and one in untagged mode. Most of the queries need tagged mode, but when we want to run a "p4 job -o" to archive the job, we need it in plain text. </p> <p> This class is also the reason why <a href="P4Table.html">P4Table</a> is not thread safe as all of the other classes that execute commands use it directly. I wanted to avoid excessive passing of P4 objects but in the end I'll probably have to go that way. </p> </div> <table summary="Methods" cellpadding="5" width="100%"> <tr><td class="tablesubtitle">Methods</td></tr> </table> <div class="name-list"> <a href="#M000010">connect</a> <a href="#M000014">debug=</a> <a href="#M000011">disconnect</a> <a href="#M000009">p4client=</a> <a href="#M000008">p4passwd=</a> <a href="#M000007">p4port=</a> <a href="#M000006">p4user=</a> <a href="#M000013">plain</a> <a href="#M000012">tagged</a> </div> <table summary="Method list" cellpadding="5" width="100%"> <tr><td class="tablesubtitle">Public Class methods</td></tr> </table> <table summary="method" width="100%" cellspacing="0" cellpadding="5" border="0"> <tr><td class="methodtitle"> <a name="M000006"></a> <b>p4user=</b>( user ) </td></tr> </table> <div class="description"> <p> Set the username for both tagged and untagged mode </p> </div> <pre class="source"> <span class="cmt"># File P4table.rb, line 138</span> <span class="kw">def</span> P4Global.p4user=( user ) @@p4t.user = user @@p4u.user = user <span class="kw">end</span> </pre> <table summary="method" width="100%" cellspacing="0" cellpadding="5" border="0"> <tr><td class="methodtitle"> <a name="M000007"></a> <b>p4port=</b>( port ) </td></tr> </table> <div class="description"> <p> Set the port for both tagged and untagged mode </p> </div> <pre class="source"> <span class="cmt"># File P4table.rb, line 144</span> <span class="kw">def</span> P4Global.p4port=( port ) @@p4t.port = port @@p4u.port = port <span class="kw">end</span> </pre> <table summary="method" width="100%" cellspacing="0" cellpadding="5" border="0"> <tr><td class="methodtitle"> <a name="M000008"></a> <b>p4passwd=</b>( password ) </td></tr> </table> <div class="description"> <p> Set the password for both tagged and untagged mode </p> </div> <pre class="source"> <span class="cmt"># File P4table.rb, line 150</span> <span class="kw">def</span> P4Global.p4passwd=( password ) @@p4t.password = password @@p4u.password = password <span class="kw">end</span> </pre> <table summary="method" width="100%" cellspacing="0" cellpadding="5" border="0"> <tr><td class="methodtitle"> <a name="M000009"></a> <b>p4client=</b>( client ) </td></tr> </table> <div class="description"> <p> Set the clientspec for both tagged and untagged mode </p> </div> <pre class="source"> <span class="cmt"># File P4table.rb, line 156</span> <span class="kw">def</span> P4Global.p4client=( client ) @@p4t.client = client @@p4u.client = client <span class="kw">end</span> </pre> <table summary="method" width="100%" cellspacing="0" cellpadding="5" border="0"> <tr><td class="methodtitle"> <a name="M000010"></a> <b>connect</b>() </td></tr> </table> <div class="description"> <p> Connect both tagged and untagged clients to the server </p> </div> <pre class="source"> <span class="cmt"># File P4table.rb, line 162</span> <span class="kw">def</span> P4Global.connect @@p4t.connect @@p4u.connect <span class="kw">end</span> </pre> <table summary="method" width="100%" cellspacing="0" cellpadding="5" border="0"> <tr><td class="methodtitle"> <a name="M000011"></a> <b>disconnect</b>() </td></tr> </table> <div class="description"> <p> Disconnect both tagged and untagged mode clients </p> </div> <pre class="source"> <span class="cmt"># File P4table.rb, line 168</span> <span class="kw">def</span> P4Global.disconnect @@p4t.disconnect @@p4u.disconnect <span class="kw">end</span> </pre> <table summary="method" width="100%" cellspacing="0" cellpadding="5" border="0"> <tr><td class="methodtitle"> <a name="M000012"></a> <b>tagged</b>() </td></tr> </table> <div class="description"> <p> Returns the tagged mode client </p> </div> <pre class="source"> <span class="cmt"># File P4table.rb, line 174</span> <span class="kw">def</span> P4Global.tagged @@p4t <span class="kw">end</span> </pre> <table summary="method" width="100%" cellspacing="0" cellpadding="5" border="0"> <tr><td class="methodtitle"> <a name="M000013"></a> <b>plain</b>() </td></tr> </table> <div class="description"> <p> Returns the untagged mode client </p> </div> <pre class="source"> <span class="cmt"># File P4table.rb, line 179</span> <span class="kw">def</span> P4Global.plain @@p4u <span class="kw">end</span> </pre> <table summary="method" width="100%" cellspacing="0" cellpadding="5" border="0"> <tr><td class="methodtitle"> <a name="M000014"></a> <b>debug=</b>( level ) </td></tr> </table> <div class="description"> <p> Sets the debug level for both tagged and untagged mode (2 is good) </p> </div> <pre class="source"> <span class="cmt"># File P4table.rb, line 184</span> <span class="kw">def</span> P4Global.debug=( level ) @@p4t.debug = level @@p4u.debug = level <span class="kw">end</span> </pre> </body>
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 4677 | Tony Smith |
Move P4table.rb to the P4Ruby library and rename it to p4table.rb instead. There's an update coming so this is just the move. |
||
#1 | 3093 | Tony Smith |
Move docs for P4Table in preparation for upcoming docs for specsaver.rb |
||
//guest/tony_smith/perforce/utils/doc/classes/P4Global.html | |||||
#1 | 2396 | Tony Smith |
Add RDoc documentation for P4Table.rb. Very pretty. |