<!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: Projects::Methods
— 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#!Projects/Methods.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 (M)</a> »
<span class='title'><span class='object_link'><a href="../Projects.html" title="Projects (module)">Projects</a></span></span>
»
<span class="title">Methods</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: Projects::Methods
</h1>
<dl class="box">
<dt class="r1">Included in:</dt>
<dd class="r1"><span class='object_link'><a href="App.html" title="Projects::App (class)">App</a></span></dd>
<dt class="r2 last">Defined in:</dt>
<dd class="r2 last">lib/projects/methods.rb</dd>
</dl>
<div class="clear"></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 Method Summary
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
</h2>
<ul class="summary">
<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_depot_dir_name-instance_method" title="#fetch_by_depot_dir_name (instance method)">- (Object) <strong>fetch_by_depot_dir_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="#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="#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="#list_project_names_onsite_impl-instance_method" title="#list_project_names_onsite_impl (instance method)">- (Object) <strong>list_project_names_onsite_impl</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="#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="instance_method_details" class="method_details_list">
<h2>Instance Method Details</h2>
<div class="method_details first">
<h3 class="signature first" 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">
91
92
93</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/projects/methods.rb', line 91</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">
79
80
81</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/projects/methods.rb', line 79</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">
50
51
52
53
54
55
56
57
58
59</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/projects/methods.rb', line 50</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='kw'>if</span> <span class='op'>!</span><span class='const'>Cloud</span><span class='op'>::</span><span class='const'>Settings</span><span class='period'>.</span><span class='id identifier rubyid_cloud_enabled?'>cloud_enabled?</span>
<span class='kw'>return</span> <span class='id identifier rubyid_fetch_by_depot_dir_name'>fetch_by_depot_dir_name</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_projects_service'>projects_service</span> <span class='op'>=</span> <span class='const'>Cloud</span><span class='op'>::</span><span class='const'>Projects</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>env:</span><span class='ivar'>@env</span><span class='rparen'>)</span>
<span class='id identifier rubyid_projects_service'>projects_service</span><span class='period'>.</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='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="fetch_by_depot_dir_name-instance_method">
- (<tt>Object</tt>) <strong>fetch_by_depot_dir_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
77</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/projects/methods.rb', line 65</span>
<span class='kw'>def</span> <span class='id identifier rubyid_fetch_by_depot_dir_name'>fetch_by_depot_dir_name</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='kw'>nil</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'>HVE_PROJECTS_PATH</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</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="hve_projects_path-instance_method">
- (<tt>Object</tt>) <strong>hve_projects_path</strong>
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
95
96
97</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/projects/methods.rb', line 95</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">
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/projects/methods.rb', line 13</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='kw'>if</span> <span class='const'>Cloud</span><span class='op'>::</span><span class='const'>Settings</span><span class='period'>.</span><span class='id identifier rubyid_cloud_enabled?'>cloud_enabled?</span>
<span class='id identifier rubyid_projects_service'>projects_service</span> <span class='op'>=</span> <span class='const'>Cloud</span><span class='op'>::</span><span class='const'>Projects</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>env:</span><span class='ivar'>@env</span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='id identifier rubyid_projects_service'>projects_service</span><span class='period'>.</span><span class='id identifier rubyid_list'>list</span><span class='lparen'>(</span><span class='label'>details:</span> <span class='id identifier rubyid_details'>details</span><span class='rparen'>)</span>
<span class='kw'>end</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_depot_dir_name'>fetch_by_depot_dir_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">
31
32
33
34
35
36
37
38</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/projects/methods.rb', line 31</span>
<span class='kw'>def</span> <span class='id identifier rubyid_list_project_names'>list_project_names</span>
<span class='kw'>if</span> <span class='op'>!</span><span class='const'>Cloud</span><span class='op'>::</span><span class='const'>Settings</span><span class='period'>.</span><span class='id identifier rubyid_cloud_enabled?'>cloud_enabled?</span>
<span class='kw'>return</span> <span class='id identifier rubyid_list_project_names_onsite_impl'>list_project_names_onsite_impl</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_projects_service'>projects_service</span> <span class='op'>=</span> <span class='const'>Cloud</span><span class='op'>::</span><span class='const'>Projects</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>env:</span><span class='ivar'>@env</span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='id identifier rubyid_projects_service'>projects_service</span><span class='period'>.</span><span class='id identifier rubyid_list'>list</span><span class='lparen'>(</span><span class='kw'>false</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="list_project_names_onsite_impl-instance_method">
- (<tt>Object</tt>) <strong>list_project_names_onsite_impl</strong>
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
40
41
42
43
44</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/projects/methods.rb', line 40</span>
<span class='kw'>def</span> <span class='id identifier rubyid_list_project_names_onsite_impl'>list_project_names_onsite_impl</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="p4host-instance_method">
- (<tt>Object</tt>) <strong>p4host</strong>
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
131
132
133</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/projects/methods.rb', line 131</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">
127
128
129</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/projects/methods.rb', line 127</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">
99
100
101</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/projects/methods.rb', line 99</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">
118
119
120
121
122
123
124
125</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/projects/methods.rb', line 118</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">
87
88
89</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/projects/methods.rb', line 87</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">
83
84
85</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/projects/methods.rb', line 83</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="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">
105
106
107
108
109
110
111
112
113
114
115
116</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/projects/methods.rb', line 105</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 Mon Oct 12 22:20:50 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>