examples/api-samples/public/docs/sample30.html in groupdocs-1.5.8 vs examples/api-samples/public/docs/sample30.html in groupdocs-1.5.9
- old
+ new
@@ -77,27 +77,46 @@
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-4">¶</a>
</div>
- <p>check required variables</p>
+ <p>Check required variables</p>
</div>
- <div class="content"><div class='highlight'><pre> raise <span class="string">'Please enter all required parameters'</span> <span class="keyword">if</span> settings.client_id.empty? <span class="keyword">or</span> settings.private_key.empty? <span class="keyword">or</span> settings.name.empty?
-
- <span class="keyword">if</span> settings.base_path.empty? <span class="keyword">then</span> settings.base_path = <span class="string">'https://api.groupdocs.com'</span> <span class="keyword">end</span></pre></div></div>
+ <div class="content"><div class='highlight'><pre> raise <span class="string">'Please enter all required parameters'</span> <span class="keyword">if</span> settings.client_id.empty? <span class="keyword">or</span> settings.private_key.empty? <span class="keyword">or</span> settings.name.empty?</pre></div></div>
</li>
<li id="section-5">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-5">¶</a>
</div>
+ <p>Prepare base path</p>
+
+ </div>
+
+ <div class="content"><div class='highlight'><pre> <span class="keyword">if</span> settings.base_path.empty?
+ base_path = <span class="string">'https://api.groupdocs.com'</span>
+ <span class="keyword">elsif</span> settings.base_path.match(<span class="string">'/v2.0'</span>)
+ base_path = settings.base_path.split(<span class="string">'/v2.0'</span>)[<span class="number">0</span>]
+ <span class="keyword">else</span>
+ base_path = settings.base_path
+ <span class="keyword">end</span></pre></div></div>
+
+ </li>
+
+
+ <li id="section-6">
+ <div class="annotation">
+
+ <div class="pilwrap ">
+ <a class="pilcrow" href="#section-6">¶</a>
+ </div>
<p>Configure your access to API server</p>
</div>
<div class="content"><div class='highlight'><pre> <span class="constant">GroupDocs</span>.configure <span class="keyword">do</span> |groupdocs|
@@ -105,31 +124,31 @@
groupdocs.private_key = settings.private_key</pre></div></div>
</li>
- <li id="section-6">
+ <li id="section-7">
<div class="annotation">
<div class="pilwrap ">
- <a class="pilcrow" href="#section-6">¶</a>
+ <a class="pilcrow" href="#section-7">¶</a>
</div>
<p>Optionally specify API server and version</p>
</div>
- <div class="content"><div class='highlight'><pre> groupdocs.api_server = settings.base_path <span class="comment"># default is 'https://api.groupdocs.com'</span>
+ <div class="content"><div class='highlight'><pre> groupdocs.api_server = base_path <span class="comment"># default is 'https://api.groupdocs.com'</span>
<span class="keyword">end</span></pre></div></div>
</li>
- <li id="section-7">
+ <li id="section-8">
<div class="annotation">
<div class="pilwrap ">
- <a class="pilcrow" href="#section-7">¶</a>
+ <a class="pilcrow" href="#section-8">¶</a>
</div>
<p>Make a request to API using client_id and private_key</p>
</div>
@@ -137,15 +156,15 @@
document = <span class="string">''</span></pre></div></div>
</li>
- <li id="section-8">
+ <li id="section-9">
<div class="annotation">
<div class="pilwrap ">
- <a class="pilcrow" href="#section-8">¶</a>
+ <a class="pilcrow" href="#section-9">¶</a>
</div>
<p>Get document by file ID</p>
</div>
@@ -156,15 +175,15 @@
<span class="keyword">end</span></pre></div></div>
</li>
- <li id="section-9">
+ <li id="section-10">
<div class="annotation">
<div class="pilwrap ">
- <a class="pilcrow" href="#section-9">¶</a>
+ <a class="pilcrow" href="#section-10">¶</a>
</div>
<p>Delete file from GroupDocs Storage</p>
</div>
@@ -177,14 +196,14 @@
<span class="keyword">end</span></pre></div></div>
</li>
- <li id="section-10">
+ <li id="section-11">
<div class="annotation">
<div class="pilwrap ">
- <a class="pilcrow" href="#section-10">¶</a>
+ <a class="pilcrow" href="#section-11">¶</a>
</div>
<p>Set variables for template</p>
</div>