P4.html #3

  • //
  • guest/
  • tony_smith/
  • perforce/
  • P4Rubylib/
  • triggers/
  • doc/
  • classes/
  • P4.html
  • View
  • Commits
  • Open Download .zip Download (6 KB)
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<title>Class: P4</title>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
	<meta http-equiv="Content-Script-Type" content="text/javascript" />
	<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
	<script type="text/javascript">
	// <![CDATA[

	function popupCode( url ) {
		window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
	}

	function toggleCode( id ) {
		if ( document.getElementById )
			elem = document.getElementById( id );
		else if ( document.all )
			elem = eval( "document.all." + id );
		else
			return false;

		elemStyle = elem.style;
		
		if ( elemStyle.display != "block" ) {
			elemStyle.display = "block"
		} else {
			elemStyle.display = "none"
		}

		return true;
	}
	
	// Make codeblocks hidden by default
	document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
	
	// ]]>
	</script>

</head>
<body>



    <div id="classHeader">
        <h1>P4 <sup class="type-note">(Class)</sup></h1>
        <table class="header-table">
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../files/P4Triggers_rb.html">
                P4Triggers.rb
                </a>
				<br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                Object
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

	<div id="bodyContent">


	<div id="contextContent">

		<div id="description">
			<p>
Reopen the <a href="P4.html">P4</a> class to restructuring the output of
&quot;p4 describe -s&quot; into a <a href="P4Change.html">P4Change</a>
object, and to disable any attempt to submit - just in case someone&#8217;s
foolish enough to try
</p>

		</div>


		<div id="method-list">
			<h2 class="section-bar">Methods</h2>

			<div class="name-list">
			<a href="#M000012">run_describe</a>&nbsp;&nbsp;
			<a href="#M000014">run_submit</a>&nbsp;&nbsp;
			<a href="#M000013">submit_spec</a>&nbsp;&nbsp;
			</div>
		</div>




			

	</div>



		<!-- if includes -->


		<!-- if method_list -->
		<div id="methods">
			<h2 class="section-bar">Public Instance methods</h2>

			<div id="method-M000012" class="method-detail">
				<a name="M000012"></a>

				<div class="method-heading">
					<a href="#M000012" class="method-signature">
					<span class="method-name">run_describe</span><span class="method-args">( *args )</span>
					</a>
				</div>
			
				<div class="method-description">
					<p><a class="source-toggle" href="#"
					  onclick="toggleCode('M000012-source');return false;">[Source]</a></p>
					<div class="method-source-code" id="M000012-source">
<pre>
     <span class="ruby-comment cmt"># File P4Triggers.rb, line 128</span>
128:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run_describe</span>( <span class="ruby-operator">*</span><span class="ruby-identifier">args</span> )
129:         <span class="ruby-identifier">h</span> = <span class="ruby-identifier">run</span>( <span class="ruby-value str">&quot;describe&quot;</span>, <span class="ruby-identifier">args</span> ).<span class="ruby-identifier">shift</span>
130:         <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">h</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">h</span>.<span class="ruby-identifier">kind_of?</span>( <span class="ruby-constant">Hash</span> )
131:         <span class="ruby-keyword kw">return</span> <span class="ruby-constant">P4Change</span>.<span class="ruby-identifier">new</span>( <span class="ruby-identifier">h</span> )
132:     <span class="ruby-keyword kw">end</span>
</pre>
					</div>
				</div>
			</div>

			<div id="method-M000014" class="method-detail">
				<a name="M000014"></a>

				<div class="method-heading">
					<a href="#M000014" class="method-signature">
					<span class="method-name">run_submit</span><span class="method-args">()</span>
					</a>
				</div>
			
				<div class="method-description">
					<p>
Disable the direct interface to submit
</p>
					<p><a class="source-toggle" href="#"
					  onclick="toggleCode('M000014-source');return false;">[Source]</a></p>
					<div class="method-source-code" id="M000014-source">
<pre>
     <span class="ruby-comment cmt"># File P4Triggers.rb, line 140</span>
140:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run_submit</span>
141:         <span class="ruby-identifier">raise</span>( <span class="ruby-value str">&quot;Attempt to submit during trigger execution. Don't do it.&quot;</span> )
142:     <span class="ruby-keyword kw">end</span>
</pre>
					</div>
				</div>
			</div>

			<div id="method-M000013" class="method-detail">
				<a name="M000013"></a>

				<div class="method-heading">
					<a href="#M000013" class="method-signature">
					<span class="method-name">submit_spec</span><span class="method-args">()</span>
					</a>
				</div>
			
				<div class="method-description">
					<p>
Disable the <a href="P4.html#M000013">submit_spec</a> interface
</p>
					<p><a class="source-toggle" href="#"
					  onclick="toggleCode('M000013-source');return false;">[Source]</a></p>
					<div class="method-source-code" id="M000013-source">
<pre>
     <span class="ruby-comment cmt"># File P4Triggers.rb, line 135</span>
135:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">submit_spec</span>
136:         <span class="ruby-identifier">raise</span>( <span class="ruby-value str">&quot;Attempt to submit during trigger execution. Don't do it.&quot;</span> )
137:     <span class="ruby-keyword kw">end</span>
</pre>
					</div>
				</div>
			</div>


		</div>


	</div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>
# Change User Description Committed
#3 4654 Tony Smith Add an example spec trigger to show how you might restrict the
default view for all new clients to a pre-defined set of
mappings.
#2 4640 Tony Smith Add a sample post-commit trigger that can be used to keep a master
and slave branch in sync.
#1 3637 Tony Smith Add RDoc documentation to the sample triggers.