<!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::ChangeService::File — 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/ChangeService/File.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 (F)</a> » <span class='title'><span class='object_link'><a href="../../HelixVersioningEngine.html" title="HelixVersioningEngine (module)">HelixVersioningEngine</a></span></span> » <span class='title'><span class='object_link'><a href="../ChangeService.html" title="HelixVersioningEngine::ChangeService (class)">ChangeService</a></span></span> » <span class="title">File</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::ChangeService::File </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::ChangeService::File</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/change_service.rb</dd> </dl> <div class="clear"></div> <h2>Overview</h2><div class="docstring"> <div class="discussion"> <p>Handles tracking 'file modification' operations on a single file for a change.</p> <p>One important aspect of initializing these files is assigning a 'files' result. The ChangeHelper pretty much grabs the output of 'p4 files' for all file changes, which lets us know if a file exists or not in the system, which changes downstream behavior during an upload process.</p> </div> </div> <div class="tags"> </div> <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="#action-instance_method" title="#action (instance method)">- (Object) <strong>action</strong> </a> </span> <span class="summary_desc"><div class='inline'> <p>Returns the value of attribute action.</p> </div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#content-instance_method" title="#content (instance method)">- (Object) <strong>content</strong> </a> </span> <span class="summary_desc"><div class='inline'> <p>Returns the value of attribute content.</p> </div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#depot_file-instance_method" title="#depot_file (instance method)">- (Object) <strong>depot_file</strong> </a> </span> <span class="summary_desc"><div class='inline'> <p>Returns the value of attribute depot_file.</p> </div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#file_result-instance_method" title="#file_result (instance method)">- (Object) <strong>file_result</strong> </a> </span> <span class="summary_desc"><div class='inline'> <p>The output of p4 files on this depot_file path, if it exists.</p> </div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#from_depot_file-instance_method" title="#from_depot_file (instance method)">- (Object) <strong>from_depot_file</strong> </a> </span> <span class="summary_desc"><div class='inline'> <p>For <em>some</em> actions, like a move, we need this indicated by the user.</p> </div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#require_version-instance_method" title="#require_version (instance method)">- (Object) <strong>require_version</strong> </a> </span> <span class="summary_desc"><div class='inline'> <p>If set, this should be the version number we require before running.</p> </div></span> </li> </ul> <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="#from_json-class_method" title="from_json (class method)">+ (Object) <strong>from_json</strong>(obj) </a> </span> <span class="summary_desc"><div class='inline'> <p>The “external” JSON representation uses a CamelCase style string.</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="#call-instance_method" title="#call (instance method)">- (Object) <strong>call</strong>(p4, change_id, client_root) </a> </span> <span class="summary_desc"><div class='inline'> <p>This really should only be called by ChangeHelper::call to do work once we have associated any file_result and from_file properties.</p> </div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#exists%3F-instance_method" title="#exists? (instance method)">- (Boolean) <strong>exists?</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)">- (File) <strong>initialize</strong>(depot_file: nil, action: nil, content: nil, from_depot_file: nil, require_version: nil) </a> </span> <span class="note title constructor">constructor</span> <span class="summary_desc"><div class='inline'> <p>Notice how the file <em>must</em> be specified using our 'external normalized' data style.</p> </div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#integrate_file-instance_method" title="#integrate_file (instance method)">- (Object) <strong>integrate_file</strong>(p4, change_id) </a> </span> <span class="summary_desc"><div class='inline'></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#move_file-instance_method" title="#move_file (instance method)">- (Object) <strong>move_file</strong>(p4, change_id) </a> </span> <span class="summary_desc"><div class='inline'></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#upload_file-instance_method" title="#upload_file (instance method)">- (Object) <strong>upload_file</strong>(p4, change_id, client_root) </a> </span> <span class="summary_desc"><div class='inline'></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::ChangeService::File (class)">File</a></span></tt>) <strong>initialize</strong>(depot_file: nil, action: nil, content: nil, from_depot_file: nil, require_version: nil) </h3><div class="docstring"> <div class="discussion"> <p>Notice how the file <em>must</em> be specified using our 'external normalized' data style.</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 78 79 80 81 82 83 84 85 86 87</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/change_service.rb', line 78</span> <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='label'>depot_file:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>action:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>content:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>from_depot_file:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>require_version:</span> <span class='kw'>nil</span><span class='rparen'>)</span> <span class='ivar'>@depot_file</span> <span class='op'>=</span> <span class='id identifier rubyid_depot_file'>depot_file</span> <span class='ivar'>@action</span> <span class='op'>=</span> <span class='id identifier rubyid_action'>action</span> <span class='ivar'>@content</span> <span class='op'>=</span> <span class='id identifier rubyid_content'>content</span> <span class='ivar'>@from_depot_file</span> <span class='op'>=</span> <span class='id identifier rubyid_from_depot_file'>from_depot_file</span> <span class='ivar'>@require_version</span> <span class='op'>=</span> <span class='id identifier rubyid_require_version'>require_version</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="action=-instance_method"></span> <div class="method_details first"> <h3 class="signature first" id="action-instance_method"> - (<tt>Object</tt>) <strong>action</strong> </h3><div class="docstring"> <div class="discussion"> <p>Returns the value of attribute action</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 61 62 63</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/change_service.rb', line 61</span> <span class='kw'>def</span> <span class='id identifier rubyid_action'>action</span> <span class='ivar'>@action</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <span id="content=-instance_method"></span> <div class="method_details "> <h3 class="signature " id="content-instance_method"> - (<tt>Object</tt>) <strong>content</strong> </h3><div class="docstring"> <div class="discussion"> <p>Returns the value of attribute content</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 63 64 65</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/change_service.rb', line 63</span> <span class='kw'>def</span> <span class='id identifier rubyid_content'>content</span> <span class='ivar'>@content</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <span id="depot_file=-instance_method"></span> <div class="method_details "> <h3 class="signature " id="depot_file-instance_method"> - (<tt>Object</tt>) <strong>depot_file</strong> </h3><div class="docstring"> <div class="discussion"> <p>Returns the value of attribute depot_file</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 59 60 61</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/change_service.rb', line 59</span> <span class='kw'>def</span> <span class='id identifier rubyid_depot_file'>depot_file</span> <span class='ivar'>@depot_file</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <span id="file_result=-instance_method"></span> <div class="method_details "> <h3 class="signature " id="file_result-instance_method"> - (<tt>Object</tt>) <strong>file_result</strong> </h3><div class="docstring"> <div class="discussion"> <p>The output of p4 files on this depot_file path, if it exists.</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 69 70 71</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/change_service.rb', line 69</span> <span class='kw'>def</span> <span class='id identifier rubyid_file_result'>file_result</span> <span class='ivar'>@file_result</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <span id="from_depot_file=-instance_method"></span> <div class="method_details "> <h3 class="signature " id="from_depot_file-instance_method"> - (<tt>Object</tt>) <strong>from_depot_file</strong> </h3><div class="docstring"> <div class="discussion"> <p>For <em>some</em> actions, like a move, we need this indicated by the user.</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 66 67 68</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/change_service.rb', line 66</span> <span class='kw'>def</span> <span class='id identifier rubyid_from_depot_file'>from_depot_file</span> <span class='ivar'>@from_depot_file</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <span id="require_version=-instance_method"></span> <div class="method_details "> <h3 class="signature " id="require_version-instance_method"> - (<tt>Object</tt>) <strong>require_version</strong> </h3><div class="docstring"> <div class="discussion"> <p>If set, this should be the version number we require before running. If you want to require a new file, this should be set to 0. Otherwise specify the version directly.</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 74 75 76</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/change_service.rb', line 74</span> <span class='kw'>def</span> <span class='id identifier rubyid_require_version'>require_version</span> <span class='ivar'>@require_version</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> </div> <div id="class_method_details" class="method_details_list"> <h2>Class Method Details</h2> <div class="method_details first"> <h3 class="signature first" id="from_json-class_method"> + (<tt>Object</tt>) <strong>from_json</strong>(obj) </h3><div class="docstring"> <div class="discussion"> <p>The “external” JSON representation uses a CamelCase style string.</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 90 91 92 93 94 95 96 97 98 99 100 101 102</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/change_service.rb', line 90</span> <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_from_json'>from_json</span><span class='lparen'>(</span><span class='id identifier rubyid_obj'>obj</span><span class='rparen'>)</span> <span class='id identifier rubyid_args'>args</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span> <span class='id identifier rubyid_args'>args</span><span class='lbracket'>[</span><span class='symbol'>:depot_file</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_obj'>obj</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='kw'>if</span> <span class='id identifier rubyid_obj'>obj</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>DepotFile</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='id identifier rubyid_args'>args</span><span class='lbracket'>[</span><span class='symbol'>:action</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_obj'>obj</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Action</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='kw'>if</span> <span class='id identifier rubyid_obj'>obj</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Action</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='id identifier rubyid_args'>args</span><span class='lbracket'>[</span><span class='symbol'>:from_depot_file</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_obj'>obj</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>FromDepotFile</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='kw'>if</span> <span class='id identifier rubyid_obj'>obj</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>FromDepotFile</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='id identifier rubyid_args'>args</span><span class='lbracket'>[</span><span class='symbol'>:require_version</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_obj'>obj</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>RequireVersion</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='kw'>if</span> <span class='id identifier rubyid_obj'>obj</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>RequireVersion</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='id identifier rubyid_content_base64'>content_base64</span> <span class='op'>=</span> <span class='id identifier rubyid_obj'>obj</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Content</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='kw'>if</span> <span class='id identifier rubyid_obj'>obj</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Content</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='id identifier rubyid_args'>args</span><span class='lbracket'>[</span><span class='symbol'>:content</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'>Base64</span><span class='period'>.</span><span class='id identifier rubyid_decode64'>decode64</span><span class='lparen'>(</span><span class='id identifier rubyid_content_base64'>content_base64</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_content_base64'>content_base64</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</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="call-instance_method"> - (<tt>Object</tt>) <strong>call</strong>(p4, change_id, client_root) </h3><div class="docstring"> <div class="discussion"> <p>This really should only be called by ChangeHelper::call to do work once we have associated any file_result and from_file properties.</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 111 112 113 114 115 116 117 118 119 120</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/change_service.rb', line 111</span> <span class='kw'>def</span> <span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_p4'>p4</span><span class='comma'>,</span> <span class='id identifier rubyid_change_id'>change_id</span><span class='comma'>,</span> <span class='id identifier rubyid_client_root'>client_root</span><span class='rparen'>)</span> <span class='kw'>case</span> <span class='id identifier rubyid_action'>action</span> <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>upload</span><span class='tstring_end'>'</span></span> <span class='id identifier rubyid_upload_file'>upload_file</span><span class='lparen'>(</span><span class='id identifier rubyid_p4'>p4</span><span class='comma'>,</span> <span class='id identifier rubyid_change_id'>change_id</span><span class='comma'>,</span> <span class='id identifier rubyid_client_root'>client_root</span><span class='rparen'>)</span> <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>branch</span><span class='tstring_end'>'</span></span> <span class='id identifier rubyid_integrate_file'>integrate_file</span><span class='lparen'>(</span><span class='id identifier rubyid_p4'>p4</span><span class='comma'>,</span> <span class='id identifier rubyid_change_id'>change_id</span><span class='rparen'>)</span> <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>move</span><span class='tstring_end'>'</span></span> <span class='id identifier rubyid_move_file'>move_file</span><span class='lparen'>(</span><span class='id identifier rubyid_p4'>p4</span><span class='comma'>,</span> <span class='id identifier rubyid_change_id'>change_id</span><span class='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="exists?-instance_method"> - (<tt>Boolean</tt>) <strong>exists?</strong> </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"> 104 105 106</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/change_service.rb', line 104</span> <span class='kw'>def</span> <span class='id identifier rubyid_exists?'>exists?</span> <span class='op'>!</span><span class='id identifier rubyid_file_result'>file_result</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>&&</span> <span class='id identifier rubyid_file_result'>file_result</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>action</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>!=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>delete</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="integrate_file-instance_method"> - (<tt>Object</tt>) <strong>integrate_file</strong>(p4, change_id) </h3><table class="source_code"> <tr> <td> <pre class="lines"> 151 152 153</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/change_service.rb', line 151</span> <span class='kw'>def</span> <span class='id identifier rubyid_integrate_file'>integrate_file</span><span class='lparen'>(</span><span class='id identifier rubyid_p4'>p4</span><span class='comma'>,</span> <span class='id identifier rubyid_change_id'>change_id</span><span class='rparen'>)</span> <span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_run_integrate'>run_integrate</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-c</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_change_id'>change_id</span><span class='comma'>,</span> <span class='id identifier rubyid_from_depot_file'>from_depot_file</span><span class='comma'>,</span> <span class='id identifier rubyid_depot_file'>depot_file</span><span class='rparen'>)</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="move_file-instance_method"> - (<tt>Object</tt>) <strong>move_file</strong>(p4, change_id) </h3><table class="source_code"> <tr> <td> <pre class="lines"> 155 156 157</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/change_service.rb', line 155</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_file'>move_file</span><span class='lparen'>(</span><span class='id identifier rubyid_p4'>p4</span><span class='comma'>,</span> <span class='id identifier rubyid_change_id'>change_id</span><span class='rparen'>)</span> <span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_run_move'>run_move</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-c</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_change_id'>change_id</span><span class='comma'>,</span> <span class='id identifier rubyid_from_depot_file'>from_depot_file</span><span class='comma'>,</span> <span class='id identifier rubyid_depot_file'>depot_file</span><span class='rparen'>)</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="upload_file-instance_method"> - (<tt>Object</tt>) <strong>upload_file</strong>(p4, change_id, client_root) </h3><table class="source_code"> <tr> <td> <pre class="lines"> 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/helix_versioning_engine/change_service.rb', line 122</span> <span class='kw'>def</span> <span class='id identifier rubyid_upload_file'>upload_file</span><span class='lparen'>(</span><span class='id identifier rubyid_p4'>p4</span><span class='comma'>,</span> <span class='id identifier rubyid_change_id'>change_id</span><span class='comma'>,</span> <span class='id identifier rubyid_client_root'>client_root</span><span class='rparen'>)</span> <span class='const'>Util</span><span class='period'>.</span><span class='id identifier rubyid_assert_no_special_paths'>assert_no_special_paths</span><span class='lparen'>(</span><span class='ivar'>@depot_file</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</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='rparen'>)</span> <span class='kw'>if</span> <span class='op'>!</span><span class='id identifier rubyid_require_version'>require_version</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='kw'>if</span> <span class='id identifier rubyid_require_version'>require_version</span> <span class='op'>==</span> <span class='int'>0</span> <span class='op'>&&</span> <span class='id identifier rubyid_exists?'>exists?</span> <span class='id identifier rubyid_msg'>msg</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>assertion failed: file </span><span class='embexpr_beg'>#{</span><span class='ivar'>@depot_file</span><span class='embexpr_end'>}</span><span class='tstring_content'> exists</span><span class='tstring_end'>"</span></span> <span class='id identifier rubyid_raise'>raise</span> <span class='const'>P4Error</span><span class='period'>.</span><span class='id identifier rubyid_default_error'>default_error</span><span class='lparen'>(</span><span class='id identifier rubyid_msg'>msg</span><span class='rparen'>)</span> <span class='kw'>end</span> <span class='id identifier rubyid_cur_version'>cur_version</span> <span class='op'>=</span> <span class='int'>0</span> <span class='id identifier rubyid_cur_version'>cur_version</span> <span class='op'>=</span> <span class='id identifier rubyid_file_result'>file_result</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>rev</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span> <span class='kw'>if</span> <span class='id identifier rubyid_exists?'>exists?</span> <span class='kw'>if</span> <span class='id identifier rubyid_cur_version'>cur_version</span> <span class='op'>!=</span> <span class='id identifier rubyid_require_version'>require_version</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span> <span class='id identifier rubyid_msg'>msg</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>assertion failed: file </span><span class='embexpr_beg'>#{</span><span class='ivar'>@depot_file</span><span class='embexpr_end'>}</span><span class='tstring_content'> not at required </span><span class='tstring_end'>"</span></span> \ <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>version </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_require_version'>require_version</span><span class='embexpr_end'>}</span><span class='tstring_content'>, </span><span class='tstring_end'>"</span></span> \ <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>current version is </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_cur_version'>cur_version</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span> <span class='id identifier rubyid_raise'>raise</span> <span class='const'>P4Error</span><span class='period'>.</span><span class='id identifier rubyid_default_error'>default_error</span><span class='lparen'>(</span><span class='id identifier rubyid_msg'>msg</span><span class='rparen'>)</span> <span class='kw'>end</span> <span class='kw'>end</span> <span class='kw'>if</span> <span class='id identifier rubyid_exists?'>exists?</span> <span class='id identifier rubyid_p4'>p4</span><span class='period'>.</span><span class='id identifier rubyid_run_sync'>run_sync</span><span class='lparen'>(</span><span class='id identifier rubyid_depot_file'>depot_file</span><span class='rparen'>)</span> <span class='const'>Util</span><span class='period'>.</span><span class='id identifier rubyid_mark_change'>mark_change</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>edit</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_p4'>p4</span><span class='comma'>,</span> <span class='id identifier rubyid_change_id'>change_id</span><span class='comma'>,</span> <span class='id identifier rubyid_client_root'>client_root</span><span class='comma'>,</span> <span class='id identifier rubyid_depot_file'>depot_file</span><span class='rparen'>)</span> <span class='const'>Util</span><span class='period'>.</span><span class='id identifier rubyid_save_content'>save_content</span><span class='lparen'>(</span><span class='id identifier rubyid_client_root'>client_root</span><span class='comma'>,</span> <span class='id identifier rubyid_depot_file'>depot_file</span><span class='comma'>,</span> <span class='id identifier rubyid_content'>content</span><span class='rparen'>)</span> <span class='kw'>else</span> <span class='const'>Util</span><span class='period'>.</span><span class='id identifier rubyid_save_content'>save_content</span><span class='lparen'>(</span><span class='id identifier rubyid_client_root'>client_root</span><span class='comma'>,</span> <span class='id identifier rubyid_depot_file'>depot_file</span><span class='comma'>,</span> <span class='id identifier rubyid_content'>content</span><span class='rparen'>)</span> <span class='const'>Util</span><span class='period'>.</span><span class='id identifier rubyid_mark_change'>mark_change</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>add</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_p4'>p4</span><span class='comma'>,</span> <span class='id identifier rubyid_change_id'>change_id</span><span class='comma'>,</span> <span class='id identifier rubyid_client_root'>client_root</span><span class='comma'>,</span> <span class='id identifier rubyid_depot_file'>depot_file</span><span class='rparen'>)</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:30 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>