<!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: GitFusion::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#!GitFusion/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="../GitFusion.html" title="GitFusion (module)">GitFusion</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: GitFusion::Util </h1> <dl class="box"> <dt class="r1">Includes:</dt> <dd class="r1"><span class='object_link'><a href="../HelixVersioningEngine.html" title="HelixVersioningEngine (module)">HelixVersioningEngine</a></span></dd> <dt class="r2">Included in:</dt> <dd class="r2"><span class='object_link'><a href="App.html" title="GitFusion::App (class)">App</a></span>, <span class='object_link'><a href="ConfigParser.html" title="GitFusion::ConfigParser (module)">ConfigParser</a></span></dd> <dt class="r1 last">Defined in:</dt> <dd class="r1 last">lib/git_fusion/util.rb</dd> </dl> <div class="clear"></div> <h2>Overview</h2><div class="docstring"> <div class="discussion"> <p>namespace for functions supporting git-fusion api</p> </div> </div> <div class="tags"> </div> <h2>Constant Summary</h2> <dl class="constants"> <dt id="REPO_INITIALISED-constant" class="">REPO_INITIALISED = <div class="docstring"> <div class="discussion"> <p>Messages back to client</p> </div> </div> <div class="tags"> </div> </dt> <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Repository already initialised</span><span class='tstring_end'>'</span></span></pre></dd> <dt id="PATCH_PARAMS_DONT_EXIST-constant" class="">PATCH_PARAMS_DONT_EXIST = </dt> <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Chosen repo configuration</span><span class='tstring_end'>'</span></span> \ <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>p4gf_file does not have all of the specified parameters</span><span class='tstring_end'>'</span></span></pre></dd> <dt id="KEY_ALREADY_EXISTS-constant" class="">KEY_ALREADY_EXISTS = </dt> <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Key under this name already uploaded, </span><span class='tstring_end'>'</span></span> \ <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>choose a different name</span><span class='tstring_end'>'</span></span></pre></dd> <dt id="USER_NOT_MATCHING-constant" class="">USER_NOT_MATCHING = </dt> <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>User is authenticated, </span><span class='tstring_end'>'</span></span> \ <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>but not authorised to view the requested data.</span><span class='tstring_end'>'</span></span></pre></dd> <dt id="DF_MATCH-constant" class="">DF_MATCH = </dt> <dd><pre class="code"><span class='tstring'><span class='regexp_beg'>%r{</span><span class='tstring_content'>\/\/(?<depot>.*)\/users\/(?<user>.*)\/keys\/(?<key_name>.*)$</span><span class='regexp_end'>}</span></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="#error%3F-class_method" title="error? (class method)">+ (Boolean) <strong>error?</strong>(p4) </a> </span> <span class="summary_desc"><div class='inline'></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="#all_keys-instance_method" title="#all_keys (instance method)">- (Object) <strong>all_keys</strong> </a> </span> <span class="summary_desc"><div class='inline'></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#check_if_key_exists-instance_method" title="#check_if_key_exists (instance method)">- (Object) <strong>check_if_key_exists</strong>(key) </a> </span> <span class="summary_desc"><div class='inline'></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#check_if_key_name_exists-instance_method" title="#check_if_key_name_exists (instance method)">- (Object) <strong>check_if_key_name_exists</strong>(key, user) </a> </span> <span class="summary_desc"><div class='inline'></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#decode_from_uri-instance_method" title="#decode_from_uri (instance method)">- (Object) <strong>decode_from_uri</strong>(*args) </a> </span> <span class="summary_desc"><div class='inline'></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#encode_to_gf_format-instance_method" title="#encode_to_gf_format (instance method)">- (Object) <strong>encode_to_gf_format</strong>(*args) </a> </span> <span class="summary_desc"><div class='inline'></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#error_and_clean_up-instance_method" title="#error_and_clean_up (instance method)">- (Object) <strong>error_and_clean_up</strong>(error) </a> </span> <span class="summary_desc"><div class='inline'></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#get_by_key-instance_method" title="#get_by_key (instance method)">- (Object) <strong>get_by_key</strong>(key, value) </a> </span> <span class="summary_desc"><div class='inline'></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#keys_for_user-instance_method" title="#keys_for_user (instance method)">- (Object) <strong>keys_for_user</strong>(user) </a> </span> <span class="summary_desc"><div class='inline'></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#print_result-instance_method" title="#print_result (instance method)">- (Object) <strong>print_result</strong>(file_location, p4: nil) </a> </span> <span class="summary_desc"><div class='inline'></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#submit_file-instance_method" title="#submit_file (instance method)">- (Object) <strong>submit_file</strong>(p4, file_path, file_content, description) </a> </span> <span class="summary_desc"><div class='inline'></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#temp_client-instance_method" title="#temp_client (instance method)">- (Object) <strong>temp_client</strong> </a> </span> <span class="summary_desc"><div class='inline'></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#to_message-instance_method" title="#to_message (instance method)">- (Object) <strong>to_message</strong>(message) </a> </span> <span class="summary_desc"><div class='inline'></div></span> </li> </ul> <h3 class="inherited">Methods included from <span class='object_link'><a href="../HelixVersioningEngine.html" title="HelixVersioningEngine (module)">HelixVersioningEngine</a></span></h3> <p class="inherited"><span class='object_link'><a href="../HelixVersioningEngine.html#invalid_user_email%3F-class_method" title="HelixVersioningEngine.invalid_user_email? (method)">invalid_user_email?</a></span></p> <div id="class_method_details" class="method_details_list"> <h2>Class Method Details</h2> <div class="method_details first"> <h3 class="signature first" id="error?-class_method"> + (<tt>Boolean</tt>) <strong>error?</strong>(p4) </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"> 60 61 62</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/git_fusion/util.rb', line 60</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> <div id="instance_method_details" class="method_details_list"> <h2>Instance Method Details</h2> <div class="method_details first"> <h3 class="signature first" id="all_keys-instance_method"> - (<tt>Object</tt>) <strong>all_keys</strong> </h3><table class="source_code"> <tr> <td> <pre class="lines"> 27 28 29 30 31 32 33 34 35 36 37 38</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/git_fusion/util.rb', line 27</span> <span class='kw'>def</span> <span class='id identifier rubyid_all_keys'>all_keys</span> <span class='id identifier rubyid_p4'>p4</span><span class='comma'>,</span> <span class='id identifier rubyid_hws_settings'>hws_settings</span> <span class='op'>=</span> <span class='id identifier rubyid_temp_client'>temp_client</span> <span class='id identifier rubyid_file_list'>file_list</span> <span class='op'>=</span> <span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_run_files'>run_files</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-e</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='embexpr_beg'>#{</span><span class='id identifier rubyid_hws_settings'>hws_settings</span><span class='period'>.</span><span class='const'>GIT_FUSION_DEPOT</span><span class='embexpr_end'>}</span><span class='tstring_content'>/users/*/...</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='id identifier rubyid_file_list'>file_list</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_file'>file</span><span class='op'>|</span> <span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='id identifier rubyid_file'>file</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='period'>.</span><span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='const'>DF_MATCH</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>key_name</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='const'>GitFusionStrings</span><span class='period'>.</span><span class='id identifier rubyid_decode'>decode</span><span class='lparen'>(</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'>key_name</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rparen'>)</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='id identifier rubyid_data'>data</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='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>key</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='id identifier rubyid_print_result'>print_result</span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</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='comma'>,</span> <span class='label'>p4:</span> <span class='id identifier rubyid_p4'>p4</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="check_if_key_exists-instance_method"> - (<tt>Object</tt>) <strong>check_if_key_exists</strong>(key) </h3><table class="source_code"> <tr> <td> <pre class="lines"> 45 46 47 48</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/git_fusion/util.rb', line 45</span> <span class='kw'>def</span> <span class='id identifier rubyid_check_if_key_exists'>check_if_key_exists</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span> <span class='id identifier rubyid_keys'>keys</span> <span class='op'>=</span> <span class='id identifier rubyid_all_keys'>all_keys</span> <span class='id identifier rubyid_keys'>keys</span><span class='period'>.</span><span class='id identifier rubyid_any?'>any?</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_h'>h</span><span class='op'>|</span> <span class='id identifier rubyid_h'>h</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>key</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='id identifier rubyid_key'>key</span> <span class='rbrace'>}</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="check_if_key_name_exists-instance_method"> - (<tt>Object</tt>) <strong>check_if_key_name_exists</strong>(key, user) </h3><table class="source_code"> <tr> <td> <pre class="lines"> 50 51 52 53</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/git_fusion/util.rb', line 50</span> <span class='kw'>def</span> <span class='id identifier rubyid_check_if_key_name_exists'>check_if_key_name_exists</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_user'>user</span><span class='rparen'>)</span> <span class='id identifier rubyid_keys'>keys</span> <span class='op'>=</span> <span class='id identifier rubyid_all_keys'>all_keys</span> <span class='id identifier rubyid_keys'>keys</span><span class='period'>.</span><span class='id identifier rubyid_any?'>any?</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_h'>h</span><span class='op'>|</span> <span class='id identifier rubyid_h'>h</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>key_name</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='id identifier rubyid_key'>key</span> <span class='op'>&&</span> <span class='id identifier rubyid_h'>h</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='op'>==</span> <span class='id identifier rubyid_user'>user</span> <span class='rbrace'>}</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="decode_from_uri-instance_method"> - (<tt>Object</tt>) <strong>decode_from_uri</strong>(*args) </h3><table class="source_code"> <tr> <td> <pre class="lines"> 87 88 89 90 91</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/git_fusion/util.rb', line 87</span> <span class='kw'>def</span> <span class='id identifier rubyid_decode_from_uri'>decode_from_uri</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span> <span class='id identifier rubyid_args'>args</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_a'>a</span><span class='op'>|</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_a'>a</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='comma'>,</span> <span class='const'>GitFusionStrings</span><span class='op'>::</span><span class='const'>URI_RESERVED_CHARACTERS</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="encode_to_gf_format-instance_method"> - (<tt>Object</tt>) <strong>encode_to_gf_format</strong>(*args) </h3><table class="source_code"> <tr> <td> <pre class="lines"> 93 94 95 96 97</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/git_fusion/util.rb', line 93</span> <span class='kw'>def</span> <span class='id identifier rubyid_encode_to_gf_format'>encode_to_gf_format</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span> <span class='id identifier rubyid_args'>args</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_a'>a</span><span class='op'>|</span> <span class='const'>GitFusionStrings</span><span class='period'>.</span><span class='id identifier rubyid_encode'>encode</span><span class='lparen'>(</span><span class='id identifier rubyid_a'>a</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="error_and_clean_up-instance_method"> - (<tt>Object</tt>) <strong>error_and_clean_up</strong>(error) </h3><table class="source_code"> <tr> <td> <pre class="lines"> 72 73 74</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/git_fusion/util.rb', line 72</span> <span class='kw'>def</span> <span class='id identifier rubyid_error_and_clean_up'>error_and_clean_up</span><span class='lparen'>(</span><span class='id identifier rubyid_error'>error</span><span class='rparen'>)</span> <span class='id identifier rubyid_halt'>halt</span> <span class='int'>400</span><span class='comma'>,</span> <span class='id identifier rubyid_to_message'>to_message</span><span class='lparen'>(</span><span class='id identifier rubyid_error'>error</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_json'>to_json</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="get_by_key-instance_method"> - (<tt>Object</tt>) <strong>get_by_key</strong>(key, value) </h3><table class="source_code"> <tr> <td> <pre class="lines"> 55 56 57 58</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/git_fusion/util.rb', line 55</span> <span class='kw'>def</span> <span class='id identifier rubyid_get_by_key'>get_by_key</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span> <span class='id identifier rubyid_val'>val</span> <span class='op'>=</span> <span class='id identifier rubyid_all_keys'>all_keys</span><span class='period'>.</span><span class='id identifier rubyid_select'>select</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_record'>record</span><span class='op'>|</span> <span class='id identifier rubyid_record'>record</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>key</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='id identifier rubyid_key'>key</span> <span class='rbrace'>}</span> <span class='id identifier rubyid_val'>val</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span> <span class='op'>:</span> <span class='id identifier rubyid_val'>val</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='lbracket'>[</span><span class='id identifier rubyid_value'>value</span><span class='rbracket'>]</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="keys_for_user-instance_method"> - (<tt>Object</tt>) <strong>keys_for_user</strong>(user) </h3><table class="source_code"> <tr> <td> <pre class="lines"> 40 41 42 43</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/git_fusion/util.rb', line 40</span> <span class='kw'>def</span> <span class='id identifier rubyid_keys_for_user'>keys_for_user</span><span class='lparen'>(</span><span class='id identifier rubyid_user'>user</span><span class='rparen'>)</span> <span class='id identifier rubyid_keys'>keys</span> <span class='op'>=</span> <span class='id identifier rubyid_all_keys'>all_keys</span><span class='period'>.</span><span class='id identifier rubyid_select'>select</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='op'>|</span> <span class='id identifier rubyid_key'>key</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='op'>==</span> <span class='id identifier rubyid_user'>user</span> <span class='rbrace'>}</span> <span class='id identifier rubyid_keys'>keys</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="print_result-instance_method"> - (<tt>Object</tt>) <strong>print_result</strong>(file_location, p4: nil) </h3><table class="source_code"> <tr> <td> <pre class="lines"> 76 77 78 79 80 81 82 83 84 85</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/git_fusion/util.rb', line 76</span> <span class='kw'>def</span> <span class='id identifier rubyid_print_result'>print_result</span><span class='lparen'>(</span><span class='id identifier rubyid_file_location'>file_location</span><span class='comma'>,</span> <span class='label'>p4:</span> <span class='kw'>nil</span><span class='rparen'>)</span> <span class='id identifier rubyid_p4'>p4</span> <span class='op'>=</span> <span class='id identifier rubyid_temp_client'>temp_client</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span> <span class='kw'>unless</span> <span class='id identifier rubyid_p4'>p4</span> <span class='id identifier rubyid_file_result'>file_result</span> <span class='op'>=</span> <span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_run_print'>run_print</span><span class='lparen'>(</span><span class='id identifier rubyid_file_location'>file_location</span><span class='rparen'>)</span> <span class='id identifier rubyid_content'>content</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='period'>.</span><span class='id identifier rubyid_b'>b</span> <span class='id identifier rubyid_file_result'>file_result</span><span class='period'>.</span><span class='id identifier rubyid_drop'>drop</span><span class='lparen'>(</span><span class='int'>1</span><span class='rparen'>)</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_content'>content</span> <span class='op'><<</span> <span class='id identifier rubyid_result'>result</span> <span class='kw'>if</span> <span class='id identifier rubyid_result'>result</span> <span class='kw'>end</span> <span class='id identifier rubyid_content'>content</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="submit_file-instance_method"> - (<tt>Object</tt>) <strong>submit_file</strong>(p4, file_path, file_content, description) </h3><table class="source_code"> <tr> <td> <pre class="lines"> 99 100 101 102 103 104 105 106 107 108 109 110 111 112</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/git_fusion/util.rb', line 99</span> <span class='kw'>def</span> <span class='id identifier rubyid_submit_file'>submit_file</span><span class='lparen'>(</span><span class='id identifier rubyid_p4'>p4</span><span class='comma'>,</span> <span class='id identifier rubyid_file_path'>file_path</span><span class='comma'>,</span> <span class='id identifier rubyid_file_content'>file_content</span><span class='comma'>,</span> <span class='id identifier rubyid_description'>description</span><span class='rparen'>)</span> <span class='id identifier rubyid_files'>files</span> <span class='op'>=</span> <span class='lbracket'>[</span> <span class='const'>ChangeService</span><span class='op'>::</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>depot_file:</span> <span class='id identifier rubyid_file_path'>file_path</span><span class='comma'>,</span> <span class='label'>action:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>upload</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>content:</span> <span class='id identifier rubyid_file_content'>file_content</span><span class='rparen'>)</span> <span class='rbracket'>]</span> <span class='id identifier rubyid_change_service'>change_service</span> <span class='op'>=</span> <span class='const'>ChangeService</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>p4:</span> <span class='id identifier rubyid_p4'>p4</span><span class='comma'>,</span> <span class='label'>client_root:</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_root</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='label'>client_name:</span> <span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_client'>client</span><span class='rparen'>)</span> <span class='id identifier rubyid_change_service'>change_service</span><span class='period'>.</span><span class='id identifier rubyid_submit'>submit</span><span class='lparen'>(</span><span class='label'>files:</span> <span class='id identifier rubyid_files'>files</span><span class='comma'>,</span> <span class='label'>description:</span> <span class='id identifier rubyid_description'>description</span><span class='rparen'>)</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="temp_client-instance_method"> - (<tt>Object</tt>) <strong>temp_client</strong> </h3><table class="source_code"> <tr> <td> <pre class="lines"> 21 22 23 24 25</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/git_fusion/util.rb', line 21</span> <span class='kw'>def</span> <span class='id identifier rubyid_temp_client'>temp_client</span> <span class='id identifier rubyid_require_p4_with_temp_client'>require_p4_with_temp_client</span> <span class='lbracket'>[</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='comma'>,</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='rbracket'>]</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="to_message-instance_method"> - (<tt>Object</tt>) <strong>to_message</strong>(message) </h3><table class="source_code"> <tr> <td> <pre class="lines"> 64 65 66 67 68 69 70</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/git_fusion/util.rb', line 64</span> <span class='kw'>def</span> <span class='id identifier rubyid_to_message'>to_message</span><span class='lparen'>(</span><span class='id identifier rubyid_message'>message</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='label'>MessageCode:</span> <span class='int'>0</span><span class='comma'>,</span> <span class='label'>MessageSeverity:</span> <span class='int'>3</span><span class='comma'>,</span> <span class='label'>MessageText:</span> <span class='id identifier rubyid_message'>message</span> <span class='rbrace'>}</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>
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#6 | 16275 | Doug Scheirer | Merge from main | ||
#5 | 16196 | Doug Scheirer | Merge from main | ||
#4 | 16148 | Doug Scheirer | Merge from main | ||
#3 | 16114 | Doug Scheirer | Merge from main | ||
#2 | 16079 | Doug Scheirer | Merge from main | ||
#1 | 16014 | Doug Scheirer | Merge down from main | ||
//guest/perforce_software/helix-web-services/main/build/doc/helix_web_services/GitFusion/Util.html | |||||
#3 | 16007 | tjuricek |
HWS/NOARCH/2015.1.main/201510011648 Documentation updates for the new default parameter to getting the latest helix sync client |
||
#2 | 15994 | tjuricek | HWS/NOARCH/2015.1.main/201509302210 | ||
#1 | 15975 | tjuricek |
HWS/NOARCH/2015.1.main/201509291925 Add support for repo creation/update and deletion, same for SSH keys. Add util module for supporting methods, modify temp client to dissapear. (Modified submit of review 15549 by @ptomiak) |