<!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>new (P4Change)</title>
<link rel=StyleSheet href="../.././rdoc-style.css" type="text/css" media="screen" />
</head>
<body bgcolor="white">
<pre><span class="cmt"># File P4Triggers.rb, line 22</span>
<span class="kw">def</span> initialize( hash )
@change = hash[ <span class="str">"change"</span> ]
@user = hash[ <span class="str">"user"</span> ]
@client = hash[ <span class="str">"client"</span> ]
@desc = hash[ <span class="str">"desc"</span> ]
@time = Time.at( hash[ <span class="str">"time"</span> ].to_i )
@status = hash[ <span class="str">"status"</span> ]
@files = Array.new
@jobs = Hash.new
<span class="kw">if</span> ( hash.has_key?( <span class="str">"depotFile"</span> ) )
hash[ <span class="str">"depotFile"</span> ].each_index <span class="kw">do</span>
|i|
name = hash[ <span class="str">"depotFile"</span> ][ i ]
type = hash[ <span class="str">"type"</span> ][ i ]
rev = hash[ <span class="str">"rev"</span> ][ i ]
act = hash[ <span class="str">"action"</span> ][ i ]
df = P4DepotFile.new( name )
dr = df.new_revision
dr.type = type
dr.revno = rev.to_i
dr.action = act
@files.push( df )
<span class="kw">end</span>
<span class="kw">end</span>
<span class="kw">if</span> ( hash.has_key?( <span class="str">"job"</span> ) )
hash[ <span class="str">"job"</span> ].each_index <span class="kw">do</span>
|i|
job = hash[ <span class="str">"job"</span> ][ i ]
status = hash[ <span class="str">"jobstat"</span> ][ i ]
@jobs[ job ] = status
<span class="kw">end</span>
<span class="kw">end</span>
<span class="kw">end</span></pre>
</body>
</html>
# |
Change |
User |
Description |
Committed |
|
#1
|
3637 |
Tony Smith |
Add RDoc documentation to the sample triggers. |
|
|