<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title> Module: HelixVersioningEngine::Util — Documentation by YARD 0.8.7.6 </title> <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" /> <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" /> <script type="text/javascript" charset="utf-8"> hasFrames = window.top.frames.main ? true : false; relpath = '../'; framesUrl = "../frames.html#!HelixVersioningEngine/Util.html"; </script> <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script> <script type="text/javascript" charset="utf-8" src="../js/app.js"></script> </head> <body> <div id="header"> <div id="menu"> <a href="../_index.html">Index (U)</a> » <span class='title'><span class='object_link'><a href="../HelixVersioningEngine.html" title="HelixVersioningEngine (module)">HelixVersioningEngine</a></span></span> » <span class="title">Util</span> <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div> </div> <div id="search"> <a class="full_list_link" id="class_list_link" href="../class_list.html"> Class List </a> <a class="full_list_link" id="method_list_link" href="../method_list.html"> Method List </a> <a class="full_list_link" id="file_list_link" href="../file_list.html"> File List </a> </div> <div class="clear"></div> </div> <iframe id="search_frame"></iframe> <div id="content"><h1>Module: HelixVersioningEngine::Util </h1> <dl class="box"> <dt class="r1 last">Defined in:</dt> <dd class="r1 last">lib/helix_versioning_engine/util.rb</dd> </dl> <div class="clear"></div> <h2>Overview</h2><div class="docstring"> <div class="discussion"> <p>TODO most of the methods in this module should probably be removed</p> <p>Namespace for p4ruby conventions used in the P4 Web API.</p> </div> </div> <div class="tags"> </div> <h2>Constant Summary</h2> <dl class="constants"> <dt id="PROPERTIES-constant" class="">PROPERTIES = </dt> <dd><pre class="code"><span class='lbracket'>[</span> <span class='symbol'>:password</span><span class='comma'>,</span> <span class='symbol'>:port</span><span class='comma'>,</span> <span class='symbol'>:user</span><span class='comma'>,</span> <span class='symbol'>:api_level</span><span class='comma'>,</span> <span class='symbol'>:charset</span><span class='comma'>,</span> <span class='symbol'>:client</span><span class='comma'>,</span> <span class='symbol'>:host</span><span class='comma'>,</span> <span class='symbol'>:handler</span><span class='comma'>,</span> <span class='symbol'>:maxlocktime</span><span class='comma'>,</span> <span class='symbol'>:maxresults</span><span class='comma'>,</span> <span class='symbol'>:maxscanrows</span><span class='comma'>,</span> <span class='symbol'>:prog</span><span class='comma'>,</span> <span class='symbol'>:ticketfile</span> <span class='rbracket'>]</span></pre></dd> <dt id="BRANCHES_MAP-constant" class="">BRANCHES_MAP = <div class="docstring"> <div class="discussion"> <p>Data 'normalization'</p> <p>A very annoying aspect of our tagged output is that it often is <em>slightly</em> different between 'plural' and spec forms. This logic is made available as an option in this API</p> </div> </div> <div class="tags"> </div> </dt> <dd><pre class="code"><span class='lbrace'>{</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>branch</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Branch</span><span class='tstring_end'>'</span></span> <span class='rbrace'>}</span></pre></dd> <dt id="BRANCHES_DATES-constant" class="">BRANCHES_DATES = </dt> <dd><pre class="code"><span class='qwords_beg'>%w(</span><span class='tstring_content'>Update</span><span class='words_sep'> </span><span class='tstring_content'>Access</span><span class='words_sep'>)</span></pre></dd> <dt id="CHANGES_MAP-constant" class="">CHANGES_MAP = </dt> <dd><pre class="code"><span class='lbrace'>{</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>path</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Path</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>change</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Change</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>time</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Date</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>client</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Client</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>user</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>User</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>status</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Status</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>type</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Type</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>changeType</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Type</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>desc</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Description</span><span class='tstring_end'>'</span></span> <span class='rbrace'>}</span></pre></dd> <dt id="CHANGES_DATES-constant" class="">CHANGES_DATES = </dt> <dd><pre class="code"><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Date</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span></pre></dd> <dt id="CLIENTS_MAP-constant" class="">CLIENTS_MAP = </dt> <dd><pre class="code"><span class='lbrace'>{</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>client</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Client</span><span class='tstring_end'>'</span></span> <span class='rbrace'>}</span></pre></dd> <dt id="CLIENTS_DATES-constant" class="">CLIENTS_DATES = </dt> <dd><pre class="code"><span class='qwords_beg'>%w(</span><span class='tstring_content'>Update</span><span class='words_sep'> </span><span class='tstring_content'>Access</span><span class='words_sep'>)</span></pre></dd> <dt id="DEPOTS_MAP-constant" class="">DEPOTS_MAP = </dt> <dd><pre class="code"><span class='lbrace'>{</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>name</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Depot</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>time</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Date</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>type</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Type</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>map</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Map</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>desc</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Description</span><span class='tstring_end'>'</span></span> <span class='rbrace'>}</span></pre></dd> <dt id="DEPOTS_DATES-constant" class="">DEPOTS_DATES = </dt> <dd><pre class="code"><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Date</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span></pre></dd> <dt id="DESCRIBE_MAP-constant" class="">DESCRIBE_MAP = <div class="docstring"> <div class="discussion"> <p>Note that individual files are handled differently, since the keys are prefixed</p> </div> </div> <div class="tags"> </div> </dt> <dd><pre class="code"><span class='const'>CHANGES_MAP</span></pre></dd> <dt id="DESCRIBE_DATES-constant" class="">DESCRIBE_DATES = </dt> <dd><pre class="code"><span class='const'>CHANGES_DATES</span></pre></dd> <dt id="DIRS_MAP-constant" class="">DIRS_MAP = </dt> <dd><pre class="code"><span class='lbrace'>{</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dir</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Dir</span><span class='tstring_end'>'</span></span> <span class='rbrace'>}</span></pre></dd> <dt id="FILES_MAP-constant" class="">FILES_MAP = </dt> <dd><pre class="code"><span class='lbrace'>{</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>depotFile</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>DepotFile</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>rev</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Revision</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>change</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Change</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>action</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Action</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>type</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Type</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>time</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Date</span><span class='tstring_end'>'</span></span> <span class='rbrace'>}</span></pre></dd> <dt id="FILES_DATES-constant" class="">FILES_DATES = </dt> <dd><pre class="code"><span class='qwords_beg'>%w(</span><span class='tstring_content'>Date</span><span class='words_sep'>)</span></pre></dd> <dt id="GROUPS_MAP-constant" class="">GROUPS_MAP = </dt> <dd><pre class="code"><span class='lbrace'>{</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>group</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Group</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>maxResults</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>MaxResults</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>maxScanRows</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>MaxScanRows</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>maxLockTime</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>MaxLockTime</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>timeout</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Timeout</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>desc</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Description</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>user</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>User</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>isSubGroup</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>IsSubGroup</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>isOwner</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>IsOwner</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>isUser</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>IsUser</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>passTimeout</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>PasswordTimeout</span><span class='tstring_end'>'</span></span> <span class='rbrace'>}</span></pre></dd> <dt id="JOBS_MAP-constant" class="">JOBS_MAP = </dt> <dd><pre class="code"><span class='lbrace'>{</span><span class='rbrace'>}</span></pre></dd> <dt id="JOBS_DATES-constant" class="">JOBS_DATES = </dt> <dd><pre class="code"><span class='qwords_beg'>%w(</span><span class='tstring_content'>Date</span><span class='words_sep'>)</span></pre></dd> <dt id="LABELS_MAP-constant" class="">LABELS_MAP = </dt> <dd><pre class="code"><span class='lbrace'>{</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>label</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Label</span><span class='tstring_end'>'</span></span> <span class='rbrace'>}</span></pre></dd> <dt id="LABELS_DATES-constant" class="">LABELS_DATES = </dt> <dd><pre class="code"><span class='qwords_beg'>%w(</span><span class='tstring_content'>Update</span><span class='words_sep'> </span><span class='tstring_content'>Access</span><span class='words_sep'>)</span></pre></dd> <dt id="STREAMS_MAP-constant" class="">STREAMS_MAP = <div class="docstring"> <div class="discussion"> <p>This isn't supported but kept here for reference. We <em>might</em> support this. OPENED_MAP = { 'change' => 'Change', 'client' => 'Client', 'user' => 'User' }</p> </div> </div> <div class="tags"> </div> </dt> <dd><pre class="code"><span class='lbrace'>{</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>desc</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Description</span><span class='tstring_end'>'</span></span> <span class='rbrace'>}</span></pre></dd> <dt id="STREAMS_DATES-constant" class="">STREAMS_DATES = </dt> <dd><pre class="code"><span class='qwords_beg'>%w(</span><span class='tstring_content'>Update</span><span class='words_sep'> </span><span class='tstring_content'>Access</span><span class='words_sep'>)</span></pre></dd> <dt id="USERS_MAP-constant" class="">USERS_MAP = </dt> <dd><pre class="code"><span class='lbrace'>{</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>passwordChange</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>PasswordChange</span><span class='tstring_end'>'</span></span> <span class='rbrace'>}</span></pre></dd> <dt id="USERS_DATES-constant" class="">USERS_DATES = </dt> <dd><pre class="code"><span class='qwords_beg'>%w(</span><span class='tstring_content'>Update</span><span class='words_sep'> </span><span class='tstring_content'>Access</span><span class='words_sep'> </span><span class='tstring_content'>PasswordChange</span><span class='words_sep'>)</span></pre></dd> <dt id="GROUP_PROPERTIES-constant" class="">GROUP_PROPERTIES = <div class="docstring"> <div class="discussion"> <p>These are 'single values' of properties of Group objects we use while collating them.</p> </div> </div> <div class="tags"> </div> </dt> <dd><pre class="code"><span class='qwords_beg'>%w( </span><span class='tstring_content'>Group</span><span class='words_sep'> </span><span class='tstring_content'>MaxResults</span><span class='words_sep'> </span><span class='tstring_content'>MaxScanRows</span><span class='words_sep'> </span><span class='tstring_content'>MaxLockTime</span><span class='words_sep'> </span><span class='tstring_content'>Timeout</span><span class='words_sep'> </span><span class='tstring_end'>PasswordTimeout</span></span></pre></dd> <dt id="FILE_KEYS-constant" class="">FILE_KEYS = </dt> <dd><pre class="code"><span class='qwords_beg'>%w(</span><span class='tstring_content'>depotFile</span><span class='words_sep'> </span><span class='tstring_content'>action</span><span class='words_sep'> </span><span class='tstring_content'>type</span><span class='words_sep'> </span><span class='tstring_content'>rev</span><span class='words_sep'> </span><span class='tstring_content'>digest</span><span class='words_sep'> </span><span class='tstring_content'>fileSize</span><span class='words_sep'>)</span></pre></dd> </dl> <h2> Class Method Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small> </h2> <ul class="summary"> <li class="public "> <span class="summary_signature"> <a href="#assert_no_special_paths-class_method" title="assert_no_special_paths (class method)">+ (Object) <strong>assert_no_special_paths</strong>(paths) </a> </span> <span class="summary_desc"><div class='inline'> <p>Assert that no relative directory or Perforce wildcard is in use for each string in the <code>paths</code> array.</p> </div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#collate_group_results-class_method" title="collate_group_results (class method)">+ (Object) <strong>collate_group_results</strong>(results) </a> </span> <span class="summary_desc"><div class='inline'> <p>Will apply the normalizer to set up a consistent field naming and date format, but then 'collates' the output into a single list of 'groups'.</p> </div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#date_str%3F-class_method" title="date_str? (class method)">+ (Boolean) <strong>date_str?</strong>(str) </a> </span> <span class="summary_desc"><div class='inline'> <p>Returns true if we can parse the string as a date.</p> </div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#error%3F-class_method" title="error? (class method)">+ (Boolean) <strong>error?</strong>(p4) </a> </span> <span class="summary_desc"><div class='inline'> <p>Check for P4 errors.</p> </div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#existing_path%3F-class_method" title="existing_path? (class method)">+ (Boolean) <strong>existing_path?</strong>(existing_results, depot_path) </a> </span> <span class="summary_desc"><div class='inline'></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#i%3F-class_method" title="i? (class method)">+ (Boolean) <strong>i?</strong>(str) </a> </span> <span class="summary_desc"><div class='inline'> <p>Returns true if .to_i will actually convert this string to an integer.</p> </div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#init_changelist-class_method" title="init_changelist (class method)">+ (Object) <strong>init_changelist</strong>(p4, description) </a> </span> <span class="summary_desc"><div class='inline'></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#local_path-class_method" title="local_path (class method)">+ (Object) <strong>local_path</strong>(depot_path, root) </a> </span> <span class="summary_desc"><div class='inline'></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#make_normalizer-class_method" title="make_normalizer (class method)">+ (Object) <strong>make_normalizer</strong>(field_map, offset, date_fields = nil) </a> </span> <span class="summary_desc"><div class='inline'></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#map_describe_file_key-class_method" title="map_describe_file_key (class method)">+ (Object) <strong>map_describe_file_key</strong>(key) </a> </span> <span class="summary_desc"><div class='inline'></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#mark_change-class_method" title="mark_change (class method)">+ (Object) <strong>mark_change</strong>(type, p4, change_id, root, depot_path) </a> </span> <span class="summary_desc"><div class='inline'></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#normalize_describe_files-class_method" title="normalize_describe_files (class method)">+ (Object) <strong>normalize_describe_files</strong>(results) </a> </span> <span class="summary_desc"><div class='inline'> <p>Each file entry in the base describe tagged output contains several fields, suffixed with an index value.</p> </div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#normalizer-class_method" title="normalizer (class method)">+ (Object) <strong>normalizer</strong>(spec_type, offset) </a> </span> <span class="summary_desc"><div class='inline'> <p>For each 'spec type' returns a function that will ensure that: - case is consistent between different return calls, prefer 'spec' types - dates are returned.</p> </div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#open-class_method" title="open (class method)">+ (Object) <strong>open</strong>(options = {}) </a> </span> <span class="summary_desc"><div class='inline'> <p>Creates your p4 connection using some common forms.</p> </div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#p4_date_offset-class_method" title="p4_date_offset (class method)">+ (Object) <strong>p4_date_offset</strong>(str) </a> </span> <span class="summary_desc"><div class='inline'></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#p4_date_to_i-class_method" title="p4_date_to_i (class method)">+ (Object) <strong>p4_date_to_i</strong>(offset, p4date) </a> </span> <span class="summary_desc"><div class='inline'> <p>In general we get dates without any offset information, which has to be retrieved via the serverDate field from 'p4 info'.</p> </div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#p4_ticket%3F-class_method" title="p4_ticket? (class method)">+ (Boolean) <strong>p4_ticket?</strong>(str) </a> </span> <span class="summary_desc"><div class='inline'> <p>Returns true if the string looks like a Perforce authentication ticket.</p> </div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#raise_error-class_method" title="raise_error (class method)">+ (Object) <strong>raise_error</strong>(p4) </a> </span> <span class="summary_desc"><div class='inline'> <p>Raise an exception if necessary on a P4 Error.</p> </div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#relative_dir%3F-class_method" title="relative_dir? (class method)">+ (Boolean) <strong>relative_dir?</strong>(str) </a> </span> <span class="summary_desc"><div class='inline'> <p>Returns true if str is '.' or '..'.</p> </div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#replace_unset_with_0-class_method" title="replace_unset_with_0 (class method)">+ (Object) <strong>replace_unset_with_0</strong>(results) </a> </span> <span class="summary_desc"><div class='inline'></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#resolve_charset-class_method" title="resolve_charset (class method)">+ (Object) <strong>resolve_charset</strong>(env, settings) </a> </span> <span class="summary_desc"><div class='inline'></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#resolve_host-class_method" title="resolve_host (class method)">+ (Object) <strong>resolve_host</strong>(env, settings) </a> </span> <span class="summary_desc"><div class='inline'></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#resolve_password-class_method" title="resolve_password (class method)">+ (Object) <strong>resolve_password</strong>(env, settings) </a> </span> <span class="summary_desc"><div class='inline'></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#resolve_port-class_method" title="resolve_port (class method)">+ (Object) <strong>resolve_port</strong>(env, settings) </a> </span> <span class="summary_desc"><div class='inline'></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#save_content-class_method" title="save_content (class method)">+ (Object) <strong>save_content</strong>(root, depot_path, content) </a> </span> <span class="summary_desc"><div class='inline'></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#singular-class_method" title="singular (class method)">+ (Object) <strong>singular</strong>(plural) </a> </span> <span class="summary_desc"><div class='inline'></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#uuid%3F-class_method" title="uuid? (class method)">+ (Boolean) <strong>uuid?</strong>(str) </a> </span> <span class="summary_desc"><div class='inline'> <p>We only count uuids that were returned via SecureRandom.uuid used to generate internal security tokens.</p> </div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#wildcard%3F-class_method" title="wildcard? (class method)">+ (Boolean) <strong>wildcard?</strong>(str) </a> </span> <span class="summary_desc"><div class='inline'> <p>Returns true when <code>str</code> contains a Perforce wildcard.</p> </div></span> </li> </ul> <div id="class_method_details" class="method_details_list"> <h2>Class Method Details</h2> <div class="method_details first"> <h3 class="signature first" id="assert_no_special_paths-class_method"> + (<tt>Object</tt>) <strong>assert_no_special_paths</strong>(paths) </h3><div class="docstring"> <div class="discussion"> <p>Assert that no relative directory or Perforce wildcard is in use for each string in the <code>paths</code> array.</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 67 68 69 70 71 72 73 74 75 76 77 78</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/util.rb', line 67</span> <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_assert_no_special_paths'>assert_no_special_paths</span><span class='lparen'>(</span><span class='id identifier rubyid_paths'>paths</span><span class='rparen'>)</span> <span class='id identifier rubyid_paths'>paths</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_path'>path</span><span class='op'>|</span> <span class='kw'>if</span> <span class='const'>Util</span><span class='period'>.</span><span class='id identifier rubyid_wildcard?'>wildcard?</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span> <span class='id identifier rubyid_fail'>fail</span> <span class='const'>P4Error</span><span class='period'>.</span><span class='id identifier rubyid_default_error'>default_error</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>The path '</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_path'>path</span><span class='embexpr_end'>}</span><span class='tstring_content'>' contains a Perforce </span><span class='tstring_end'>"</span></span>\ <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>wildcard, which is not allowed</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='kw'>end</span> <span class='kw'>if</span> <span class='const'>Util</span><span class='period'>.</span><span class='id identifier rubyid_relative_dir?'>relative_dir?</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span> <span class='id identifier rubyid_fail'>fail</span> <span class='const'>P4Error</span><span class='period'>.</span><span class='id identifier rubyid_default_error'>default_error</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>The path '</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_path'>path</span><span class='embexpr_end'>}</span><span class='tstring_content'>' is a relative </span><span class='tstring_end'>"</span></span> \ <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>directory, which is not allowed</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='kw'>end</span> <span class='kw'>end</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="collate_group_results-class_method"> + (<tt>Object</tt>) <strong>collate_group_results</strong>(results) </h3><div class="docstring"> <div class="discussion"> <p>Will apply the normalizer to set up a consistent field naming and date format, but then 'collates' the output into a single list of 'groups'.</p> <p>The groups output is kind of funny, because it basically lists users, with group access fields. It's very non-obvious, and in the end, most clients will need to run logic like this anyway.</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/util.rb', line 334</span> <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_collate_group_results'>collate_group_results</span><span class='lparen'>(</span><span class='id identifier rubyid_results'>results</span><span class='rparen'>)</span> <span class='id identifier rubyid_collated'>collated</span> <span class='op'>=</span> <span class='id identifier rubyid_results'>results</span><span class='period'>.</span><span class='id identifier rubyid_group_by'>group_by</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_x'>x</span><span class='op'>|</span> <span class='id identifier rubyid_x'>x</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Group</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='rbrace'>}</span> <span class='id identifier rubyid_updated'>updated</span> <span class='op'>=</span> <span class='id identifier rubyid_collated'>collated</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid__key'>_key</span><span class='comma'>,</span> <span class='id identifier rubyid_items'>items</span><span class='op'>|</span> <span class='comment'># The first item sets most of the values, we then figure out array </span> <span class='comment'># subvalues </span> <span class='id identifier rubyid_group'>group</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span> <span class='const'>GROUP_PROPERTIES</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_p'>p</span><span class='op'>|</span> <span class='id identifier rubyid_group'>group</span><span class='lbracket'>[</span><span class='id identifier rubyid_p'>p</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_items'>items</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='lbracket'>[</span><span class='id identifier rubyid_p'>p</span><span class='rbracket'>]</span> <span class='kw'>if</span> <span class='id identifier rubyid_items'>items</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span><span class='lparen'>(</span><span class='id identifier rubyid_p'>p</span><span class='rparen'>)</span> <span class='kw'>end</span> <span class='id identifier rubyid_group'>group</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Users</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_items'>items</span><span class='period'>.</span><span class='id identifier rubyid_find_all'>find_all</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_x'>x</span><span class='op'>|</span> <span class='id identifier rubyid_x'>x</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>IsUser</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>1</span><span class='tstring_end'>'</span></span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_x'>x</span><span class='op'>|</span> <span class='id identifier rubyid_x'>x</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>User</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='rbrace'>}</span> <span class='id identifier rubyid_group'>group</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Subgroups</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_items'>items</span><span class='period'>.</span><span class='id identifier rubyid_find_all'>find_all</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_x'>x</span><span class='op'>|</span> <span class='id identifier rubyid_x'>x</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>IsSubGroup</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>1</span><span class='tstring_end'>'</span></span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_x'>x</span><span class='op'>|</span> <span class='id identifier rubyid_x'>x</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>User</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='rbrace'>}</span> <span class='id identifier rubyid_group'>group</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Owners</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_items'>items</span><span class='period'>.</span><span class='id identifier rubyid_find_all'>find_all</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_x'>x</span><span class='op'>|</span> <span class='id identifier rubyid_x'>x</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>IsOwner</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>1</span><span class='tstring_end'>'</span></span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_x'>x</span><span class='op'>|</span> <span class='id identifier rubyid_x'>x</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>User</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='rbrace'>}</span> <span class='id identifier rubyid_group'>group</span> <span class='kw'>end</span> <span class='id identifier rubyid_results'>results</span><span class='period'>.</span><span class='id identifier rubyid_replace'>replace</span><span class='lparen'>(</span><span class='id identifier rubyid_updated'>updated</span><span class='rparen'>)</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="date_str?-class_method"> + (<tt>Boolean</tt>) <strong>date_str?</strong>(str) </h3><div class="docstring"> <div class="discussion"> <p>Returns true if we can parse the string as a date</p> </div> </div> <div class="tags"> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt>Boolean</tt>)</span> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 418 419 420</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/util.rb', line 418</span> <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_date_str?'>date_str?</span><span class='lparen'>(</span><span class='id identifier rubyid_str'>str</span><span class='rparen'>)</span> <span class='const'>Date</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_str'>str</span><span class='rparen'>)</span> <span class='kw'>rescue</span> <span class='kw'>false</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="error?-class_method"> + (<tt>Boolean</tt>) <strong>error?</strong>(p4) </h3><div class="docstring"> <div class="discussion"> <p>Check for P4 errors</p> </div> </div> <div class="tags"> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt>Boolean</tt>)</span> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 55 56 57</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/util.rb', line 55</span> <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_error?'>error?</span><span class='lparen'>(</span><span class='id identifier rubyid_p4'>p4</span><span class='rparen'>)</span> <span class='op'>!</span><span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="existing_path?-class_method"> + (<tt>Boolean</tt>) <strong>existing_path?</strong>(existing_results, depot_path) </h3><div class="docstring"> <div class="discussion"> </div> </div> <div class="tags"> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt>Boolean</tt>)</span> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 117 118 119 120 121</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/util.rb', line 117</span> <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_existing_path?'>existing_path?</span><span class='lparen'>(</span><span class='id identifier rubyid_existing_results'>existing_results</span><span class='comma'>,</span> <span class='id identifier rubyid_depot_path'>depot_path</span><span class='rparen'>)</span> <span class='id identifier rubyid_existing_results'>existing_results</span><span class='period'>.</span><span class='id identifier rubyid_any?'>any?</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_result'>result</span><span class='op'>|</span> <span class='id identifier rubyid_result'>result</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>depotFile</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='id identifier rubyid_depot_path'>depot_path</span> <span class='kw'>end</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="i?-class_method"> + (<tt>Boolean</tt>) <strong>i?</strong>(str) </h3><div class="docstring"> <div class="discussion"> <p>Returns true if .to_i will actually convert this string to an integer</p> </div> </div> <div class="tags"> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt>Boolean</tt>)</span> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 413 414 415</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/util.rb', line 413</span> <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_i?'>i?</span><span class='lparen'>(</span><span class='id identifier rubyid_str'>str</span><span class='rparen'>)</span> <span class='lparen'>(</span><span class='id identifier rubyid_str'>str</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\A[-+]?\d+\z</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="init_changelist-class_method"> + (<tt>Object</tt>) <strong>init_changelist</strong>(p4, description) </h3><table class="source_code"> <tr> <td> <pre class="lines"> 102 103 104 105 106 107</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/util.rb', line 102</span> <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_init_changelist'>init_changelist</span><span class='lparen'>(</span><span class='id identifier rubyid_p4'>p4</span><span class='comma'>,</span> <span class='id identifier rubyid_description'>description</span><span class='rparen'>)</span> <span class='id identifier rubyid_change_spec'>change_spec</span> <span class='op'>=</span> <span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_fetch_change'>fetch_change</span> <span class='id identifier rubyid_change_spec'>change_spec</span><span class='period'>.</span><span class='id identifier rubyid__description'>_description</span> <span class='op'>=</span> <span class='id identifier rubyid_description'>description</span> <span class='id identifier rubyid_results'>results</span> <span class='op'>=</span> <span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_save_change'>save_change</span><span class='lparen'>(</span><span class='id identifier rubyid_change_spec'>change_spec</span><span class='rparen'>)</span> <span class='id identifier rubyid_results'>results</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^Change (\d+) created.</span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>\1</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="local_path-class_method"> + (<tt>Object</tt>) <strong>local_path</strong>(depot_path, root) </h3><table class="source_code"> <tr> <td> <pre class="lines"> 128 129 130 131</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/util.rb', line 128</span> <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_local_path'>local_path</span><span class='lparen'>(</span><span class='id identifier rubyid_depot_path'>depot_path</span><span class='comma'>,</span> <span class='id identifier rubyid_root'>root</span><span class='rparen'>)</span> <span class='id identifier rubyid_stripped'>stripped</span> <span class='op'>=</span> <span class='id identifier rubyid_depot_path'>depot_path</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^\/+</span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='id identifier rubyid_root'>root</span><span class='comma'>,</span> <span class='id identifier rubyid_stripped'>stripped</span><span class='rparen'>)</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="make_normalizer-class_method"> + (<tt>Object</tt>) <strong>make_normalizer</strong>(field_map, offset, date_fields = nil) </h3><table class="source_code"> <tr> <td> <pre class="lines"> 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/util.rb', line 298</span> <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_make_normalizer'>make_normalizer</span><span class='lparen'>(</span><span class='id identifier rubyid_field_map'>field_map</span><span class='comma'>,</span> <span class='id identifier rubyid_offset'>offset</span><span class='comma'>,</span> <span class='id identifier rubyid_date_fields'>date_fields</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span> <span class='id identifier rubyid_lambda'>lambda</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_results'>results</span><span class='op'>|</span> <span class='kw'>return</span> <span class='kw'>unless</span> <span class='id identifier rubyid_results'>results</span> <span class='comment'># We need to ignore any instances of P4::Spec since that will 'validate' </span> <span class='comment'># fields on it's accessor methods </span> <span class='id identifier rubyid_results'>results</span><span class='period'>.</span><span class='id identifier rubyid_map!'>map!</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_result'>result</span><span class='op'>|</span> <span class='kw'>if</span> <span class='id identifier rubyid_result'>result</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span> <span class='op'><=</span> <span class='const'>P4</span><span class='op'>::</span><span class='const'>Spec</span> <span class='id identifier rubyid_spec'>spec</span> <span class='op'>=</span> <span class='id identifier rubyid_result'>result</span> <span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <span class='const'>Hash</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='id identifier rubyid_result'>result</span><span class='period'>.</span><span class='id identifier rubyid_merge!'>merge!</span><span class='lparen'>(</span><span class='id identifier rubyid_spec'>spec</span><span class='rparen'>)</span> <span class='kw'>else</span> <span class='id identifier rubyid_result'>result</span> <span class='kw'>end</span> <span class='kw'>end</span> <span class='id identifier rubyid_results'>results</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_result'>result</span><span class='op'>|</span> <span class='id identifier rubyid_update_fields'>update_fields</span><span class='lparen'>(</span><span class='id identifier rubyid_field_map'>field_map</span><span class='comma'>,</span> <span class='id identifier rubyid_result'>result</span><span class='rparen'>)</span> <span class='id identifier rubyid_update_dates'>update_dates</span><span class='lparen'>(</span><span class='id identifier rubyid_date_fields'>date_fields</span><span class='comma'>,</span> <span class='id identifier rubyid_result'>result</span><span class='comma'>,</span> <span class='id identifier rubyid_offset'>offset</span><span class='rparen'>)</span> <span class='kw'>end</span> <span class='id identifier rubyid_results'>results</span> <span class='kw'>end</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="map_describe_file_key-class_method"> + (<tt>Object</tt>) <strong>map_describe_file_key</strong>(key) </h3><table class="source_code"> <tr> <td> <pre class="lines"> 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/util.rb', line 395</span> <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_map_describe_file_key'>map_describe_file_key</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span> <span class='kw'>case</span> <span class='id identifier rubyid_key'>key</span> <span class='kw'>when</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^depotFile$</span><span class='regexp_end'>/</span></span> <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>DepotFile</span><span class='tstring_end'>'</span></span> <span class='kw'>when</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^action$</span><span class='regexp_end'>/</span></span> <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Action</span><span class='tstring_end'>'</span></span> <span class='kw'>when</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^type$</span><span class='regexp_end'>/</span></span> <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Type</span><span class='tstring_end'>'</span></span> <span class='kw'>when</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^rev$</span><span class='regexp_end'>/</span></span> <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Revision</span><span class='tstring_end'>'</span></span> <span class='kw'>when</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^fileSize$</span><span class='regexp_end'>/</span></span> <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>FileSize</span><span class='tstring_end'>'</span></span> <span class='kw'>when</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^digest$</span><span class='regexp_end'>/</span></span> <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Digest</span><span class='tstring_end'>'</span></span> <span class='kw'>end</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="mark_change-class_method"> + (<tt>Object</tt>) <strong>mark_change</strong>(type, p4, change_id, root, depot_path) </h3><table class="source_code"> <tr> <td> <pre class="lines"> 123 124 125 126</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/util.rb', line 123</span> <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_mark_change'>mark_change</span><span class='lparen'>(</span><span class='id identifier rubyid_type'>type</span><span class='comma'>,</span> <span class='id identifier rubyid_p4'>p4</span><span class='comma'>,</span> <span class='id identifier rubyid_change_id'>change_id</span><span class='comma'>,</span> <span class='id identifier rubyid_root'>root</span><span class='comma'>,</span> <span class='id identifier rubyid_depot_path'>depot_path</span><span class='rparen'>)</span> <span class='id identifier rubyid_local_file'>local_file</span> <span class='op'>=</span> <span class='id identifier rubyid_local_path'>local_path</span><span class='lparen'>(</span><span class='id identifier rubyid_depot_path'>depot_path</span><span class='comma'>,</span> <span class='id identifier rubyid_root'>root</span><span class='rparen'>)</span> <span class='id identifier rubyid_results'>results</span> <span class='op'>=</span> <span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_run'>run</span><span class='lparen'>(</span><span class='id identifier rubyid_type'>type</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-c</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_change_id'>change_id</span><span class='comma'>,</span> <span class='id identifier rubyid_local_file'>local_file</span><span class='rparen'>)</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="normalize_describe_files-class_method"> + (<tt>Object</tt>) <strong>normalize_describe_files</strong>(results) </h3><div class="docstring"> <div class="discussion"> <p>Each file entry in the base describe tagged output contains several fields, suffixed with an index value.</p> <p>P4 Ruby returns the individual 'index fields' already collated by the key type.</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/util.rb', line 373</span> <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_normalize_describe_files'>normalize_describe_files</span><span class='lparen'>(</span><span class='id identifier rubyid_results'>results</span><span class='rparen'>)</span> <span class='id identifier rubyid_results'>results</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_r'>r</span><span class='op'>|</span> <span class='comment'># We have to collect each index we discover as we iterate over the keys </span> <span class='id identifier rubyid_idx_2_file'>idx_2_file</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span> <span class='const'>FILE_KEYS</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='op'>|</span> <span class='kw'>if</span> <span class='id identifier rubyid_r'>r</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span> <span class='id identifier rubyid_r'>r</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_each_index'>each_index</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_idx'>idx</span><span class='op'>|</span> <span class='id identifier rubyid_mapped_key'>mapped_key</span> <span class='op'>=</span> <span class='const'>Util</span><span class='period'>.</span><span class='id identifier rubyid_map_describe_file_key'>map_describe_file_key</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span> <span class='id identifier rubyid_idx_2_file'>idx_2_file</span><span class='lbracket'>[</span><span class='id identifier rubyid_idx'>idx</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span> <span class='kw'>unless</span> <span class='id identifier rubyid_idx_2_file'>idx_2_file</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span><span class='lparen'>(</span><span class='id identifier rubyid_idx'>idx</span><span class='rparen'>)</span> <span class='id identifier rubyid_idx_2_file'>idx_2_file</span><span class='lbracket'>[</span><span class='id identifier rubyid_idx'>idx</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_mapped_key'>mapped_key</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_r'>r</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_idx'>idx</span><span class='rbracket'>]</span> <span class='kw'>end</span> <span class='id identifier rubyid_r'>r</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span> <span class='kw'>end</span> <span class='kw'>end</span> <span class='id identifier rubyid_r'>r</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Files</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_idx_2_file'>idx_2_file</span><span class='period'>.</span><span class='id identifier rubyid_values'>values</span> <span class='kw'>end</span> <span class='id identifier rubyid_results'>results</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="normalizer-class_method"> + (<tt>Object</tt>) <strong>normalizer</strong>(spec_type, offset) </h3><div class="docstring"> <div class="discussion"> <p>For each 'spec type' returns a function that will ensure that: - case is consistent between different return calls, prefer 'spec' types - dates are returned</p> <p>Parameters: - spec_type is the 'plural' form of spec class, e.g., 'users', 'clients' - offset is the current server offset, retrieve this via 'p4 info' command</p> <p>rubocop:disable Metrics/CyclomaticComplexity</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/util.rb', line 255</span> <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_normalizer'>normalizer</span><span class='lparen'>(</span><span class='id identifier rubyid_spec_type'>spec_type</span><span class='comma'>,</span> <span class='id identifier rubyid_offset'>offset</span><span class='rparen'>)</span> <span class='kw'>case</span> <span class='id identifier rubyid_spec_type'>spec_type</span> <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>branches</span><span class='tstring_end'>'</span></span> <span class='id identifier rubyid_make_normalizer'>make_normalizer</span><span class='lparen'>(</span><span class='const'>BRANCHES_MAP</span><span class='comma'>,</span> <span class='id identifier rubyid_offset'>offset</span><span class='comma'>,</span> <span class='const'>BRANCHES_DATES</span><span class='rparen'>)</span> <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>changes</span><span class='tstring_end'>'</span></span> <span class='id identifier rubyid_make_normalizer'>make_normalizer</span><span class='lparen'>(</span><span class='const'>CHANGES_MAP</span><span class='comma'>,</span> <span class='id identifier rubyid_offset'>offset</span><span class='comma'>,</span> <span class='const'>CHANGES_DATES</span><span class='rparen'>)</span> <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>clients</span><span class='tstring_end'>'</span></span> <span class='id identifier rubyid_make_normalizer'>make_normalizer</span><span class='lparen'>(</span><span class='const'>CLIENTS_MAP</span><span class='comma'>,</span> <span class='id identifier rubyid_offset'>offset</span><span class='comma'>,</span> <span class='const'>CLIENTS_DATES</span><span class='rparen'>)</span> <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>depots</span><span class='tstring_end'>'</span></span> <span class='id identifier rubyid_make_normalizer'>make_normalizer</span><span class='lparen'>(</span><span class='const'>DEPOTS_MAP</span><span class='comma'>,</span> <span class='id identifier rubyid_offset'>offset</span><span class='comma'>,</span> <span class='const'>DEPOTS_DATES</span><span class='rparen'>)</span> <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>describe</span><span class='tstring_end'>'</span></span> <span class='comment'># This only affects 'base' fields, not fields related to each file </span> <span class='id identifier rubyid_base_normalize'>base_normalize</span> <span class='op'>=</span> <span class='id identifier rubyid_make_normalizer'>make_normalizer</span><span class='lparen'>(</span><span class='const'>DESCRIBE_MAP</span><span class='comma'>,</span> <span class='id identifier rubyid_offset'>offset</span><span class='comma'>,</span> <span class='const'>DESCRIBE_DATES</span><span class='rparen'>)</span> <span class='id identifier rubyid_lambda'>lambda</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_results'>results</span><span class='op'>|</span> <span class='id identifier rubyid_results'>results</span> <span class='op'>=</span> <span class='id identifier rubyid_base_normalize'>base_normalize</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_results'>results</span><span class='rparen'>)</span> <span class='const'>Util</span><span class='period'>.</span><span class='id identifier rubyid_normalize_describe_files'>normalize_describe_files</span><span class='lparen'>(</span><span class='id identifier rubyid_results'>results</span><span class='rparen'>)</span> <span class='id identifier rubyid_results'>results</span> <span class='kw'>end</span> <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dirs</span><span class='tstring_end'>'</span></span> <span class='id identifier rubyid_make_normalizer'>make_normalizer</span><span class='lparen'>(</span><span class='const'>DIRS_MAP</span><span class='comma'>,</span> <span class='id identifier rubyid_offset'>offset</span><span class='rparen'>)</span> <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>files</span><span class='tstring_end'>'</span></span> <span class='id identifier rubyid_make_normalizer'>make_normalizer</span><span class='lparen'>(</span><span class='const'>FILES_MAP</span><span class='comma'>,</span> <span class='id identifier rubyid_offset'>offset</span><span class='comma'>,</span> <span class='const'>FILES_DATES</span><span class='rparen'>)</span> <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>groups</span><span class='tstring_end'>'</span></span> <span class='id identifier rubyid_date_and_case'>date_and_case</span> <span class='op'>=</span> <span class='id identifier rubyid_make_normalizer'>make_normalizer</span><span class='lparen'>(</span><span class='const'>GROUPS_MAP</span><span class='comma'>,</span> <span class='id identifier rubyid_offset'>offset</span><span class='rparen'>)</span> <span class='id identifier rubyid_lambda'>lambda</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_results'>results</span><span class='op'>|</span> <span class='id identifier rubyid_results'>results</span> <span class='op'>=</span> <span class='id identifier rubyid_date_and_case'>date_and_case</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_results'>results</span><span class='rparen'>)</span> <span class='const'>Util</span><span class='period'>.</span><span class='id identifier rubyid_replace_unset_with_0'>replace_unset_with_0</span><span class='lparen'>(</span><span class='id identifier rubyid_results'>results</span><span class='rparen'>)</span> <span class='id identifier rubyid_results'>results</span> <span class='kw'>end</span> <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>jobs</span><span class='tstring_end'>'</span></span> <span class='id identifier rubyid_make_normalizer'>make_normalizer</span><span class='lparen'>(</span><span class='const'>JOBS_MAP</span><span class='comma'>,</span> <span class='id identifier rubyid_offset'>offset</span><span class='comma'>,</span> <span class='const'>JOBS_DATES</span><span class='rparen'>)</span> <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>labels</span><span class='tstring_end'>'</span></span> <span class='id identifier rubyid_make_normalizer'>make_normalizer</span><span class='lparen'>(</span><span class='const'>LABELS_MAP</span><span class='comma'>,</span> <span class='id identifier rubyid_offset'>offset</span><span class='comma'>,</span> <span class='const'>LABELS_DATES</span><span class='rparen'>)</span> <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>streams</span><span class='tstring_end'>'</span></span> <span class='id identifier rubyid_make_normalizer'>make_normalizer</span><span class='lparen'>(</span><span class='const'>STREAMS_MAP</span><span class='comma'>,</span> <span class='id identifier rubyid_offset'>offset</span><span class='comma'>,</span> <span class='const'>STREAMS_DATES</span><span class='rparen'>)</span> <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>users</span><span class='tstring_end'>'</span></span> <span class='id identifier rubyid_make_normalizer'>make_normalizer</span><span class='lparen'>(</span><span class='const'>USERS_MAP</span><span class='comma'>,</span> <span class='id identifier rubyid_offset'>offset</span><span class='comma'>,</span> <span class='const'>USERS_DATES</span><span class='rparen'>)</span> <span class='kw'>else</span> <span class='comment'># By default, do no translation </span> <span class='kw'>return</span> <span class='tlambda'>-></span><span class='lparen'>(</span><span class='id identifier rubyid_x'>x</span><span class='rparen'>)</span> <span class='tlambeg'>{</span> <span class='id identifier rubyid_x'>x</span> <span class='rbrace'>}</span> <span class='kw'>end</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="open-class_method"> + (<tt>Object</tt>) <strong>open</strong>(options = {}) </h3><div class="docstring"> <div class="discussion"> <p>Creates your p4 connection using some common forms.</p> <p>If you call open with a block, this will call connect before your block executes, and disconnect afterwards.</p> <p>If you do not call open with a block, it is up to the caller to connect and disconnect. (It's assumed you are calling w/o a block because you want to manage when the connection actually needs to happen.)</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/util.rb', line 34</span> <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span> <span class='id identifier rubyid_p4'>p4</span> <span class='op'>=</span> <span class='id identifier rubyid_create_p4'>create_p4</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span> <span class='comment'># Again, if we're calling using the block, we'll connect and disconnect. </span> <span class='comment'># Otherwise, just return the created p4 object. </span> <span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span> <span class='kw'>begin</span> <span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_connect'>connect</span> <span class='kw'>yield</span> <span class='id identifier rubyid_p4'>p4</span> <span class='kw'>rescue</span> <span class='const'>P4Exception</span> <span class='op'>=></span> <span class='id identifier rubyid_ex'>ex</span> <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Util.open ex </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_ex'>ex</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span> <span class='id identifier rubyid_raise'>raise</span> <span class='id identifier rubyid_make_p4_error'>make_p4_error</span><span class='lparen'>(</span><span class='id identifier rubyid_p4'>p4</span><span class='rparen'>)</span> <span class='kw'>end</span> <span class='kw'>else</span> <span class='kw'>return</span> <span class='id identifier rubyid_p4'>p4</span> <span class='kw'>end</span> <span class='kw'>ensure</span> <span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_disconnect'>disconnect</span> <span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span> <span class='op'>&&</span> <span class='id identifier rubyid_p4'>p4</span> <span class='op'>&&</span> <span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_connected?'>connected?</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="p4_date_offset-class_method"> + (<tt>Object</tt>) <strong>p4_date_offset</strong>(str) </h3><table class="source_code"> <tr> <td> <pre class="lines"> 428 429 430</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/util.rb', line 428</span> <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_p4_date_offset'>p4_date_offset</span><span class='lparen'>(</span><span class='id identifier rubyid_str'>str</span><span class='rparen'>)</span> <span class='const'>DateTime</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_str'>str</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_zone'>zone</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="p4_date_to_i-class_method"> + (<tt>Object</tt>) <strong>p4_date_to_i</strong>(offset, p4date) </h3><div class="docstring"> <div class="discussion"> <p>In general we get dates without any offset information, which has to be retrieved via the serverDate field from 'p4 info'</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 424 425 426</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/util.rb', line 424</span> <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_p4_date_to_i'>p4_date_to_i</span><span class='lparen'>(</span><span class='id identifier rubyid_offset'>offset</span><span class='comma'>,</span> <span class='id identifier rubyid_p4date'>p4date</span><span class='rparen'>)</span> <span class='const'>DateTime</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_p4date'>p4date</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_offset'>offset</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_time'>to_time</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="p4_ticket?-class_method"> + (<tt>Boolean</tt>) <strong>p4_ticket?</strong>(str) </h3><div class="docstring"> <div class="discussion"> <p>Returns true if the string looks like a Perforce authentication ticket.</p> </div> </div> <div class="tags"> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt>Boolean</tt>)</span> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 91 92 93</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/util.rb', line 91</span> <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_p4_ticket?'>p4_ticket?</span><span class='lparen'>(</span><span class='id identifier rubyid_str'>str</span><span class='rparen'>)</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^[a-zA-Z0-9]{32,}$</span><span class='regexp_end'>/</span></span><span class='period'>.</span><span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='id identifier rubyid_str'>str</span><span class='rparen'>)</span> <span class='op'>!=</span> <span class='kw'>nil</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="raise_error-class_method"> + (<tt>Object</tt>) <strong>raise_error</strong>(p4) </h3><div class="docstring"> <div class="discussion"> <p>Raise an exception if necessary on a P4 Error</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 60 61 62 63</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/util.rb', line 60</span> <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_raise_error'>raise_error</span><span class='lparen'>(</span><span class='id identifier rubyid_p4'>p4</span><span class='rparen'>)</span> <span class='id identifier rubyid_err'>err</span> <span class='op'>=</span> <span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_messages'>messages</span><span class='period'>.</span><span class='id identifier rubyid_find'>find</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_m'>m</span><span class='op'>|</span> <span class='id identifier rubyid_m'>m</span><span class='period'>.</span><span class='id identifier rubyid_severity'>severity</span> <span class='op'>></span> <span class='int'>2</span> <span class='rbrace'>}</span> <span class='id identifier rubyid_fail'>fail</span> <span class='const'>Perforce</span><span class='op'>::</span><span class='const'>P4Error</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_err'>err</span><span class='period'>.</span><span class='id identifier rubyid_msgid'>msgid</span><span class='comma'>,</span> <span class='id identifier rubyid_err'>err</span><span class='period'>.</span><span class='id identifier rubyid_severity'>severity</span><span class='comma'>,</span> <span class='id identifier rubyid_err'>err</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rparen'>)</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="relative_dir?-class_method"> + (<tt>Boolean</tt>) <strong>relative_dir?</strong>(str) </h3><div class="docstring"> <div class="discussion"> <p>Returns true if str is '.' or '..'</p> </div> </div> <div class="tags"> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt>Boolean</tt>)</span> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 86 87 88</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/util.rb', line 86</span> <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_relative_dir?'>relative_dir?</span><span class='lparen'>(</span><span class='id identifier rubyid_str'>str</span><span class='rparen'>)</span> <span class='id identifier rubyid_str'>str</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>.</span><span class='tstring_end'>'</span></span> <span class='op'>||</span> <span class='id identifier rubyid_str'>str</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>..</span><span class='tstring_end'>'</span></span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="replace_unset_with_0-class_method"> + (<tt>Object</tt>) <strong>replace_unset_with_0</strong>(results) </h3><table class="source_code"> <tr> <td> <pre class="lines"> 360 361 362 363 364</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/util.rb', line 360</span> <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_replace_unset_with_0'>replace_unset_with_0</span><span class='lparen'>(</span><span class='id identifier rubyid_results'>results</span><span class='rparen'>)</span> <span class='id identifier rubyid_results'>results</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_r'>r</span><span class='op'>|</span> <span class='id identifier rubyid_r'>r</span><span class='period'>.</span><span class='id identifier rubyid_each_key'>each_key</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='op'>|</span> <span class='id identifier rubyid_r'>r</span><span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>0</span><span class='tstring_end'>'</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_r'>r</span><span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>unset</span><span class='tstring_end'>'</span></span> <span class='rbrace'>}</span> <span class='kw'>end</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="resolve_charset-class_method"> + (<tt>Object</tt>) <strong>resolve_charset</strong>(env, settings) </h3><table class="source_code"> <tr> <td> <pre class="lines"> 448 449 450 451 452 453 454</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/util.rb', line 448</span> <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_resolve_charset'>resolve_charset</span><span class='lparen'>(</span><span class='id identifier rubyid_env'>env</span><span class='comma'>,</span> <span class='id identifier rubyid_settings'>settings</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_env'>env</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>P4_CHARSET</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='id identifier rubyid_settings'>settings</span><span class='period'>.</span><span class='id identifier rubyid_allow_env_p4_config'>allow_env_p4_config</span> <span class='id identifier rubyid_env'>env</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>P4_CHARSET</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='kw'>else</span> <span class='id identifier rubyid_settings'>settings</span><span class='period'>.</span><span class='id identifier rubyid_p4'>p4</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>charset</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='kw'>if</span> <span class='id identifier rubyid_settings'>settings</span><span class='period'>.</span><span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>charset</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='kw'>end</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="resolve_host-class_method"> + (<tt>Object</tt>) <strong>resolve_host</strong>(env, settings) </h3><table class="source_code"> <tr> <td> <pre class="lines"> 432 433 434 435 436 437 438</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/util.rb', line 432</span> <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_resolve_host'>resolve_host</span><span class='lparen'>(</span><span class='id identifier rubyid_env'>env</span><span class='comma'>,</span> <span class='id identifier rubyid_settings'>settings</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_env'>env</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>P4_HOST</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='id identifier rubyid_settings'>settings</span><span class='period'>.</span><span class='id identifier rubyid_allow_env_p4_config'>allow_env_p4_config</span> <span class='id identifier rubyid_env'>env</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>P4_HOST</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='kw'>else</span> <span class='id identifier rubyid_settings'>settings</span><span class='period'>.</span><span class='id identifier rubyid_p4'>p4</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>host</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='kw'>end</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="resolve_password-class_method"> + (<tt>Object</tt>) <strong>resolve_password</strong>(env, settings) </h3><table class="source_code"> <tr> <td> <pre class="lines"> 456 457 458 459 460 461 462 463</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/util.rb', line 456</span> <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_resolve_password'>resolve_password</span><span class='lparen'>(</span><span class='id identifier rubyid_env'>env</span><span class='comma'>,</span> <span class='id identifier rubyid_settings'>settings</span><span class='rparen'>)</span> <span class='id identifier rubyid_password'>password</span> <span class='op'>=</span> <span class='id identifier rubyid_env'>env</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>AUTH_CREDENTIALS</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span> <span class='kw'>if</span> <span class='op'>!</span><span class='const'>Util</span><span class='period'>.</span><span class='id identifier rubyid_uuid?'>uuid?</span><span class='lparen'>(</span><span class='id identifier rubyid_password'>password</span><span class='rparen'>)</span> <span class='id identifier rubyid_password'>password</span> <span class='kw'>else</span> <span class='const'>Auth</span><span class='period'>.</span><span class='id identifier rubyid_read_token'>read_token</span><span class='lparen'>(</span><span class='id identifier rubyid_password'>password</span><span class='comma'>,</span> <span class='id identifier rubyid_settings'>settings</span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>ticket</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='kw'>end</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="resolve_port-class_method"> + (<tt>Object</tt>) <strong>resolve_port</strong>(env, settings) </h3><table class="source_code"> <tr> <td> <pre class="lines"> 440 441 442 443 444 445 446</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/util.rb', line 440</span> <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_resolve_port'>resolve_port</span><span class='lparen'>(</span><span class='id identifier rubyid_env'>env</span><span class='comma'>,</span> <span class='id identifier rubyid_settings'>settings</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_env'>env</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>P4_PORT</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='id identifier rubyid_settings'>settings</span><span class='period'>.</span><span class='id identifier rubyid_allow_env_p4_config'>allow_env_p4_config</span> <span class='id identifier rubyid_env'>env</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>P4_PORT</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='kw'>else</span> <span class='id identifier rubyid_settings'>settings</span><span class='period'>.</span><span class='id identifier rubyid_p4'>p4</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>port</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='kw'>end</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="save_content-class_method"> + (<tt>Object</tt>) <strong>save_content</strong>(root, depot_path, content) </h3><table class="source_code"> <tr> <td> <pre class="lines"> 109 110 111 112 113 114 115</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/util.rb', line 109</span> <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_save_content'>save_content</span><span class='lparen'>(</span><span class='id identifier rubyid_root'>root</span><span class='comma'>,</span> <span class='id identifier rubyid_depot_path'>depot_path</span><span class='comma'>,</span> <span class='id identifier rubyid_content'>content</span><span class='rparen'>)</span> <span class='id identifier rubyid_local_file'>local_file</span> <span class='op'>=</span> <span class='id identifier rubyid_local_path'>local_path</span><span class='lparen'>(</span><span class='id identifier rubyid_depot_path'>depot_path</span><span class='comma'>,</span> <span class='id identifier rubyid_root'>root</span><span class='rparen'>)</span> <span class='id identifier rubyid_dir'>dir</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_dirname'>dirname</span><span class='lparen'>(</span><span class='id identifier rubyid_local_file'>local_file</span><span class='rparen'>)</span> <span class='const'>FileUtils</span><span class='period'>.</span><span class='id identifier rubyid_mkpath'>mkpath</span><span class='lparen'>(</span><span class='id identifier rubyid_dir'>dir</span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='const'>Dir</span><span class='period'>.</span><span class='id identifier rubyid_exist?'>exist?</span><span class='lparen'>(</span><span class='id identifier rubyid_dir'>dir</span><span class='rparen'>)</span> <span class='const'>IO</span><span class='period'>.</span><span class='id identifier rubyid_write'>write</span><span class='lparen'>(</span><span class='id identifier rubyid_local_file'>local_file</span><span class='comma'>,</span> <span class='id identifier rubyid_content'>content</span><span class='rparen'>)</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="singular-class_method"> + (<tt>Object</tt>) <strong>singular</strong>(plural) </h3><table class="source_code"> <tr> <td> <pre class="lines"> 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/util.rb', line 133</span> <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_singular'>singular</span><span class='lparen'>(</span><span class='id identifier rubyid_plural'>plural</span><span class='rparen'>)</span> <span class='id identifier rubyid_matches'>matches</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>branches:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>branch</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>clients:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>client</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>depots:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>depot</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>groups:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>group</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>jobs:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>job</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>labels:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>label</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>protects:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>protect</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>servers:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>server</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>streams:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>stream</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>triggers:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>trigger</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>users:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>user</span><span class='tstring_end'>'</span></span> <span class='rbrace'>}</span> <span class='id identifier rubyid_matches'>matches</span><span class='lbracket'>[</span><span class='id identifier rubyid_plural'>plural</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rbracket'>]</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="uuid?-class_method"> + (<tt>Boolean</tt>) <strong>uuid?</strong>(str) </h3><div class="docstring"> <div class="discussion"> <p>We only count uuids that were returned via SecureRandom.uuid used to generate internal security tokens.</p> </div> </div> <div class="tags"> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt>Boolean</tt>)</span> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 97 98 99 100</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/util.rb', line 97</span> <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_uuid?'>uuid?</span><span class='lparen'>(</span><span class='id identifier rubyid_str'>str</span><span class='rparen'>)</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}$</span><span class='regexp_end'>/</span></span> <span class='period'>.</span><span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='id identifier rubyid_str'>str</span><span class='rparen'>)</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="wildcard?-class_method"> + (<tt>Boolean</tt>) <strong>wildcard?</strong>(str) </h3><div class="docstring"> <div class="discussion"> <p>Returns true when <code>str</code> contains a Perforce wildcard</p> </div> </div> <div class="tags"> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt>Boolean</tt>)</span> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 81 82 83</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/util.rb', line 81</span> <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_wildcard?'>wildcard?</span><span class='lparen'>(</span><span class='id identifier rubyid_str'>str</span><span class='rparen'>)</span> <span class='lparen'>(</span><span class='id identifier rubyid_str'>str</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\.\.\.</span><span class='regexp_end'>/</span></span> <span class='op'>||</span> <span class='id identifier rubyid_str'>str</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\*</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span> <span class='op'>!=</span> <span class='kw'>nil</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> </div> </div> <div id="footer"> Generated on Tue Sep 15 01:20:28 2015 by <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a> 0.8.7.6 (ruby-2.2.3). </div> </body> </html>