<?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">
<head>
<title>Class: P4</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> P4
</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/P4Triggers_rb.html" class="aqua">
P4Triggers.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>
Reopen the <a href="P4.html">P4</a> class to restructuring the output of
"p4 describe -s" into a <a href="P4Change.html">P4Change</a>
object, and to disable any attempt to submit - just in case someone’s
foolish enough to try
</p>
</div>
<table summary="Methods" cellpadding="5" width="100%">
<tr><td class="tablesubtitle">Methods</td></tr>
</table>
<div class="name-list">
<a href="#M000006">run_describe</a>
<a href="#M000008">run_submit</a>
<a href="#M000007">submit_spec</a>
</div>
<table summary="Method list" cellpadding="5" width="100%">
<tr><td class="tablesubtitle">Public Instance methods</td></tr>
</table>
<table summary="method" width="100%" cellspacing="0" cellpadding="5" border="0">
<tr><td class="methodtitle">
<a name="M000006"></a>
<b>run_describe</b>( *args )
</td></tr>
</table>
<pre class="source">
<span class="cmt"># File P4Triggers.rb, line 128</span>
<span class="kw">def</span> run_describe( *args )
h = run( <span class="str">"describe"</span>, args ).shift
<span class="kw">return</span> h <span class="kw">unless</span> h.kind_of?( Hash )
<span class="kw">return</span> P4Change.new( h )
<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>submit_spec</b>()
</td></tr>
</table>
<div class="description">
<p>
Disable the <a href="P4.html#M000007">submit_spec</a> interface
</p>
</div>
<pre class="source">
<span class="cmt"># File P4Triggers.rb, line 135</span>
<span class="kw">def</span> submit_spec
raise( <span class="str">"Attempt to submit during trigger execution. Don't do it."</span> )
<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>run_submit</b>()
</td></tr>
</table>
<div class="description">
<p>
Disable the direct interface to submit
</p>
</div>
<pre class="source">
<span class="cmt"># File P4Triggers.rb, line 140</span>
<span class="kw">def</span> run_submit
raise( <span class="str">"Attempt to submit during trigger execution. Don't do it."</span> )
<span class="kw">end</span>
</pre>
</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. |