<!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> Class: HelixVersioningEngine::HVEProjectsService — 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/HVEProjectsService.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 (H)</a> » <span class='title'><span class='object_link'><a href="../HelixVersioningEngine.html" title="HelixVersioningEngine (module)">HelixVersioningEngine</a></span></span> » <span class="title">HVEProjectsService</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>Class: HelixVersioningEngine::HVEProjectsService </h1> <dl class="box"> <dt class="r1">Inherits:</dt> <dd class="r1"> <span class="inheritName">Object</span> <ul class="fullTree"> <li>Object</li> <li class="next">HelixVersioningEngine::HVEProjectsService</li> </ul> <a href="#" class="inheritanceTree">show all</a> </dd> <dt class="r2 last">Defined in:</dt> <dd class="r2 last">lib/helix_versioning_engine/hve_projects_service.rb</dd> </dl> <div class="clear"></div> <h2>Overview</h2><div class="docstring"> <div class="discussion"> <p>Define simple projects based on a single directory location in a Helix Versioning Engine.</p> <p>This project service uses the HVE_PROJECTS_PATH setting to list available projects on the particular server. If you only have one Helix Versioning Engine, it's suitable to create this as a systemwide default. Otherwise, you likely only want to specify this via headers.</p> <p>This will return everything as “helix versioning engine” project.</p> </div> </div> <div class="tags"> </div> <h2>Constant Summary</h2> <dl class="constants"> <dt id="HVE_CONTENT_TYPE-constant" class="">HVE_CONTENT_TYPE = </dt> <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>application/vnd.perforce.project.hve.v1+json</span><span class='tstring_end'>'</span></span></pre></dd> <dt id="HVE_ID-constant" class="">HVE_ID = </dt> <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>hveProject</span><span class='tstring_end'>'</span></span></pre></dd> </dl> <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2> <ul class="summary"> <li class="public "> <span class="summary_signature"> <a href="#env-instance_method" title="#env (instance method)">- (Object) <strong>env</strong> </a> </span> <span class="summary_desc"><div class='inline'> <p>Rack environment.</p> </div></span> </li> </ul> <h2> Instance Method Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small> </h2> <ul class="summary"> <li class="public "> <span class="summary_signature"> <a href="#create_client-instance_method" title="#create_client (instance method)">- (Object) <strong>create_client</strong>(project_id, device, root) </a> </span> <span class="summary_desc"><div class='inline'> <p>Generate a new client that only contains the project mapping.</p> </div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#create_pending_change-instance_method" title="#create_pending_change (instance method)">- (Object) <strong>create_pending_change</strong>(project_id) </a> </span> <span class="summary_desc"><div class='inline'> <p>If the user doesn't have a current pending change for the project, create one, and return that.</p> </div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#depot_path_for_name-instance_method" title="#depot_path_for_name (instance method)">- (Object) <strong>depot_path_for_name</strong>(name) </a> </span> <span class="summary_desc"><div class='inline'></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#encode_name-instance_method" title="#encode_name (instance method)">- (Object) <strong>encode_name</strong>(name) </a> </span> <span class="summary_desc"><div class='inline'></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#fetch-instance_method" title="#fetch (instance method)">- (Object) <strong>fetch</strong>(id) </a> </span> <span class="summary_desc"><div class='inline'> <p>The ID is a URL encoded version of the directory name under HVE_PROJECTS_PATH.</p> </div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#fetch_by_name-instance_method" title="#fetch_by_name (instance method)">- (Object) <strong>fetch_by_name</strong>(name) </a> </span> <span class="summary_desc"><div class='inline'> <p>Returns the project's “details” based on the project name.</p> </div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#find_latest_change_for_project-instance_method" title="#find_latest_change_for_project (instance method)">- (Object) <strong>find_latest_change_for_project</strong>(project_id) </a> </span> <span class="summary_desc"><div class='inline'> <p>Find the latest submitted change for the project.</p> </div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#find_pending_change_for_project-instance_method" title="#find_pending_change_for_project (instance method)">- (Object) <strong>find_pending_change_for_project</strong>(project_id) </a> </span> <span class="summary_desc"><div class='inline'> <p>The HVE project 'changelist' is a pending changelist whose description is <code><em>hve[user]_[project_id]</em></code>.</p> </div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#hve_projects_path-instance_method" title="#hve_projects_path (instance method)">- (Object) <strong>hve_projects_path</strong> </a> </span> <span class="summary_desc"><div class='inline'></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#initialize-instance_method" title="#initialize (instance method)">- (HVEProjectsService) <strong>initialize</strong>(env: nil) </a> </span> <span class="note title constructor">constructor</span> <span class="summary_desc"><div class='inline'> <p>A new instance of HVEProjectsService.</p> </div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#list-instance_method" title="#list (instance method)">- (Object) <strong>list</strong>(details: false, extension: nil) </a> </span> <span class="summary_desc"><div class='inline'> <p>List HVE Projects as configured in the system.</p> </div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#list_project_names-instance_method" title="#list_project_names (instance method)">- (Object) <strong>list_project_names</strong> </a> </span> <span class="summary_desc"><div class='inline'></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#p4-instance_method" title="#p4 (instance method)">- (Object) <strong>p4</strong> </a> </span> <span class="summary_desc"><div class='inline'></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#p4host-instance_method" title="#p4host (instance method)">- (Object) <strong>p4host</strong> </a> </span> <span class="summary_desc"><div class='inline'></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#p4port-instance_method" title="#p4port (instance method)">- (Object) <strong>p4port</strong> </a> </span> <span class="summary_desc"><div class='inline'></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#safe_hve_projects_path-instance_method" title="#safe_hve_projects_path (instance method)">- (Object) <strong>safe_hve_projects_path</strong> </a> </span> <span class="summary_desc"><div class='inline'></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#server-instance_method" title="#server (instance method)">- (Object) <strong>server</strong> </a> </span> <span class="summary_desc"><div class='inline'></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#server_uri_for_id-instance_method" title="#server_uri_for_id (instance method)">- (Object) <strong>server_uri_for_id</strong>(id) </a> </span> <span class="summary_desc"><div class='inline'></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#unencode_name-instance_method" title="#unencode_name (instance method)">- (Object) <strong>unencode_name</strong>(name) </a> </span> <span class="summary_desc"><div class='inline'></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#user-instance_method" title="#user (instance method)">- (Object) <strong>user</strong> </a> </span> <span class="summary_desc"><div class='inline'></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#userinfo-instance_method" title="#userinfo (instance method)">- (Object) <strong>userinfo</strong> </a> </span> <span class="summary_desc"><div class='inline'> <p>For HVE Projects, it may be interesting to people to see various connection settings for each server URL.</p> </div></span> </li> </ul> <div id="constructor_details" class="method_details_list"> <h2>Constructor Details</h2> <div class="method_details first"> <h3 class="signature first" id="initialize-instance_method"> - (<tt><span class='object_link'><a href="" title="HelixVersioningEngine::HVEProjectsService (class)">HVEProjectsService</a></span></tt>) <strong>initialize</strong>(env: nil) </h3><div class="docstring"> <div class="discussion"> <p>Returns a new instance of HVEProjectsService</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 26 27 28</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/hve_projects_service.rb', line 26</span> <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='label'>env:</span> <span class='kw'>nil</span><span class='rparen'>)</span> <span class='ivar'>@env</span> <span class='op'>=</span> <span class='id identifier rubyid_env'>env</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> </div> <div id="instance_attr_details" class="attr_details"> <h2>Instance Attribute Details</h2> <span id="env=-instance_method"></span> <div class="method_details first"> <h3 class="signature first" id="env-instance_method"> - (<tt>Object</tt>) <strong>env</strong> </h3><div class="docstring"> <div class="discussion"> <p>Rack environment.</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 24 25 26</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/hve_projects_service.rb', line 24</span> <span class='kw'>def</span> <span class='id identifier rubyid_env'>env</span> <span class='ivar'>@env</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> </div> <div id="instance_method_details" class="method_details_list"> <h2>Instance Method Details</h2> <div class="method_details first"> <h3 class="signature first" id="create_client-instance_method"> - (<tt>Object</tt>) <strong>create_client</strong>(project_id, device, root) </h3><div class="docstring"> <div class="discussion"> <p>Generate a new client that only contains the project mapping.</p> <p>The client name is a combination of user, project, and device. We prefix it with “_hve” just for clarity.</p> <p>We do not host lock the client.</p> </div> </div> <div class="tags"> <p class="tag_title">Parameters:</p> <ul class="param"> <li> <span class='name'>project_id</span> <span class='type'>(<tt>String</tt>)</span> — <div class='inline'> <p>Our encoded project name</p> </div> </li> <li> <span class='name'>device</span> <span class='type'>(<tt>String</tt>)</span> — <div class='inline'> <p>A device ID, like a hostname</p> </div> </li> <li> <span class='name'>root</span> <span class='type'>(<tt>String</tt>)</span> — <div class='inline'> <p>The <code>Root</code> value for the client parameter</p> </div> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/hve_projects_service.rb', line 88</span> <span class='kw'>def</span> <span class='id identifier rubyid_create_client'>create_client</span><span class='lparen'>(</span><span class='id identifier rubyid_project_id'>project_id</span><span class='comma'>,</span> <span class='id identifier rubyid_device'>device</span><span class='comma'>,</span> <span class='id identifier rubyid_root'>root</span><span class='rparen'>)</span> <span class='id identifier rubyid_client_name'>client_name</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>_hve_</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_user'>user</span><span class='embexpr_end'>}</span><span class='tstring_content'>_</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_project_id'>project_id</span><span class='embexpr_end'>}</span><span class='tstring_content'>_</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_device'>device</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span> <span class='id identifier rubyid_client_spec'>client_spec</span> <span class='op'>=</span> <span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_fetch_client'>fetch_client</span><span class='lparen'>(</span><span class='id identifier rubyid_client_name'>client_name</span><span class='rparen'>)</span> <span class='id identifier rubyid_client_spec'>client_spec</span><span class='period'>.</span><span class='id identifier rubyid__root'>_root</span> <span class='op'>=</span> <span class='id identifier rubyid_root'>root</span><span class='semicolon'>;</span> <span class='id identifier rubyid_client_spec'>client_spec</span><span class='period'>.</span><span class='id identifier rubyid__host'>_host</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='semicolon'>;</span> <span class='id identifier rubyid_client_spec'>client_spec</span><span class='period'>.</span><span class='id identifier rubyid__options'>_options</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>allwrite noclobber nocompress unlocked nomodtime rmdir</span><span class='tstring_end'>'</span></span><span class='semicolon'>;</span> <span class='id identifier rubyid_project_name'>project_name</span> <span class='op'>=</span> <span class='id identifier rubyid_unencode_name'>unencode_name</span><span class='lparen'>(</span><span class='id identifier rubyid_project_id'>project_id</span><span class='rparen'>)</span> <span class='id identifier rubyid_client_spec'>client_spec</span><span class='period'>.</span><span class='id identifier rubyid__view'>_view</span> <span class='op'>=</span> <span class='lbracket'>[</span> <span class='tstring'><span class='tstring_beg'>%Q|</span><span class='tstring_content'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_depot_path_for_name'>depot_path_for_name</span><span class='lparen'>(</span><span class='id identifier rubyid_project_name'>project_name</span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>/..." "//</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_client_name'>client_name</span><span class='embexpr_end'>}</span><span class='tstring_content'>/..."</span><span class='tstring_end'>|</span></span> <span class='rbracket'>]</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_client'>save_client</span><span class='lparen'>(</span><span class='id identifier rubyid_client_spec'>client_spec</span><span class='rparen'>)</span> <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>new client results: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_results'>results</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span> <span class='id identifier rubyid_client_name'>client_name</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="create_pending_change-instance_method"> - (<tt>Object</tt>) <strong>create_pending_change</strong>(project_id) </h3><div class="docstring"> <div class="discussion"> <p>If the user doesn't have a current pending change for the project, create one, and return that.</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/hve_projects_service.rb', line 139</span> <span class='kw'>def</span> <span class='id identifier rubyid_create_pending_change'>create_pending_change</span><span class='lparen'>(</span><span class='id identifier rubyid_project_id'>project_id</span><span class='rparen'>)</span> <span class='id identifier rubyid_change'>change</span> <span class='op'>=</span> <span class='id identifier rubyid_find_pending_change_for_project'>find_pending_change_for_project</span><span class='lparen'>(</span><span class='id identifier rubyid_project_id'>project_id</span><span class='rparen'>)</span> <span class='kw'>return</span> <span class='id identifier rubyid_change'>change</span> <span class='kw'>if</span> <span class='id identifier rubyid_change'>change</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='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>_hws_</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_user'>user</span><span class='embexpr_end'>}</span><span class='tstring_content'>_</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_project_id'>project_id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span> <span class='id identifier rubyid_save_results'>save_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_change'>change</span> <span class='op'>=</span> <span class='id identifier rubyid_save_results'>save_results</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</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='comment'># If we don't reset the client of this pending change, we won't be able </span> <span class='comment'># to cleanup the temporary client. </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='lparen'>(</span><span class='id identifier rubyid_change'>change</span><span class='rparen'>)</span> <span class='id identifier rubyid_change_spec'>change_spec</span><span class='period'>.</span><span class='id identifier rubyid__client'>_client</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>INVALID</span><span class='tstring_end'>'</span></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_change'>change</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="depot_path_for_name-instance_method"> - (<tt>Object</tt>) <strong>depot_path_for_name</strong>(name) </h3><table class="source_code"> <tr> <td> <pre class="lines"> 172 173 174</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/hve_projects_service.rb', line 172</span> <span class='kw'>def</span> <span class='id identifier rubyid_depot_path_for_name'>depot_path_for_name</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_hve_projects_path'>hve_projects_path</span><span class='embexpr_end'>}</span><span class='tstring_content'>/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</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="encode_name-instance_method"> - (<tt>Object</tt>) <strong>encode_name</strong>(name) </h3><table class="source_code"> <tr> <td> <pre class="lines"> 160 161 162</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/hve_projects_service.rb', line 160</span> <span class='kw'>def</span> <span class='id identifier rubyid_encode_name'>encode_name</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span> <span class='const'>HWSStrings</span><span class='period'>.</span><span class='id identifier rubyid_component_encode'>component_encode</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="fetch-instance_method"> - (<tt>Object</tt>) <strong>fetch</strong>(id) </h3><div class="docstring"> <div class="discussion"> <p>The ID is a URL encoded version of the directory name under HVE_PROJECTS_PATH.</p> <p>This will unencode the ID and fetch by name.</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 56 57 58 59</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/hve_projects_service.rb', line 56</span> <span class='kw'>def</span> <span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span> <span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='id identifier rubyid_unencode_name'>unencode_name</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span> <span class='id identifier rubyid_fetch_by_name'>fetch_by_name</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="fetch_by_name-instance_method"> - (<tt>Object</tt>) <strong>fetch_by_name</strong>(name) </h3><div class="docstring"> <div class="discussion"> <p>Returns the project's “details” based on the project name.</p> <p>No validation is done to ensure this directory actually exists in the system.</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 65 66 67 68 69 70 71 72 73 74 75 76</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/hve_projects_service.rb', line 65</span> <span class='kw'>def</span> <span class='id identifier rubyid_fetch_by_name'>fetch_by_name</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span> <span class='id identifier rubyid_id'>id</span> <span class='op'>=</span> <span class='id identifier rubyid_encode_name'>encode_name</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>id</span><span class='label_end'>':</span> <span class='id identifier rubyid_id'>id</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>name</span><span class='label_end'>':</span> <span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>server</span><span class='label_end'>':</span> <span class='id identifier rubyid_server_uri_for_id'>server_uri_for_id</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='const'>HVE_ID</span> <span class='op'>=></span> <span class='lbrace'>{</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>depotPath</span><span class='label_end'>':</span> <span class='id identifier rubyid_depot_path_for_name'>depot_path_for_name</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span> <span class='rbrace'>}</span> <span class='rbrace'>}</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="find_latest_change_for_project-instance_method"> - (<tt>Object</tt>) <strong>find_latest_change_for_project</strong>(project_id) </h3><div class="docstring"> <div class="discussion"> <p>Find the latest submitted change for the project</p> <p>Use the 'p4 changes -m 1 -s submitted [depot path]'</p> </div> </div> <div class="tags"> <p class="tag_title">Parameters:</p> <ul class="param"> <li> <span class='name'>project_id</span> <span class='type'>(<tt>String</tt>)</span> — <div class='inline'> <p>The encoded project ID</p> </div> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 115 116 117 118 119 120 121 122</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/hve_projects_service.rb', line 115</span> <span class='kw'>def</span> <span class='id identifier rubyid_find_latest_change_for_project'>find_latest_change_for_project</span><span class='lparen'>(</span><span class='id identifier rubyid_project_id'>project_id</span><span class='rparen'>)</span> <span class='id identifier rubyid_project_name'>project_name</span> <span class='op'>=</span> <span class='id identifier rubyid_unencode_name'>unencode_name</span><span class='lparen'>(</span><span class='id identifier rubyid_project_id'>project_id</span><span class='rparen'>)</span> <span class='id identifier rubyid_depot_path'>depot_path</span> <span class='op'>=</span> <span class='id identifier rubyid_depot_path_for_name'>depot_path_for_name</span><span class='lparen'>(</span><span class='id identifier rubyid_project_name'>project_name</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_changes'>run_changes</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-m</span><span class='tstring_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='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-s</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>submitted</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_depot_path'>depot_path</span><span class='embexpr_end'>}</span><span class='tstring_content'>/...</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='id identifier rubyid_results'>results</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>change</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='kw'>unless</span> <span class='id identifier rubyid_results'>results</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="find_pending_change_for_project-instance_method"> - (<tt>Object</tt>) <strong>find_pending_change_for_project</strong>(project_id) </h3><div class="docstring"> <div class="discussion"> <p>The HVE project 'changelist' is a pending changelist whose description is <code><em>hve[user]_[project_id]</em></code></p> <p>We use 'changes -l' to find the change to match potentially long project names.</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 129 130 131 132 133 134 135</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/hve_projects_service.rb', line 129</span> <span class='kw'>def</span> <span class='id identifier rubyid_find_pending_change_for_project'>find_pending_change_for_project</span><span class='lparen'>(</span><span class='id identifier rubyid_project_id'>project_id</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_changes'>run_changes</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-l</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-u</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_user'>user</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-s</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>pending</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='id identifier rubyid_change'>change</span> <span class='op'>=</span> <span class='id identifier rubyid_results'>results</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_r'>r</span><span class='op'>|</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'>desc</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_project_id'>project_id</span><span class='rparen'>)</span> <span class='rbrace'>}</span> <span class='id identifier rubyid_change'>change</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>change</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='kw'>if</span> <span class='id identifier rubyid_change'>change</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="hve_projects_path-instance_method"> - (<tt>Object</tt>) <strong>hve_projects_path</strong> </h3><table class="source_code"> <tr> <td> <pre class="lines"> 180 181 182</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/hve_projects_service.rb', line 180</span> <span class='kw'>def</span> <span class='id identifier rubyid_hve_projects_path'>hve_projects_path</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'>hws_settings</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='const'>HVE_PROJECTS_PATH</span> <span class='op'>||</span> <span class='id identifier rubyid_fail'>fail</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>HVE_PROJECTS_PATH not set</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="list-instance_method"> - (<tt>Object</tt>) <strong>list</strong>(details: false, extension: nil) </h3><div class="docstring"> <div class="discussion"> <p>List HVE Projects as configured in the system.</p> <p>See the Appendix in the documentation for details on values.</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 33 34 35 36 37 38 39 40 41 42 43 44</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/hve_projects_service.rb', line 33</span> <span class='kw'>def</span> <span class='id identifier rubyid_list'>list</span><span class='lparen'>(</span><span class='label'>details:</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='label'>extension:</span> <span class='kw'>nil</span><span class='rparen'>)</span> <span class='kw'>return</span> <span class='kw'>if</span> <span class='id identifier rubyid_extension'>extension</span> <span class='kw'>and</span> <span class='lparen'>(</span><span class='id identifier rubyid_extension'>extension</span> <span class='op'>!=</span> <span class='const'>HVE_ID</span> <span class='kw'>or</span> <span class='id identifier rubyid_extension'>extension</span> <span class='op'>!=</span> <span class='const'>HVE_CONTENT_TYPE</span><span class='rparen'>)</span> <span class='id identifier rubyid_project_dirs'>project_dirs</span> <span class='op'>=</span> <span class='id identifier rubyid_list_project_names'>list_project_names</span> <span class='id identifier rubyid_project_names'>project_names</span> <span class='op'>=</span> <span class='id identifier rubyid_project_dirs'>project_dirs</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_d'>d</span><span class='op'>|</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_basename'>basename</span><span class='lparen'>(</span><span class='id identifier rubyid_d'>d</span><span class='rparen'>)</span> <span class='rbrace'>}</span> <span class='kw'>if</span> <span class='id identifier rubyid_details'>details</span> <span class='id identifier rubyid_project_names'>project_names</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_n'>n</span><span class='op'>|</span> <span class='id identifier rubyid_fetch_by_name'>fetch_by_name</span><span class='lparen'>(</span><span class='id identifier rubyid_n'>n</span><span class='rparen'>)</span> <span class='rbrace'>}</span> <span class='kw'>else</span> <span class='id identifier rubyid_project_names'>project_names</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_n'>n</span><span class='op'>|</span> <span class='id identifier rubyid_encode_name'>encode_name</span><span class='lparen'>(</span><span class='id identifier rubyid_n'>n</span><span class='rparen'>)</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="list_project_names-instance_method"> - (<tt>Object</tt>) <strong>list_project_names</strong> </h3><table class="source_code"> <tr> <td> <pre class="lines"> 46 47 48 49 50</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/hve_projects_service.rb', line 46</span> <span class='kw'>def</span> <span class='id identifier rubyid_list_project_names'>list_project_names</span> <span class='id identifier rubyid_pattern'>pattern</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_hve_projects_path'>hve_projects_path</span><span class='embexpr_end'>}</span><span class='tstring_content'>/*</span><span class='tstring_end'>"</span></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_dirs'>run_dirs</span><span class='lparen'>(</span><span class='id identifier rubyid_pattern'>pattern</span><span class='rparen'>)</span> <span class='id identifier rubyid_results'>results</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_r'>r</span><span class='op'>|</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'>dir</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='rbrace'>}</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="p4-instance_method"> - (<tt>Object</tt>) <strong>p4</strong> </h3><table class="source_code"> <tr> <td> <pre class="lines"> 176 177 178</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/hve_projects_service.rb', line 176</span> <span class='kw'>def</span> <span class='id identifier rubyid_p4'>p4</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</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='id identifier rubyid_fail'>fail</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>p4 required to use HVEProjects</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="p4host-instance_method"> - (<tt>Object</tt>) <strong>p4host</strong> </h3><table class="source_code"> <tr> <td> <pre class="lines"> 220 221 222</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/hve_projects_service.rb', line 220</span> <span class='kw'>def</span> <span class='id identifier rubyid_p4host'>p4host</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'>hws_settings</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='const'>P4HOST</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="p4port-instance_method"> - (<tt>Object</tt>) <strong>p4port</strong> </h3><table class="source_code"> <tr> <td> <pre class="lines"> 216 217 218</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/hve_projects_service.rb', line 216</span> <span class='kw'>def</span> <span class='id identifier rubyid_p4port'>p4port</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'>hws_settings</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='const'>P4PORT</span> <span class='op'>||</span> <span class='id identifier rubyid_fail'>fail</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>P4PORT setting not available</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="safe_hve_projects_path-instance_method"> - (<tt>Object</tt>) <strong>safe_hve_projects_path</strong> </h3><table class="source_code"> <tr> <td> <pre class="lines"> 184 185 186</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/hve_projects_service.rb', line 184</span> <span class='kw'>def</span> <span class='id identifier rubyid_safe_hve_projects_path'>safe_hve_projects_path</span> <span class='id identifier rubyid_hve_projects_path'>hve_projects_path</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>//</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>/</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="server-instance_method"> - (<tt>Object</tt>) <strong>server</strong> </h3><table class="source_code"> <tr> <td> <pre class="lines"> 207 208 209 210 211 212 213 214</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/hve_projects_service.rb', line 207</span> <span class='kw'>def</span> <span class='id identifier rubyid_server'>server</span> <span class='kw'>return</span> <span class='id identifier rubyid_p4port'>p4port</span> <span class='kw'>if</span> <span class='id identifier rubyid_p4port'>p4port</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>:</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='id identifier rubyid_host'>host</span> <span class='op'>=</span> <span class='id identifier rubyid_p4host'>p4host</span> <span class='op'>?</span> <span class='id identifier rubyid_p4host'>p4host</span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>localhost</span><span class='tstring_end'>'</span></span> <span class='id identifier rubyid_port'>port</span> <span class='op'>=</span> <span class='id identifier rubyid_p4port'>p4port</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_host'>host</span><span class='embexpr_end'>}</span><span class='tstring_content'>:</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_port'>port</span><span class='embexpr_end'>}</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="server_uri_for_id-instance_method"> - (<tt>Object</tt>) <strong>server_uri_for_id</strong>(id) </h3><table class="source_code"> <tr> <td> <pre class="lines"> 168 169 170</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/hve_projects_service.rb', line 168</span> <span class='kw'>def</span> <span class='id identifier rubyid_server_uri_for_id'>server_uri_for_id</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>p4://</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_userinfo'>userinfo</span><span class='embexpr_end'>}</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_server'>server</span><span class='embexpr_end'>}</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_safe_hve_projects_path'>safe_hve_projects_path</span><span class='embexpr_end'>}</span><span class='tstring_content'>/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</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="unencode_name-instance_method"> - (<tt>Object</tt>) <strong>unencode_name</strong>(name) </h3><table class="source_code"> <tr> <td> <pre class="lines"> 164 165 166</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/hve_projects_service.rb', line 164</span> <span class='kw'>def</span> <span class='id identifier rubyid_unencode_name'>unencode_name</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span> <span class='const'>HWSStrings</span><span class='period'>.</span><span class='id identifier rubyid_component_decode'>component_decode</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="user-instance_method"> - (<tt>Object</tt>) <strong>user</strong> </h3><table class="source_code"> <tr> <td> <pre class="lines"> 188 189 190</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/hve_projects_service.rb', line 188</span> <span class='kw'>def</span> <span class='id identifier rubyid_user'>user</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_first'>first</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="userinfo-instance_method"> - (<tt>Object</tt>) <strong>userinfo</strong> </h3><div class="docstring"> <div class="discussion"> <p>For HVE Projects, it may be interesting to people to see various connection settings for each server URL.</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 194 195 196 197 198 199 200 201 202 203 204 205</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/hve_projects_service.rb', line 194</span> <span class='kw'>def</span> <span class='id identifier rubyid_userinfo'>userinfo</span> <span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span> <span class='kw'>if</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'>hws_settings</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='const'>P4CHARSET</span> <span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>P4CHARSET</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</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'>hws_settings</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='const'>P4CHARSET</span> <span class='kw'>end</span> <span class='kw'>if</span> <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span> <span class='kw'>else</span> <span class='id identifier rubyid_encoded_data'>encoded_data</span> <span class='op'>=</span> <span class='id identifier rubyid_data'>data</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_k'>k</span><span class='comma'>,</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_k'>k</span><span class='embexpr_end'>}</span><span class='tstring_content'>=</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_v'>v</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>;</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_encoded_data'>encoded_data</span><span class='embexpr_end'>}</span><span class='tstring_content'>@</span><span class='tstring_end'>"</span></span> <span class='kw'>end</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> </div> </div> <div id="footer"> Generated on Tue Sep 15 01:20:31 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>