<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>validate (TypeTrigger)</title>
<link rel=StyleSheet href="../.././rdoc-style.css" type="text/css" media="screen" />
</head>
<body bgcolor="white">
<pre><span class="cmt"># File checktype.rb, line 95</span>
<span class="kw">def</span> validate()
<span class="cmt"># First gather the list of bad files</span>
badlist = Array.new
change.each_file <span class="kw">do</span>
|file|
<span class="cmt"># Ignore files not open for add</span>
<span class="kw">next</span> <span class="kw">unless</span> ( file.revisions[ 0 ].action == <span class="str">"add"</span> )
type = filetype( file.depot_file )
<span class="kw">next</span> <span class="kw">unless</span> type
basetype = file.revisions[ 0 ].type.sub( <span class="re">/\+.*/</span>, <span class="str">""</span> )
<span class="kw">if</span> ( ! type.match( basetype ) )
badlist.push( file )
<span class="kw">end</span>
<span class="kw">end</span>
<span class="cmt"># Now report any problems to the user</span>
report( badlist ) <span class="kw">if</span> ( ! badlist.empty? )
<span class="kw">return</span> badlist.empty?
<span class="kw">end</span></pre>
</body>
</html>
# |
Change |
User |
Description |
Committed |
|
#1
|
3637 |
Tony Smith |
Add RDoc documentation to the sample triggers. |
|
|