examples/api-samples/public/docs/sample07.html in groupdocs-1.5.8 vs examples/api-samples/public/docs/sample07.html in groupdocs-1.5.9

- old
+ new

@@ -80,23 +80,42 @@ </div> <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">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?</pre></div></div> </li> <li id="section-5"> <div class="annotation"> <div class="pilwrap "> <a class="pilcrow" href="#section-5">&#182;</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">&#182;</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| @@ -104,46 +123,46 @@ 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">&#182;</a> + <a class="pilcrow" href="#section-7">&#182;</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">&#182;</a> + <a class="pilcrow" href="#section-8">&#182;</a> </div> <p>Make a request to API using client_id and private_key</p> </div> <div class="content"><div class='highlight'><pre> files_list = <span class="constant">GroupDocs::Storage::Folder</span>.list!(<span class="string">'/'</span>, {<span class="symbol">:extended</span> =&gt; <span class="keyword">true</span>}, {<span class="symbol">:client_id</span> =&gt; settings.client_id, <span class="symbol">:private_key</span> =&gt; settings.private_key})</pre></div></div> </li> - <li id="section-8"> + <li id="section-9"> <div class="annotation"> <div class="pilwrap "> - <a class="pilcrow" href="#section-8">&#182;</a> + <a class="pilcrow" href="#section-9">&#182;</a> </div> <p>Construct result string</p> </div> @@ -152,11 +171,11 @@ <span class="keyword">if</span> element.<span class="keyword">class</span>.name.split(<span class="string">'::'</span>).last == <span class="string">'Folder'</span> <span class="keyword">next</span> <span class="keyword">end</span> <span class="keyword">if</span> element.thumbnail name = element.name - thumbnails += <span class="string">"&lt;p&gt;&lt;img src='data:image/png;base64,<span class="subst">#{element.thumbnail}</span>', width='40px', height='40px'&gt; <span class="subst">#{name}</span>&lt;/p&gt;"</span> + thumbnails += <span class="string">"&lt;img src='data:image/png;base64,<span class="subst">#{element.thumbnail}</span>', width='40px', height='40px'&gt; <span class="subst">#{name}</span>"</span> <span class="keyword">end</span> <span class="keyword">end</span> <span class="keyword">unless</span> thumbnails.empty? set <span class="symbol">:thumbnails</span>, thumbnails @@ -167,14 +186,14 @@ <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">&#182;</a> + <a class="pilcrow" href="#section-10">&#182;</a> </div> <p>Set variables for template</p> </div>