]> git.r.bdr.sh - rbdr/lyricli.rb/commitdiff
Adds some documentation
authorBen Beltran <redacted>
Sat, 6 Oct 2012 07:19:26 +0000 (02:19 -0500)
committerBen Beltran <redacted>
Sat, 6 Oct 2012 07:19:26 +0000 (02:19 -0500)
25 files changed:
.yardoc/checksums
.yardoc/object_types
.yardoc/objects/root.dat
.yardoc/proxy_types
doc/Lyricli.html
doc/Lyricli/Configuration.html
doc/Lyricli/Lyricli.html
doc/Lyricli/LyricsEngine.html
doc/Lyricli/SourceManager.html
doc/Lyricli/Sources.html
doc/Lyricli/Sources/Arguments.html
doc/Lyricli/Sources/Rdio.html
doc/Lyricli/Util.html
doc/_index.html
doc/class_list.html
doc/file_list.html
doc/frames.html
doc/index.html
doc/js/app.js
doc/method_list.html
doc/top-level-namespace.html
lib/lyricli.rb
lib/lyricli/configuration.rb
lib/lyricli/lyricli.rb
lib/lyricli/util.rb

index 1167f83415efa93576f21cdd01f68eb50b3f3323..475fe5adc652dc98b5e48365c069fd40fd76187d 100644 (file)
@@ -1,9 +1,9 @@
-lib/lyricli.rb 086e293fec4488ede35adbb911723c47205cdd42
-lib/lyricli/util.rb 069f80245171b855a8df437f114e6fd14a750623
-lib/lyricli/sources/rdio.rb 1a689bcee864f3f558bb4d5ee29e6a4bdb449991
-lib/lyricli/lyrics_engine.rb aa9de79d61c208533999db8604123e31f6f99b70
-lib/lyricli/configuration.rb ceebe35a6098aa48fe1f3d788f40350fcc9bf3ed
-lib/lyricli/sources/itunes.rb da39a3ee5e6b4b0d3255bfef95601890afd80709
-lib/lyricli/source_manager.rb c3d4c5bb7fec881e4edbcef97d863f1f5974e183
+lib/lyricli.rb 51e33086d1cbac6ccd601dd481a3b455376efb46
+lib/lyricli/util.rb 26284bcf3521994d5f81c5f10a750dad8fda1593
+lib/lyricli/lyricli.rb 067ba6355bce4ce18cc5552580b91b4e266250a2
+lib/lyricli/sources/rdio.rb affae043fecd57d068a54a710718d19933d53b81
+lib/lyricli/lyrics_engine.rb be6feb81f3c3c040420d1fb33df4d1282a959d15
+lib/lyricli/configuration.rb eab80327c885fe827811de01de1e9e64c312b0c0
+lib/lyricli/sources/itunes.rb 8f0b1201051be95df66f8a94554e393681795eb7
+lib/lyricli/source_manager.rb fd571d1c1a169f86efed5c886b40f912fb5ad01f
 lib/lyricli/sources/arguments.rb de3b31f05d118cf00fccb41e47fd35979da9eb14
-lib/lyricli/lyricli.rb 8a5db180cd047b932626c7eea51a71715c689c1f
index 04c3b697f4ddd5aa9f3427214493723a8356ed09..dbe4c580b94dc9d9962fe3b1b63fb0ff608de2c4 100644 (file)
Binary files a/.yardoc/object_types and b/.yardoc/object_types differ
index 13c77bb1fd938239aaa7a989c0339ac541793233..9c9498085c28d7b9352faab9a87ddcfa7f0334b5 100644 (file)
Binary files a/.yardoc/objects/root.dat and b/.yardoc/objects/root.dat differ
index ac416fee963ef07fc622dd4117291e604c552b60..beefda1ae32c2cef8eb53a4f3c8407a532a22b51 100644 (file)
Binary files a/.yardoc/proxy_types and b/.yardoc/proxy_types differ
index 8c0685a78268bb613f3e13d1c1b47c4471932f49..8a09e7fc3178d8a66fff421e8021ccb799410310 100644 (file)
@@ -6,7 +6,7 @@
 <title>
   Module: Lyricli
   
-    &mdash; Documentation by YARD 0.8.1
+    &mdash; Documentation by YARD 0.8.2.1
   
 </title>
 
   
     <dt class="r1 last">Defined in:</dt>
     <dd class="r1 last">lib/lyricli.rb<span class="defines">,<br />
-  lib/lyricli/util.rb,<br /> lib/lyricli/sources/rdio.rb,<br /> lib/lyricli/lyrics_engine.rb,<br /> lib/lyricli/configuration.rb,<br /> lib/lyricli/source_manager.rb,<br /> lib/lyricli/sources/arguments.rb</span>
+  lib/lyricli/util.rb,<br /> lib/lyricli/lyricli.rb,<br /> lib/lyricli/sources/rdio.rb,<br /> lib/lyricli/lyrics_engine.rb,<br /> lib/lyricli/configuration.rb,<br /> lib/lyricli/sources/itunes.rb,<br /> lib/lyricli/source_manager.rb,<br /> lib/lyricli/sources/arguments.rb</span>
 </dd>
   
 </dl>
 <div class="clear"></div>
 
-<h2>Defined Under Namespace</h2>
+<h2>Overview</h2><div class="docstring">
+  <div class="discussion">
+    <p>
+The Lyricli module allows you to easily search for lyrics by looking for
+song and artist data from diverse sources.
+</p>
+
+
+  </div>
+</div>
+<div class="tags">
+  
+
+</div><h2>Defined Under Namespace</h2>
 <p class="children">
   
     
         <li class="public ">
   <span class="summary_signature">
     
-      <a href="#execute-class_method" title="execute (class method)">+ (Object) <strong>execute</strong> </a>
+      <a href="#disable-class_method" title="disable (class method)">+ (Object) <strong>disable</strong>(source_name) </a>
+    
+
+    
+  </span>
+  
+  
+  
+  
+  
+  
+  
+
+  
+    <span class="summary_desc"><div class='inline'><p>
+Disables a source via the Source Manager.
+</p>
+</div></span>
+  
+</li>
+
+      
+        <li class="public ">
+  <span class="summary_signature">
+    
+      <a href="#enable-class_method" title="enable (class method)">+ (Object) <strong>enable</strong>(source_name) </a>
+    
+
+    
+  </span>
+  
+  
+  
+  
+  
+  
+  
+
+  
+    <span class="summary_desc"><div class='inline'><p>
+Enables a source via the Source Manager.
+</p>
+</div></span>
+  
+</li>
+
+      
+        <li class="public ">
+  <span class="summary_signature">
+    
+      <a href="#lyrics-class_method" title="lyrics (class method)">+ (String) <strong>lyrics</strong> </a>
+    
+
+    
+  </span>
+  
+  
+  
+  
+  
+  
+  
+
+  
+    <span class="summary_desc"><div class='inline'><p>
+Creates a new Lyricli instance and returns lyrics by going through the
+sources.
+</p>
+</div></span>
+  
+</li>
+
+      
+        <li class="public ">
+  <span class="summary_signature">
+    
+      <a href="#reset-class_method" title="reset (class method)">+ (Object) <strong>reset</strong>(source_name) </a>
     
 
     
   
 
   
-    <span class="summary_desc"><div class='inline'></div></span>
+    <span class="summary_desc"><div class='inline'><p>
+Resets all configuration for a source via the Source Manager.
+</p>
+</div></span>
+  
+</li>
+
+      
+        <li class="public ">
+  <span class="summary_signature">
+    
+      <a href="#sources-class_method" title="sources (class method)">+ (String) <strong>sources</strong> </a>
+    
+
+    
+  </span>
+  
+  
+  
+  
+  
+  
+  
+
+  
+    <span class="summary_desc"><div class='inline'><p>
+Returns a list of the available sources to enable or disable.
+</p>
+</div></span>
+  
+</li>
+
+      
+        <li class="public ">
+  <span class="summary_signature">
+    
+      <a href="#version-class_method" title="version (class method)">+ (String) <strong>version</strong> </a>
+    
+
+    
+  </span>
+  
+  
+  
+  
+  
+  
+  
+
+  
+    <span class="summary_desc"><div class='inline'><p>
+Returns the version of the library.
+</p>
+</div></span>
   
 </li>
 
 
     
       <div class="method_details first">
-  <h3 class="signature first" id="execute-class_method">
+  <h3 class="signature first" id="disable-class_method">
   
-    + (<tt>Object</tt>) <strong>execute</strong> 
+    + (<tt>Object</tt>) <strong>disable</strong>(source_name) 
   
 
   
 
   
-</h3><table class="source_code">
+</h3><div class="docstring">
+  <div class="discussion">
+    <p>
+Disables a source via the Source Manager
+</p>
+
+
+  </div>
+</div>
+<div class="tags">
+  
+
+</div><table class="source_code">
+  <tr>
+    <td>
+      <pre class="lines">
+
+
+56
+57
+58
+59</pre>
+    </td>
+    <td>
+      <pre class="code"><span class="info file"># File 'lib/lyricli.rb', line 56</span>
+
+<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_disable'>disable</span><span class='lparen'>(</span><span class='id identifier rubyid_source_name'>source_name</span><span class='rparen'>)</span>
+  <span class='id identifier rubyid_source_manager'>source_manager</span> <span class='op'>=</span> <span class='const'>SourceManager</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
+  <span class='id identifier rubyid_source_manager'>source_manager</span><span class='period'>.</span><span class='id identifier rubyid_disable'>disable</span><span class='lparen'>(</span><span class='id identifier rubyid_source_name'>source_name</span><span class='rparen'>)</span>
+<span class='kw'>end</span></pre>
+    </td>
+  </tr>
+</table>
+</div>
+    
+      <div class="method_details ">
+  <h3 class="signature " id="enable-class_method">
+  
+    + (<tt>Object</tt>) <strong>enable</strong>(source_name) 
+  
+
+  
+
+  
+</h3><div class="docstring">
+  <div class="discussion">
+    <p>
+Enables a source via the Source Manager
+</p>
+
+
+  </div>
+</div>
+<div class="tags">
+  
+
+</div><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/lyricli.rb', line 50</span>
+
+<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_enable'>enable</span><span class='lparen'>(</span><span class='id identifier rubyid_source_name'>source_name</span><span class='rparen'>)</span>
+  <span class='id identifier rubyid_source_manager'>source_manager</span> <span class='op'>=</span> <span class='const'>SourceManager</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
+  <span class='id identifier rubyid_source_manager'>source_manager</span><span class='period'>.</span><span class='id identifier rubyid_enable'>enable</span><span class='lparen'>(</span><span class='id identifier rubyid_source_name'>source_name</span><span class='rparen'>)</span>
+<span class='kw'>end</span></pre>
+    </td>
+  </tr>
+</table>
+</div>
+    
+      <div class="method_details ">
+  <h3 class="signature " id="lyrics-class_method">
+  
+    + (<tt>String</tt>) <strong>lyrics</strong> 
+  
+
+  
+
+  
+</h3><div class="docstring">
+  <div class="discussion">
+    <p>
+Creates a new Lyricli instance and returns lyrics by going through the
+sources.
+</p>
+
+
+  </div>
+</div>
+<div class="tags">
+  
+<p class="tag_title">Returns:</p>
+<ul class="return">
+  
+    <li>
+      
+      
+        <span class='type'>(<tt>String</tt>)</span>
+      
+      
+      
+        &mdash;
+        <div class='inline'><p>
+the fetched lyrics
+</p>
+</div>
+      
+    </li>
+  
+</ul>
+
+</div><table class="source_code">
   <tr>
     <td>
       <pre class="lines">
 
 
-29
 30
 31
-32</pre>
+32
+33</pre>
     </td>
     <td>
-      <pre class="code"><span class="info file"># File 'lib/lyricli.rb', line 29</span>
+      <pre class="code"><span class="info file"># File 'lib/lyricli.rb', line 30</span>
 
-<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_execute'>execute</span>
+<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_lyrics'>lyrics</span>
   <span class='ivar'>@lyricli</span> <span class='op'>=</span> <span class='const'>Lyricli</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
   <span class='ivar'>@lyricli</span><span class='period'>.</span><span class='id identifier rubyid_get_lyrics'>get_lyrics</span>
 <span class='kw'>end</span></pre>
     </td>
   </tr>
 </table>
+</div>
+    
+      <div class="method_details ">
+  <h3 class="signature " id="reset-class_method">
+  
+    + (<tt>Object</tt>) <strong>reset</strong>(source_name) 
+  
+
+  
+
+  
+</h3><div class="docstring">
+  <div class="discussion">
+    <p>
+Resets all configuration for a source via the Source Manager
+</p>
+
+
+  </div>
+</div>
+<div class="tags">
+  
+
+</div><table class="source_code">
+  <tr>
+    <td>
+      <pre class="lines">
+
+
+62
+63
+64
+65</pre>
+    </td>
+    <td>
+      <pre class="code"><span class="info file"># File 'lib/lyricli.rb', line 62</span>
+
+<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_reset'>reset</span><span class='lparen'>(</span><span class='id identifier rubyid_source_name'>source_name</span><span class='rparen'>)</span>
+  <span class='id identifier rubyid_source_manager'>source_manager</span> <span class='op'>=</span> <span class='const'>SourceManager</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
+  <span class='id identifier rubyid_source_manager'>source_manager</span><span class='period'>.</span><span class='id identifier rubyid_reset'>reset</span><span class='lparen'>(</span><span class='id identifier rubyid_source_name'>source_name</span><span class='rparen'>)</span>
+<span class='kw'>end</span></pre>
+    </td>
+  </tr>
+</table>
+</div>
+    
+      <div class="method_details ">
+  <h3 class="signature " id="sources-class_method">
+  
+    + (<tt>String</tt>) <strong>sources</strong> 
+  
+
+  
+
+  
+</h3><div class="docstring">
+  <div class="discussion">
+    <p>
+Returns a list of the available sources to enable or disable
+</p>
+
+
+  </div>
+</div>
+<div class="tags">
+  
+<p class="tag_title">Returns:</p>
+<ul class="return">
+  
+    <li>
+      
+      
+        <span class='type'>(<tt>String</tt>)</span>
+      
+      
+      
+        &mdash;
+        <div class='inline'><p>
+the list of available sources. Enabled sources have a star appended.
+</p>
+</div>
+      
+    </li>
+  
+</ul>
+
+</div><table class="source_code">
+  <tr>
+    <td>
+      <pre class="lines">
+
+
+44
+45
+46
+47</pre>
+    </td>
+    <td>
+      <pre class="code"><span class="info file"># File 'lib/lyricli.rb', line 44</span>
+
+<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_sources'>sources</span>
+  <span class='id identifier rubyid_source_manager'>source_manager</span> <span class='op'>=</span> <span class='const'>SourceManager</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
+  <span class='id identifier rubyid_source_manager'>source_manager</span><span class='period'>.</span><span class='id identifier rubyid_available_sources'>available_sources</span><span class='lparen'>(</span><span class='kw'>true</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>, </span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
+<span class='kw'>end</span></pre>
+    </td>
+  </tr>
+</table>
+</div>
+    
+      <div class="method_details ">
+  <h3 class="signature " id="version-class_method">
+  
+    + (<tt>String</tt>) <strong>version</strong> 
+  
+
+  
+
+  
+</h3><div class="docstring">
+  <div class="discussion">
+    <p>
+Returns the version of the library
+</p>
+
+
+  </div>
+</div>
+<div class="tags">
+  
+<p class="tag_title">Returns:</p>
+<ul class="return">
+  
+    <li>
+      
+      
+        <span class='type'>(<tt>String</tt>)</span>
+      
+      
+      
+        &mdash;
+        <div class='inline'><p>
+the version
+</p>
+</div>
+      
+    </li>
+  
+</ul>
+
+</div><table class="source_code">
+  <tr>
+    <td>
+      <pre class="lines">
+
+
+37
+38
+39</pre>
+    </td>
+    <td>
+      <pre class="code"><span class="info file"># File 'lib/lyricli.rb', line 37</span>
+
+<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_version'>version</span>
+  <span class='const'>Gem</span><span class='period'>.</span><span class='id identifier rubyid_loaded_specs'>loaded_specs</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>lyricli</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_version'>version</span>
+<span class='kw'>end</span></pre>
+    </td>
+  </tr>
+</table>
 </div>
     
   </div>
 </div>
 
     <div id="footer">
-  Generated on Fri Oct  5 22:31:14 2012 by
+  Generated on Sat Oct  6 02:05:51 2012 by
   <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
-  0.8.1 (ruby-1.9.2).
+  0.8.2.1 (ruby-1.9.2).
 </div>
 
   </body>
index 7ca3571964ee2d762e74b5e256e57fde8fe03d11..77112a3280b9e5a1cf64137ff093aec492949dcd 100644 (file)
@@ -6,7 +6,7 @@
 <title>
   Class: Lyricli::Configuration
   
-    &mdash; Documentation by YARD 0.8.1
+    &mdash; Documentation by YARD 0.8.2.1
   
 </title>
 
   
 
   
+    <span class="summary_desc"><div class='inline'></div></span>
+  
+</li>
+
+      
+        <li class="public ">
+  <span class="summary_signature">
+    
+      <a href="#delete-instance_method" title="#delete (instance method)">- (Object) <strong>delete</strong>(key) </a>
+    
+
+    
+  </span>
+  
+  
+  
+  
+  
+  
+  
+
+  
     <span class="summary_desc"><div class='inline'></div></span>
   
 </li>
@@ -225,6 +247,53 @@ A new instance of Configuration.
 </p>
 </div></span>
   
+</li>
+
+      
+        <li class="public ">
+  <span class="summary_signature">
+    
+      <a href="#load_config-instance_method" title="#load_config (instance method)">- (Object) <strong>load_config</strong> </a>
+    
+
+    
+  </span>
+  
+  
+  
+  
+  
+  
+  
+
+  
+    <span class="summary_desc"><div class='inline'><p>
+TODO: Apart from this, load a default yml that will be used for this.
+</p>
+</div></span>
+  
+</li>
+
+      
+        <li class="public ">
+  <span class="summary_signature">
+    
+      <a href="#save_config-instance_method" title="#save_config (instance method)">- (Object) <strong>save_config</strong> </a>
+    
+
+    
+  </span>
+  
+  
+  
+  
+  
+  
+  
+
+  
+    <span class="summary_desc"><div class='inline'></div></span>
+  
 </li>
 
       
@@ -264,7 +333,8 @@ A new instance of Configuration
 4
 5
 6
-7</pre>
+7
+8</pre>
     </td>
     <td>
       <pre class="code"><span class="info file"># File 'lib/lyricli/configuration.rb', line 4</span>
@@ -272,6 +342,7 @@ A new instance of Configuration
 <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
   <span class='ivar'>@config_path</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>~/.lyricli.conf</span><span class='tstring_end'>&quot;</span></span>
   <span class='ivar'>@defaults_path</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>defaults.json</span><span class='tstring_end'>&quot;</span></span>
+  <span class='ivar'>@config</span> <span class='op'>=</span> <span class='kw'>nil</span>
 <span class='kw'>end</span></pre>
     </td>
   </tr>
@@ -300,12 +371,12 @@ A new instance of Configuration
       <pre class="lines">
 
 
-11
 12
-13</pre>
+13
+14</pre>
     </td>
     <td>
-      <pre class="code"><span class="info file"># File 'lib/lyricli/configuration.rb', line 11</span>
+      <pre class="code"><span class="info file"># File 'lib/lyricli/configuration.rb', line 12</span>
 
 <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_instance'>instance</span>
   <span class='cvar'>@@instance</span>
@@ -336,13 +407,13 @@ A new instance of Configuration
       <pre class="lines">
 
 
-15
 16
 17
-18</pre>
+18
+19</pre>
     </td>
     <td>
-      <pre class="code"><span class="info file"># File 'lib/lyricli/configuration.rb', line 15</span>
+      <pre class="code"><span class="info file"># File 'lib/lyricli/configuration.rb', line 16</span>
 
 <span class='kw'>def</span> <span class='op'>[]</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
   <span class='id identifier rubyid_load_config'>load_config</span> <span class='kw'>unless</span> <span class='ivar'>@config</span>
@@ -368,14 +439,14 @@ A new instance of Configuration
       <pre class="lines">
 
 
-20
 21
 22
 23
-24</pre>
+24
+25</pre>
     </td>
     <td>
-      <pre class="code"><span class="info file"># File 'lib/lyricli/configuration.rb', line 20</span>
+      <pre class="code"><span class="info file"># File 'lib/lyricli/configuration.rb', line 21</span>
 
 <span class='kw'>def</span> <span class='op'>[]=</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_load_config'>load_config</span> <span class='kw'>unless</span> <span class='ivar'>@config</span>
@@ -385,6 +456,133 @@ A new instance of Configuration
     </td>
   </tr>
 </table>
+</div>
+    
+      <div class="method_details ">
+  <h3 class="signature " id="delete-instance_method">
+  
+    - (<tt>Object</tt>) <strong>delete</strong>(key) 
+  
+
+  
+
+  
+</h3><table class="source_code">
+  <tr>
+    <td>
+      <pre class="lines">
+
+
+27
+28
+29
+30
+31</pre>
+    </td>
+    <td>
+      <pre class="code"><span class="info file"># File 'lib/lyricli/configuration.rb', line 27</span>
+
+<span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
+  <span class='id identifier rubyid_load_config'>load_config</span> <span class='kw'>unless</span> <span class='ivar'>@config</span>
+  <span class='ivar'>@config</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
+  <span class='id identifier rubyid_save_config'>save_config</span>
+<span class='kw'>end</span></pre>
+    </td>
+  </tr>
+</table>
+</div>
+    
+      <div class="method_details ">
+  <h3 class="signature " id="load_config-instance_method">
+  
+    - (<tt>Object</tt>) <strong>load_config</strong> 
+  
+
+  
+
+  
+</h3><div class="docstring">
+  <div class="discussion">
+    <p>
+TODO: Apart from this, load a default yml that will be used for this. And
+just extend everything from the user&#8217;s config.
+</p>
+
+
+  </div>
+</div>
+<div class="tags">
+  
+
+</div><table class="source_code">
+  <tr>
+    <td>
+      <pre class="lines">
+
+
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46</pre>
+    </td>
+    <td>
+      <pre class="code"><span class="info file"># File 'lib/lyricli/configuration.rb', line 37</span>
+
+<span class='kw'>def</span> <span class='id identifier rubyid_load_config'>load_config</span>
+  <span class='id identifier rubyid_path'>path</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_expand_path'>expand_path</span><span class='lparen'>(</span><span class='ivar'>@config_path</span><span class='rparen'>)</span>
+
+  <span class='kw'>if</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_exists?'>exists?</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span>
+    <span class='id identifier rubyid_file'>file</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='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>r</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
+    <span class='ivar'>@config</span> <span class='op'>=</span> <span class='const'>MultiJson</span><span class='period'>.</span><span class='id identifier rubyid_decode'>decode</span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span><span class='period'>.</span><span class='id identifier rubyid_read'>read</span><span class='rparen'>)</span>
+  <span class='kw'>else</span>
+    <span class='id identifier rubyid_load_default_config'>load_default_config</span>
+  <span class='kw'>end</span>
+<span class='kw'>end</span></pre>
+    </td>
+  </tr>
+</table>
+</div>
+    
+      <div class="method_details ">
+  <h3 class="signature " id="save_config-instance_method">
+  
+    - (<tt>Object</tt>) <strong>save_config</strong> 
+  
+
+  
+
+  
+</h3><table class="source_code">
+  <tr>
+    <td>
+      <pre class="lines">
+
+
+48
+49
+50
+51
+52
+53</pre>
+    </td>
+    <td>
+      <pre class="code"><span class="info file"># File 'lib/lyricli/configuration.rb', line 48</span>
+
+<span class='kw'>def</span> <span class='id identifier rubyid_save_config'>save_config</span>
+  <span class='id identifier rubyid_path'>path</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_expand_path'>expand_path</span><span class='lparen'>(</span><span class='ivar'>@config_path</span><span class='rparen'>)</span>
+  <span class='id identifier rubyid_file'>file</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='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>w</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
+  <span class='id identifier rubyid_file'>file</span><span class='period'>.</span><span class='id identifier rubyid_print'>print</span><span class='lparen'>(</span><span class='const'>MultiJson</span><span class='period'>.</span><span class='id identifier rubyid_encode'>encode</span><span class='lparen'>(</span><span class='ivar'>@config</span><span class='rparen'>)</span><span class='rparen'>)</span>
+  <span class='id identifier rubyid_file'>file</span><span class='period'>.</span><span class='id identifier rubyid_close'>close</span>
+<span class='kw'>end</span></pre>
+    </td>
+  </tr>
+</table>
 </div>
     
   </div>
@@ -392,9 +590,9 @@ A new instance of Configuration
 </div>
 
     <div id="footer">
-  Generated on Fri Oct  5 22:31:14 2012 by
+  Generated on Sat Oct  6 02:05:51 2012 by
   <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
-  0.8.1 (ruby-1.9.2).
+  0.8.2.1 (ruby-1.9.2).
 </div>
 
   </body>
index 6d8ed13045ffac8027e0a5ffa63b366ae501ed72..090262df1448196e4748953a0c5f206cf2739867 100644 (file)
@@ -6,7 +6,7 @@
 <title>
   Class: Lyricli::Lyricli
   
-    &mdash; Documentation by YARD 0.8.1
+    &mdash; Documentation by YARD 0.8.2.1
   
 </title>
 
@@ -94,7 +94,7 @@
   
   
     <dt class="r2 last">Defined in:</dt>
-    <dd class="r2 last">lib/lyricli.rb</dd>
+    <dd class="r2 last">lib/lyricli/lyricli.rb</dd>
   
 </dl>
 <div class="clear"></div>
@@ -262,12 +262,12 @@ A new instance of Lyricli
       <pre class="lines">
 
 
-36
-37
-38</pre>
+4
+5
+6</pre>
     </td>
     <td>
-      <pre class="code"><span class="info file"># File 'lib/lyricli.rb', line 36</span>
+      <pre class="code"><span class="info file"># File 'lib/lyricli/lyricli.rb', line 4</span>
 
 <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
   <span class='ivar'>@source_manager</span> <span class='op'>=</span> <span class='const'>SourceManager</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
@@ -299,13 +299,13 @@ A new instance of Lyricli
       <pre class="lines">
 
 
-61
-62
-63
-64</pre>
+29
+30
+31
+32</pre>
     </td>
     <td>
-      <pre class="code"><span class="info file"># File 'lib/lyricli.rb', line 61</span>
+      <pre class="code"><span class="info file"># File 'lib/lyricli/lyricli.rb', line 29</span>
 
 <span class='kw'>def</span> <span class='id identifier rubyid_check_params'>check_params</span>
   <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_exit_with_error'>exit_with_error</span> <span class='kw'>if</span> <span class='ivar'>@current_track</span><span class='lbracket'>[</span><span class='symbol'>:artist</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='kw'>or</span> <span class='ivar'>@current_track</span><span class='lbracket'>[</span><span class='symbol'>:artist</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
@@ -325,21 +325,43 @@ A new instance of Lyricli
   
 
   
-</h3><table class="source_code">
+</h3><div class="docstring">
+  <div class="discussion">
+    
+
+  </div>
+</div>
+<div class="tags">
+  
+<p class="tag_title">Raises:</p>
+<ul class="raise">
+  
+    <li>
+      
+      
+        <span class='type'>(<tt>InvalidLyrics</tt>)</span>
+      
+      
+      
+    </li>
+  
+</ul>
+
+</div><table class="source_code">
   <tr>
     <td>
       <pre class="lines">
 
 
-40
-41
-42</pre>
+8
+9
+10</pre>
     </td>
     <td>
-      <pre class="code"><span class="info file"># File 'lib/lyricli.rb', line 40</span>
+      <pre class="code"><span class="info file"># File 'lib/lyricli/lyricli.rb', line 8</span>
 
 <span class='kw'>def</span> <span class='id identifier rubyid_exit_with_error'>exit_with_error</span>
-  <span class='id identifier rubyid_abort'>abort</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Usage: </span><span class='embexpr_beg'>#{</span><span class='gvar'>$0</span><span class='rbrace'>}</span><span class='tstring_content'> artist song</span><span class='tstring_end'>&quot;</span></span>
+  <span class='id identifier rubyid_raise'>raise</span> <span class='const'>InvalidLyrics</span>
 <span class='kw'>end</span></pre>
     </td>
   </tr>
@@ -361,21 +383,21 @@ A new instance of Lyricli
       <pre class="lines">
 
 
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55</pre>
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23</pre>
     </td>
     <td>
-      <pre class="code"><span class="info file"># File 'lib/lyricli.rb', line 44</span>
+      <pre class="code"><span class="info file"># File 'lib/lyricli/lyricli.rb', line 12</span>
 
 <span class='kw'>def</span> <span class='id identifier rubyid_get_lyrics'>get_lyrics</span>
   <span class='id identifier rubyid_set_current_track'>set_current_track</span>
@@ -409,12 +431,12 @@ A new instance of Lyricli
       <pre class="lines">
 
 
-57
-58
-59</pre>
+25
+26
+27</pre>
     </td>
     <td>
-      <pre class="code"><span class="info file"># File 'lib/lyricli.rb', line 57</span>
+      <pre class="code"><span class="info file"># File 'lib/lyricli/lyricli.rb', line 25</span>
 
 <span class='kw'>def</span> <span class='id identifier rubyid_set_current_track'>set_current_track</span>
   <span class='ivar'>@current_track</span> <span class='op'>=</span> <span class='ivar'>@source_manager</span><span class='period'>.</span><span class='id identifier rubyid_current_track'>current_track</span>
@@ -429,9 +451,9 @@ A new instance of Lyricli
 </div>
 
     <div id="footer">
-  Generated on Fri Oct  5 22:31:14 2012 by
+  Generated on Sat Oct  6 02:05:51 2012 by
   <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
-  0.8.1 (ruby-1.9.2).
+  0.8.2.1 (ruby-1.9.2).
 </div>
 
   </body>
index 5cca7958558a526d94e96ebca7b9945fe9472849..23a5f7318340d4634e292ba739e13b70cb50f5ec 100644 (file)
@@ -6,7 +6,7 @@
 <title>
   Class: Lyricli::LyricsEngine
   
-    &mdash; Documentation by YARD 0.8.1
+    &mdash; Documentation by YARD 0.8.2.1
   
 </title>
 
@@ -304,9 +304,9 @@ A new instance of LyricsEngine
 </div>
 
     <div id="footer">
-  Generated on Fri Oct  5 22:31:14 2012 by
+  Generated on Sat Oct  6 02:05:51 2012 by
   <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
-  0.8.1 (ruby-1.9.2).
+  0.8.2.1 (ruby-1.9.2).
 </div>
 
   </body>
index 399b33744ea3528ba77a22b945a3d8003a73d018..2f48f972d38fae8f4f4bc6869713f58249dda320 100644 (file)
@@ -6,7 +6,7 @@
 <title>
   Class: Lyricli::SourceManager
   
-    &mdash; Documentation by YARD 0.8.1
+    &mdash; Documentation by YARD 0.8.2.1
   
 </title>
 
         <li class="public ">
   <span class="summary_signature">
     
+      <a href="#available_sources-instance_method" title="#available_sources (instance method)">- (Object) <strong>available_sources</strong>(format = false) </a>
+    
+
+    
+  </span>
+  
+  
+  
+  
+  
+  
+  
+
+  
+    <span class="summary_desc"><div class='inline'></div></span>
+  
+</li>
+
+      
+        <li class="public ">
+  <span class="summary_signature">
+    
       <a href="#current_track-instance_method" title="#current_track (instance method)">- (Object) <strong>current_track</strong> </a>
     
 
   
 
   
+    <span class="summary_desc"><div class='inline'></div></span>
+  
+</li>
+
+      
+        <li class="public ">
+  <span class="summary_signature">
+    
+      <a href="#format_sources-instance_method" title="#format_sources (instance method)">- (Object) <strong>format_sources</strong>(sources) </a>
+    
+
+    
+  </span>
+  
+  
+  
+  
+  
+  
+  
+
+  
     <span class="summary_desc"><div class='inline'></div></span>
   
 </li>
@@ -318,7 +362,65 @@ A new instance of SourceManager
 
     
       <div class="method_details first">
-  <h3 class="signature first" id="current_track-instance_method">
+  <h3 class="signature first" id="available_sources-instance_method">
+  
+    - (<tt>Object</tt>) <strong>available_sources</strong>(format = false) 
+  
+
+  
+
+  
+</h3><table class="source_code">
+  <tr>
+    <td>
+      <pre class="lines">
+
+
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97</pre>
+    </td>
+    <td>
+      <pre class="code"><span class="info file"># File 'lib/lyricli/source_manager.rb', line 81</span>
+
+<span class='kw'>def</span> <span class='id identifier rubyid_available_sources'>available_sources</span><span class='lparen'>(</span><span class='id identifier rubyid_format'>format</span> <span class='op'>=</span> <span class='kw'>false</span><span class='rparen'>)</span>
+  <span class='id identifier rubyid_path_root'>path_root</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_expand_path'>expand_path</span><span class='lparen'>(</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_dirname'>dirname</span><span class='lparen'>(</span><span class='kw'>__FILE__</span><span class='rparen'>)</span><span class='rparen'>)</span>
+  <span class='id identifier rubyid_sources'>sources</span> <span class='op'>=</span> <span class='const'>Dir</span><span class='lbracket'>[</span><span class='id identifier rubyid_path_root'>path_root</span><span class='op'>+</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/sources/*.rb</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</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_s'>s</span><span class='op'>|</span>
+    <span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='id identifier rubyid_s'>s</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\.rb</span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
+
+    <span class='comment'># Add a star to denote enabled sources
+</span>    <span class='id identifier rubyid_name'>name</span>
+  <span class='rbrace'>}</span>
+
+  <span class='comment'># Remove arguments (Hack?) We don't want anybody to touch tihs one.
+</span>  <span class='id identifier rubyid_sources'>sources</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>arguments</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
+  <span class='kw'>if</span> <span class='id identifier rubyid_format'>format</span>
+    <span class='id identifier rubyid_format_sources'>format_sources</span><span class='lparen'>(</span><span class='id identifier rubyid_sources'>sources</span><span class='rparen'>)</span>
+  <span class='kw'>else</span>
+    <span class='id identifier rubyid_sources'>sources</span>
+  <span class='kw'>end</span>
+<span class='kw'>end</span></pre>
+    </td>
+  </tr>
+</table>
+</div>
+    
+      <div class="method_details ">
+  <h3 class="signature " id="current_track-instance_method">
   
     - (<tt>Object</tt>) <strong>current_track</strong> 
   
@@ -332,28 +434,46 @@ A new instance of SourceManager
       <pre class="lines">
 
 
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56</pre>
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79</pre>
     </td>
     <td>
-      <pre class="code"><span class="info file"># File 'lib/lyricli/source_manager.rb', line 46</span>
+      <pre class="code"><span class="info file"># File 'lib/lyricli/source_manager.rb', line 60</span>
 
 <span class='kw'>def</span> <span class='id identifier rubyid_current_track'>current_track</span>
   <span class='id identifier rubyid_track'>track</span> <span class='op'>=</span> <span class='kw'>nil</span>
+  <span class='id identifier rubyid_lock'>lock</span> <span class='op'>=</span> <span class='kw'>false</span>
   <span class='ivar'>@enabled_sources</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_source'>source</span><span class='op'>|</span>
     <span class='kw'>begin</span>
-      <span class='id identifier rubyid_track'>track</span> <span class='op'>||=</span> <span class='id identifier rubyid_source'>source</span><span class='period'>.</span><span class='id identifier rubyid_current_track'>current_track</span>
+      <span class='id identifier rubyid_current_track'>current_track</span> <span class='op'>=</span> <span class='id identifier rubyid_source'>source</span><span class='period'>.</span><span class='id identifier rubyid_current_track'>current_track</span>
+
+      <span class='comment'># This is a special thing for arguments. The thing is, they need to
+</span>      <span class='comment'># be inputted manually. So, if they are present they won't allow
+</span>      <span class='comment'># anyone else to give results. Makes sense, yet a bit hacky.
+</span>      <span class='kw'>unless</span> <span class='id identifier rubyid_current_track'>current_track</span><span class='lbracket'>[</span><span class='symbol'>:artist</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>||</span> <span class='id identifier rubyid_current_track'>current_track</span><span class='lbracket'>[</span><span class='symbol'>:artist</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='op'>||</span> <span class='id identifier rubyid_current_track'>current_track</span><span class='lbracket'>[</span><span class='symbol'>:song</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>||</span> <span class='id identifier rubyid_current_track'>current_track</span><span class='lbracket'>[</span><span class='symbol'>:song</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
+        <span class='id identifier rubyid_track'>track</span> <span class='op'>=</span> <span class='id identifier rubyid_current_track'>current_track</span> <span class='kw'>unless</span> <span class='id identifier rubyid_lock'>lock</span>
+        <span class='id identifier rubyid_lock'>lock</span> <span class='op'>=</span> <span class='kw'>true</span> <span class='kw'>if</span> <span class='id identifier rubyid_source'>source</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>arguments</span><span class='tstring_end'>&quot;</span></span>
+      <span class='kw'>end</span>
     <span class='kw'>rescue</span>
-      <span class='id identifier rubyid_fail'>fail</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Source </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_source'>source</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='rbrace'>}</span><span class='tstring_content'> has failed to start. Please reset the source by running `</span><span class='embexpr_beg'>#{</span><span class='gvar'>$0</span><span class='rbrace'>}</span><span class='tstring_content'> source reset </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_source'>source</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='rbrace'>}</span><span class='tstring_content'>.`</span><span class='tstring_end'>&quot;</span></span>
+      <span class='id identifier rubyid_raise'>raise</span> <span class='const'>SourceConfigurationException</span>
     <span class='kw'>end</span>
   <span class='kw'>end</span>
   <span class='id identifier rubyid_track'>track</span>
@@ -378,22 +498,32 @@ A new instance of SourceManager
       <pre class="lines">
 
 
-29
-30
-31
-32
-33
 34
-35</pre>
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45</pre>
     </td>
     <td>
-      <pre class="code"><span class="info file"># File 'lib/lyricli/source_manager.rb', line 29</span>
+      <pre class="code"><span class="info file"># File 'lib/lyricli/source_manager.rb', line 34</span>
 
 <span class='kw'>def</span> <span class='id identifier rubyid_disable'>disable</span><span class='lparen'>(</span><span class='id identifier rubyid_source_name'>source_name</span><span class='rparen'>)</span>
-  <span class='kw'>if</span> <span class='id identifier rubyid_klass'>klass</span> <span class='op'>=</span> <span class='id identifier rubyid_parse_class'>parse_class</span><span class='lparen'>(</span><span class='id identifier rubyid_camelize'>camelize</span><span class='lparen'>(</span><span class='id identifier rubyid_source_name'>source_name</span><span class='rparen'>)</span><span class='rparen'>)</span>
-    <span class='ivar'>@config</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>enabled_sources</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_klass'>klass</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
+  <span class='kw'>if</span> <span class='id identifier rubyid_available_sources'>available_sources</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_source_name'>source_name</span><span class='rparen'>)</span>
+    <span class='kw'>if</span> <span class='id identifier rubyid_klass'>klass</span> <span class='op'>=</span> <span class='id identifier rubyid_parse_class'>parse_class</span><span class='lparen'>(</span><span class='id identifier rubyid_camelize'>camelize</span><span class='lparen'>(</span><span class='id identifier rubyid_source_name'>source_name</span><span class='rparen'>)</span><span class='rparen'>)</span>
+      <span class='ivar'>@config</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>enabled_sources</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_klass'>klass</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
+      <span class='ivar'>@config</span><span class='period'>.</span><span class='id identifier rubyid_save_config'>save_config</span>
+    <span class='kw'>else</span>
+      <span class='id identifier rubyid_raise'>raise</span> <span class='const'>DisableSourceException</span>
+    <span class='kw'>end</span>
   <span class='kw'>else</span>
-    <span class='id identifier rubyid_raise'>raise</span> <span class='const'>DisableSourceException</span>
+    <span class='id identifier rubyid_raise'>raise</span> <span class='const'>UnknownSource</span>
   <span class='kw'>end</span>
 <span class='kw'>end</span></pre>
     </td>
@@ -424,23 +554,69 @@ A new instance of SourceManager
 24
 25
 26
-27</pre>
+27
+28
+29
+30
+31
+32</pre>
     </td>
     <td>
       <pre class="code"><span class="info file"># File 'lib/lyricli/source_manager.rb', line 19</span>
 
 <span class='kw'>def</span> <span class='id identifier rubyid_enable'>enable</span><span class='lparen'>(</span><span class='id identifier rubyid_source_name'>source_name</span><span class='rparen'>)</span>
-  <span class='kw'>if</span> <span class='id identifier rubyid_klass'>klass</span> <span class='op'>=</span> <span class='id identifier rubyid_parse_class'>parse_class</span><span class='lparen'>(</span><span class='id identifier rubyid_camelize'>camelize</span><span class='lparen'>(</span><span class='id identifier rubyid_source_name'>source_name</span><span class='rparen'>)</span><span class='rparen'>)</span>
-    <span class='id identifier rubyid_klass'>klass</span><span class='period'>.</span><span class='id identifier rubyid_enable'>enable</span>
-    <span class='ivar'>@config</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>enabled_sources</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_klass'>klass</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span>
-    <span class='ivar'>@config</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>enabled_sources</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_uniq!'>uniq!</span>
+  <span class='kw'>if</span> <span class='id identifier rubyid_available_sources'>available_sources</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_source_name'>source_name</span><span class='rparen'>)</span>
+    <span class='kw'>if</span> <span class='id identifier rubyid_klass'>klass</span> <span class='op'>=</span> <span class='id identifier rubyid_parse_class'>parse_class</span><span class='lparen'>(</span><span class='id identifier rubyid_camelize'>camelize</span><span class='lparen'>(</span><span class='id identifier rubyid_source_name'>source_name</span><span class='rparen'>)</span><span class='rparen'>)</span>
+      <span class='id identifier rubyid_klass'>klass</span><span class='period'>.</span><span class='id identifier rubyid_enable'>enable</span>
+      <span class='ivar'>@config</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>enabled_sources</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_klass'>klass</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span>
+      <span class='ivar'>@config</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>enabled_sources</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_uniq!'>uniq!</span>
+      <span class='ivar'>@config</span><span class='period'>.</span><span class='id identifier rubyid_save_config'>save_config</span>
+    <span class='kw'>else</span>
+      <span class='id identifier rubyid_raise'>raise</span> <span class='const'>EnableSourceException</span>
+    <span class='kw'>end</span>
   <span class='kw'>else</span>
-    <span class='id identifier rubyid_raise'>raise</span> <span class='const'>EnableSourceException</span>
+    <span class='id identifier rubyid_raise'>raise</span> <span class='const'>UnknownSource</span>
   <span class='kw'>end</span>
 <span class='kw'>end</span></pre>
     </td>
   </tr>
 </table>
+</div>
+    
+      <div class="method_details ">
+  <h3 class="signature " id="format_sources-instance_method">
+  
+    - (<tt>Object</tt>) <strong>format_sources</strong>(sources) 
+  
+
+  
+
+  
+</h3><table class="source_code">
+  <tr>
+    <td>
+      <pre class="lines">
+
+
+99
+100
+101
+102
+103
+104</pre>
+    </td>
+    <td>
+      <pre class="code"><span class="info file"># File 'lib/lyricli/source_manager.rb', line 99</span>
+
+<span class='kw'>def</span> <span class='id identifier rubyid_format_sources'>format_sources</span><span class='lparen'>(</span><span class='id identifier rubyid_sources'>sources</span><span class='rparen'>)</span>
+  <span class='id identifier rubyid_sources'>sources</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_s'>s</span><span class='op'>|</span>
+    <span class='id identifier rubyid_s'>s</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>*</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>if</span> <span class='ivar'>@config</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>enabled_sources</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_s'>s</span><span class='rparen'>)</span>
+    <span class='id identifier rubyid_s'>s</span>
+  <span class='rbrace'>}</span>
+<span class='kw'>end</span></pre>
+    </td>
+  </tr>
+</table>
 </div>
     
       <div class="method_details ">
@@ -458,24 +634,32 @@ A new instance of SourceManager
       <pre class="lines">
 
 
-37
-38
-39
-40
-41
-42
-43
-44</pre>
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58</pre>
     </td>
     <td>
-      <pre class="code"><span class="info file"># File 'lib/lyricli/source_manager.rb', line 37</span>
+      <pre class="code"><span class="info file"># File 'lib/lyricli/source_manager.rb', line 47</span>
 
 <span class='kw'>def</span> <span class='id identifier rubyid_reset'>reset</span><span class='lparen'>(</span><span class='id identifier rubyid_source_name'>source_name</span><span class='rparen'>)</span>
-  <span class='kw'>if</span> <span class='id identifier rubyid_klass'>klass</span> <span class='op'>=</span> <span class='id identifier rubyid_parse_class'>parse_class</span><span class='lparen'>(</span><span class='id identifier rubyid_camelize'>camelize</span><span class='lparen'>(</span><span class='id identifier rubyid_source_name'>source_name</span><span class='rparen'>)</span><span class='rparen'>)</span>
-    <span class='id identifier rubyid_klass'>klass</span><span class='period'>.</span><span class='id identifier rubyid_reset'>reset</span>
-    <span class='id identifier rubyid_disable'>disable</span><span class='lparen'>(</span><span class='id identifier rubyid_source_name'>source_name</span><span class='rparen'>)</span>
+  <span class='kw'>if</span> <span class='id identifier rubyid_available_sources'>available_sources</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_source_name'>source_name</span><span class='rparen'>)</span>
+    <span class='kw'>if</span> <span class='id identifier rubyid_klass'>klass</span> <span class='op'>=</span> <span class='id identifier rubyid_parse_class'>parse_class</span><span class='lparen'>(</span><span class='id identifier rubyid_camelize'>camelize</span><span class='lparen'>(</span><span class='id identifier rubyid_source_name'>source_name</span><span class='rparen'>)</span><span class='rparen'>)</span>
+      <span class='id identifier rubyid_klass'>klass</span><span class='period'>.</span><span class='id identifier rubyid_reset'>reset</span>
+      <span class='id identifier rubyid_disable'>disable</span><span class='lparen'>(</span><span class='id identifier rubyid_source_name'>source_name</span><span class='rparen'>)</span>
+    <span class='kw'>else</span>
+      <span class='id identifier rubyid_raise'>raise</span> <span class='const'>ResetSourceException</span>
+    <span class='kw'>end</span>
   <span class='kw'>else</span>
-    <span class='id identifier rubyid_raise'>raise</span> <span class='const'>ResetSourceException</span>
+    <span class='id identifier rubyid_raise'>raise</span> <span class='const'>UnknownSource</span>
   <span class='kw'>end</span>
 <span class='kw'>end</span></pre>
     </td>
@@ -488,9 +672,9 @@ A new instance of SourceManager
 </div>
 
     <div id="footer">
-  Generated on Fri Oct  5 22:31:14 2012 by
+  Generated on Sat Oct  6 02:05:51 2012 by
   <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
-  0.8.1 (ruby-1.9.2).
+  0.8.2.1 (ruby-1.9.2).
 </div>
 
   </body>
index f2b0712c5e7326e028435a65446d22c7d0142fd7..ad3a5a1d84cfabd2f769e5eb9b67097cc2f99eae 100644 (file)
@@ -6,7 +6,7 @@
 <title>
   Module: Lyricli::Sources
   
-    &mdash; Documentation by YARD 0.8.1
+    &mdash; Documentation by YARD 0.8.2.1
   
 </title>
 
@@ -80,7 +80,7 @@
   
     <dt class="r1 last">Defined in:</dt>
     <dd class="r1 last">lib/lyricli/sources/rdio.rb<span class="defines">,<br />
-  lib/lyricli/sources/arguments.rb</span>
+  lib/lyricli/sources/itunes.rb,<br /> lib/lyricli/sources/arguments.rb</span>
 </dd>
   
 </dl>
@@ -92,7 +92,7 @@
     
   
     
-      <strong class="classes">Classes:</strong> <span class='object_link'><a href="Sources/Arguments.html" title="Lyricli::Sources::Arguments (class)">Arguments</a></span>, <span class='object_link'><a href="Sources/Rdio.html" title="Lyricli::Sources::Rdio (class)">Rdio</a></span>
+      <strong class="classes">Classes:</strong> <span class='object_link'><a href="Sources/Arguments.html" title="Lyricli::Sources::Arguments (class)">Arguments</a></span>, <span class='object_link'><a href="Sources/Itunes.html" title="Lyricli::Sources::Itunes (class)">Itunes</a></span>, <span class='object_link'><a href="Sources/Rdio.html" title="Lyricli::Sources::Rdio (class)">Rdio</a></span>
     
   
 </p>
 </div>
 
     <div id="footer">
-  Generated on Fri Oct  5 22:31:14 2012 by
+  Generated on Sat Oct  6 02:05:51 2012 by
   <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
-  0.8.1 (ruby-1.9.2).
+  0.8.2.1 (ruby-1.9.2).
 </div>
 
   </body>
index da2f0a17a5f74ed831fd0f229445f9442b62dd2d..6f0be6503aad4397d68b9f6fdb9b25262f27ae2a 100644 (file)
@@ -6,7 +6,7 @@
 <title>
   Class: Lyricli::Sources::Arguments
   
-    &mdash; Documentation by YARD 0.8.1
+    &mdash; Documentation by YARD 0.8.2.1
   
 </title>
 
@@ -315,7 +315,6 @@ Instantiates everything it needs to run.
     
       
       <span id="name=-class_method"></span>
-      <span id="name-class_method"></span>
       <div class="method_details first">
   <h3 class="signature first" id="name-class_method">
   
@@ -527,9 +526,9 @@ A hash containing the current `:song` and `:artist`.
 </div>
 
     <div id="footer">
-  Generated on Fri Oct  5 22:31:15 2012 by
+  Generated on Sat Oct  6 02:05:51 2012 by
   <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
-  0.8.1 (ruby-1.9.2).
+  0.8.2.1 (ruby-1.9.2).
 </div>
 
   </body>
index e99af89600773dda1b9c95e595542d9fcc458671..51ce90917e32a690dfadac1ea2f2724a99bb7f9c 100644 (file)
@@ -6,7 +6,7 @@
 <title>
   Class: Lyricli::Sources::Rdio
   
-    &mdash; Documentation by YARD 0.8.1
+    &mdash; Documentation by YARD 0.8.2.1
   
 </title>
 
@@ -319,19 +319,19 @@ Instantiates everything it needs to run.
       <pre class="lines">
 
 
-23
-24
-25
-26
-27</pre>
+27
+28
+29
+30
+31</pre>
     </td>
     <td>
-      <pre class="code"><span class="info file"># File 'lib/lyricli/sources/rdio.rb', line 23</span>
+      <pre class="code"><span class="info file"># File 'lib/lyricli/sources/rdio.rb', line 27</span>
 
 <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
   <span class='ivar'>@name</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>rdio</span><span class='tstring_end'>'</span></span>
-  <span class='ivar'>@config</span> <span class='op'>=</span> <span class='const'>Lyricli</span><span class='op'>::</span><span class='const'>Configuration</span><span class='period'>.</span><span class='id identifier rubyid_instance'>instance</span>
-  <span class='ivar'>@rdio</span> <span class='op'>=</span> <span class='const'>Rdio</span><span class='op'>::</span><span class='const'>SimpleRdio</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='ivar'>@config</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>rdio_key</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='ivar'>@config</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>rdio_secret</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='ivar'>@config</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>rdio_auth_token</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
+  <span class='ivar'>@config</span> <span class='op'>=</span> <span class='const'>Configuration</span><span class='period'>.</span><span class='id identifier rubyid_instance'>instance</span>
+  <span class='ivar'>@rdio</span> <span class='op'>=</span> <span class='op'>::</span><span class='const'>Rdio</span><span class='op'>::</span><span class='const'>SimpleRdio</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='ivar'>@config</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>rdio_key</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='ivar'>@config</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>rdio_secret</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='ivar'>@config</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>rdio_auth_token</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
 <span class='kw'>end</span></pre>
     </td>
   </tr>
@@ -345,7 +345,6 @@ Instantiates everything it needs to run.
     
       
       <span id="name=-class_method"></span>
-      <span id="name-class_method"></span>
       <div class="method_details first">
   <h3 class="signature first" id="name-class_method">
   
@@ -423,11 +422,6 @@ token.
       <pre class="lines">
 
 
-46
-47
-48
-49
-50
 51
 52
 53
@@ -439,19 +433,24 @@ token.
 59
 60
 61
-62</pre>
+62
+63
+64
+65
+66
+67</pre>
     </td>
     <td>
-      <pre class="code"><span class="info file"># File 'lib/lyricli/sources/rdio.rb', line 46</span>
+      <pre class="code"><span class="info file"># File 'lib/lyricli/sources/rdio.rb', line 51</span>
 
 <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_create_auth_token'>create_auth_token</span>
-  <span class='ivar'>@rdio</span> <span class='op'>=</span> <span class='const'>Rdio</span><span class='op'>::</span><span class='const'>SimpleRdio</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='ivar'>@config</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>rdio_key</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='ivar'>@config</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>rdio_secret</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='ivar'>@config</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>rdio_auth_token</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
+  <span class='id identifier rubyid_rdio'>rdio</span> <span class='op'>=</span> <span class='op'>::</span><span class='const'>Rdio</span><span class='op'>::</span><span class='const'>SimpleRdio</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='ivar'>@config</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>rdio_key</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='ivar'>@config</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>rdio_secret</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='ivar'>@config</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>rdio_auth_token</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
 
   <span class='comment'># Request Authorization
 </span>  <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Follow this URL to authorize lyricli:</span><span class='tstring_end'>&quot;</span></span>
   <span class='id identifier rubyid_auth_url'>auth_url</span> <span class='op'>=</span> <span class='id identifier rubyid_rdio'>rdio</span><span class='period'>.</span><span class='id identifier rubyid_begin_authentication'>begin_authentication</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>oob</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
   <span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_auth_url'>auth_url</span>
-  <span class='const'>Launchy</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='id identifier rubyid_auth_url'>auth_url</span><span class='rparen'>)</span>
+  <span class='op'>::</span><span class='const'>Launchy</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='id identifier rubyid_auth_url'>auth_url</span><span class='rparen'>)</span>
 
   <span class='comment'># Request Code, Obtain Token
 </span>  <span class='id identifier rubyid_print'>print</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Please type the authorization code: </span><span class='tstring_end'>&quot;</span></span>
@@ -501,18 +500,26 @@ source. In the case of Rdio it has to authenticate with OAuth.
 17
 18
 19
-20</pre>
+20
+21
+22
+23
+24</pre>
     </td>
     <td>
       <pre class="code"><span class="info file"># File 'lib/lyricli/sources/rdio.rb', line 13</span>
 
 <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_enable'>enable</span>
   <span class='comment'># Validation Code
-</span>  <span class='ivar'>@config</span> <span class='op'>=</span> <span class='const'>Lyricli</span><span class='op'>::</span><span class='const'>Configuration</span><span class='period'>.</span><span class='id identifier rubyid_instance'>instance</span>
+</span>  <span class='ivar'>@config</span> <span class='op'>=</span> <span class='const'>Configuration</span><span class='period'>.</span><span class='id identifier rubyid_instance'>instance</span>
   <span class='kw'>unless</span> <span class='ivar'>@config</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>rdio_auth_token</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>&amp;&amp;</span> <span class='op'>!</span><span class='ivar'>@config</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>rdio_auth_token</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
     <span class='id identifier rubyid_create_auth_token'>create_auth_token</span>
   <span class='kw'>end</span>
 
+  <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>***</span><span class='tstring_end'>&quot;</span></span>
+  <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Hello, rdio tends to be a bit aggressive and tends to have trouble with other sources. If you're having trouble, you can disable it temporarily. You will not have to reauthenticate.</span><span class='tstring_end'>&quot;</span></span>
+  <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>***</span><span class='tstring_end'>&quot;</span></span>
+
 <span class='kw'>end</span></pre>
     </td>
   </tr>
@@ -546,16 +553,18 @@ The reset method resets any configurations it may have
       <pre class="lines">
 
 
-40
-41
-42</pre>
+44
+45
+46
+47</pre>
     </td>
     <td>
-      <pre class="code"><span class="info file"># File 'lib/lyricli/sources/rdio.rb', line 40</span>
+      <pre class="code"><span class="info file"># File 'lib/lyricli/sources/rdio.rb', line 44</span>
 
 <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_reset'>reset</span>
-  <span class='comment'># Reset Code
-</span><span class='kw'>end</span></pre>
+  <span class='ivar'>@config</span> <span class='op'>=</span> <span class='const'>Configuration</span><span class='period'>.</span><span class='id identifier rubyid_instance'>instance</span>
+  <span class='ivar'>@config</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>rdio_auth_token</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
+<span class='kw'>end</span></pre>
     </td>
   </tr>
 </table>
@@ -614,15 +623,15 @@ A hash containing the current `:song` and `:artist`.
       <pre class="lines">
 
 
-32
-33
-34
-35
 36
-37</pre>
+37
+38
+39
+40
+41</pre>
     </td>
     <td>
-      <pre class="code"><span class="info file"># File 'lib/lyricli/sources/rdio.rb', line 32</span>
+      <pre class="code"><span class="info file"># File 'lib/lyricli/sources/rdio.rb', line 36</span>
 
 <span class='kw'>def</span> <span class='id identifier rubyid_current_track'>current_track</span>
   <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='ivar'>@rdio</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>currentUser</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>extras</span><span class='tstring_end'>'</span></span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>lastSongPlayed</span><span class='tstring_end'>'</span></span><span class='rbrace'>}</span><span class='rparen'>)</span>
@@ -640,9 +649,9 @@ A hash containing the current `:song` and `:artist`.
 </div>
 
     <div id="footer">
-  Generated on Fri Oct  5 22:31:14 2012 by
+  Generated on Sat Oct  6 02:05:51 2012 by
   <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
-  0.8.1 (ruby-1.9.2).
+  0.8.2.1 (ruby-1.9.2).
 </div>
 
   </body>
index 71499bfca043173dd945285c6b81a2158a71aa8d..b1a24d610355fe45dba669fccea9683fde543580 100644 (file)
@@ -6,7 +6,7 @@
 <title>
   Module: Lyricli::Util
   
-    &mdash; Documentation by YARD 0.8.1
+    &mdash; Documentation by YARD 0.8.2.1
   
 </title>
 
 </dl>
 <div class="clear"></div>
 
+<h2>Overview</h2><div class="docstring">
+  <div class="discussion">
+    <p>
+This module contains several utility functions.
+</p>
 
 
+  </div>
+</div>
+<div class="tags">
+  
+
+</div>
+
 
 
 
         <li class="public ">
   <span class="summary_signature">
     
-      <a href="#camelize-instance_method" title="#camelize (instance method)">- (Object) <strong>camelize</strong>(str) </a>
+      <a href="#camelize-instance_method" title="#camelize (instance method)">- (String) <strong>camelize</strong>(str) </a>
     
 
     
   
 
   
-    <span class="summary_desc"><div class='inline'></div></span>
+    <span class="summary_desc"><div class='inline'><p>
+Transforms a string from snake_case to UpperCamelCase.
+</p>
+</div></span>
   
 </li>
 
         <li class="public ">
   <span class="summary_signature">
     
-      <a href="#parse_class-instance_method" title="#parse_class (instance method)">- (Object) <strong>parse_class</strong>(class_name) </a>
+      <a href="#parse_class-instance_method" title="#parse_class (instance method)">- (Class<sup>?</sup>) <strong>parse_class</strong>(class_name) </a>
     
 
     
   
 
   
-    <span class="summary_desc"><div class='inline'></div></span>
+    <span class="summary_desc"><div class='inline'><p>
+Takes a class name in snake_case and attempts to find the corresponding
+class from the sources.
+</p>
+</div></span>
   
 </li>
 
         <li class="public ">
   <span class="summary_signature">
     
-      <a href="#sanitize_param-instance_method" title="#sanitize_param (instance method)">- (Object) <strong>sanitize_param</strong>(p) </a>
+      <a href="#sanitize_param-instance_method" title="#sanitize_param (instance method)">- (String) <strong>sanitize_param</strong>(p) </a>
     
 
     
   
 
   
-    <span class="summary_desc"><div class='inline'></div></span>
+    <span class="summary_desc"><div class='inline'><p>
+Simply escapes a param and substitutes spaces and escaped plus signs for
+plus signs.
+</p>
+</div></span>
   
 </li>
 
       <div class="method_details first">
   <h3 class="signature first" id="camelize-instance_method">
   
-    - (<tt>Object</tt>) <strong>camelize</strong>(str) 
+    - (<tt>String</tt>) <strong>camelize</strong>(str) 
   
 
   
 
   
-</h3><table class="source_code">
+</h3><div class="docstring">
+  <div class="discussion">
+    <p>
+Transforms a string from snake_case to UpperCamelCase
+</p>
+
+
+  </div>
+</div>
+<div class="tags">
+  <p class="tag_title">Parameters:</p>
+<ul class="param">
+  
+    <li>
+      
+        <span class='name'>str</span>
+      
+      
+        <span class='type'>(<tt>String</tt>)</span>
+      
+      
+      
+        &mdash;
+        <div class='inline'><p>
+the string that will be Camelized
+</p>
+</div>
+      
+    </li>
+  
+</ul>
+
+<p class="tag_title">Returns:</p>
+<ul class="return">
+  
+    <li>
+      
+      
+        <span class='type'>(<tt>String</tt>)</span>
+      
+      
+      
+        &mdash;
+        <div class='inline'><p>
+the Camelized string.
+</p>
+</div>
+      
+    </li>
+  
+</ul>
+
+</div><table class="source_code">
   <tr>
     <td>
       <pre class="lines">
 
 
-3
-4
-5</pre>
+9
+10
+11</pre>
     </td>
     <td>
-      <pre class="code"><span class="info file"># File 'lib/lyricli/util.rb', line 3</span>
+      <pre class="code"><span class="info file"># File 'lib/lyricli/util.rb', line 9</span>
 
 <span class='kw'>def</span> <span class='id identifier rubyid_camelize'>camelize</span><span class='lparen'>(</span><span class='id identifier rubyid_str'>str</span><span class='rparen'>)</span>
   <span class='id identifier rubyid_str'>str</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='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_w'>w</span><span class='op'>|</span> <span class='id identifier rubyid_w'>w</span><span class='period'>.</span><span class='id identifier rubyid_capitalize'>capitalize</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span>
       <div class="method_details ">
   <h3 class="signature " id="parse_class-instance_method">
   
-    - (<tt>Object</tt>) <strong>parse_class</strong>(class_name) 
+    - (<tt>Class</tt><sup>?</sup>) <strong>parse_class</strong>(class_name) 
   
 
   
 
   
-</h3><table class="source_code">
+</h3><div class="docstring">
+  <div class="discussion">
+    <p>
+Takes a class name in snake_case and attempts to find the corresponding
+class from the sources.
+</p>
+
+
+  </div>
+</div>
+<div class="tags">
+  <p class="tag_title">Parameters:</p>
+<ul class="param">
+  
+    <li>
+      
+        <span class='name'>class_name</span>
+      
+      
+        <span class='type'>(<tt>String</tt>)</span>
+      
+      
+      
+        &mdash;
+        <div class='inline'><p>
+the snake_case name of the class to search for.
+</p>
+</div>
+      
+    </li>
+  
+</ul>
+
+<p class="tag_title">Returns:</p>
+<ul class="return">
+  
+    <li>
+      
+      
+        <span class='type'>(<tt>Class</tt>, <tt>nil</tt>)</span>
+      
+      
+      
+        &mdash;
+        <div class='inline'><p>
+the found class or nil
+</p>
+</div>
+      
+    </li>
+  
+</ul>
+
+</div><table class="source_code">
   <tr>
     <td>
       <pre class="lines">
 
 
-7
-8
-9
-10
-11
-12
-13
-14</pre>
+18
+19
+20
+21
+22
+23
+24
+25</pre>
     </td>
     <td>
-      <pre class="code"><span class="info file"># File 'lib/lyricli/util.rb', line 7</span>
+      <pre class="code"><span class="info file"># File 'lib/lyricli/util.rb', line 18</span>
 
 <span class='kw'>def</span> <span class='id identifier rubyid_parse_class'>parse_class</span><span class='lparen'>(</span><span class='id identifier rubyid_class_name'>class_name</span><span class='rparen'>)</span>
   <span class='kw'>begin</span>
       <div class="method_details ">
   <h3 class="signature " id="sanitize_param-instance_method">
   
-    - (<tt>Object</tt>) <strong>sanitize_param</strong>(p) 
+    - (<tt>String</tt>) <strong>sanitize_param</strong>(p) 
+  
+
+  
+
   
+</h3><div class="docstring">
+  <div class="discussion">
+    <p>
+Simply escapes a param and substitutes spaces and escaped plus signs for
+plus signs.
+</p>
 
+
+  </div>
+</div>
+<div class="tags">
+  <p class="tag_title">Parameters:</p>
+<ul class="param">
   
+    <li>
+      
+        <span class='name'>p</span>
+      
+      
+        <span class='type'>(<tt>String</tt>)</span>
+      
+      
+      
+        &mdash;
+        <div class='inline'><p>
+the parameter to be sanitized
+</p>
+</div>
+      
+    </li>
+  
+</ul>
 
+<p class="tag_title">Returns:</p>
+<ul class="return">
+  
+    <li>
+      
+      
+        <span class='type'>(<tt>String</tt>)</span>
+      
+      
+      
+        &mdash;
+        <div class='inline'><p>
+the sanitized parameter
+</p>
+</div>
+      
+    </li>
   
-</h3><table class="source_code">
+</ul>
+
+</div><table class="source_code">
   <tr>
     <td>
       <pre class="lines">
 
 
-16
-17
-18</pre>
+32
+33
+34</pre>
     </td>
     <td>
-      <pre class="code"><span class="info file"># File 'lib/lyricli/util.rb', line 16</span>
+      <pre class="code"><span class="info file"># File 'lib/lyricli/util.rb', line 32</span>
 
 <span class='kw'>def</span> <span class='id identifier rubyid_sanitize_param'>sanitize_param</span><span class='lparen'>(</span><span class='id identifier rubyid_p'>p</span><span class='rparen'>)</span>
   <span class='const'>URI</span><span class='period'>.</span><span class='id identifier rubyid_encode_www_form_component'>encode_www_form_component</span><span class='lparen'>(</span><span class='id identifier rubyid_p'>p</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'> </span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>+</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>%2B</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>+</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
 </div>
 
     <div id="footer">
-  Generated on Fri Oct  5 22:31:14 2012 by
+  Generated on Sat Oct  6 02:05:51 2012 by
   <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
-  0.8.1 (ruby-1.9.2).
+  0.8.2.1 (ruby-1.9.2).
 </div>
 
   </body>
index 7d92f25d516f6258ff91a69ccbdeade825cd3579..d505ea554095f8c71fedde545db10e6c2fc8bb57 100644 (file)
@@ -4,7 +4,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <title>
-  Documentation by YARD 0.8.1
+  Documentation by YARD 0.8.2.1
   
 </title>
 
 
     <iframe id="search_frame"></iframe>
 
-    <div id="content"><h1 class="noborder title">Documentation by YARD 0.8.1</h1>
+    <div id="content"><h1 class="noborder title">Documentation by YARD 0.8.2.1</h1>
 <div id="listing">
   <h1 class="alphaindex">Alphabetic Index</h1>
   
+  <h2>File Listing</h2>
+  <ul id="files" class="index_inline_list">
+  
+  
+    <li class="r1"><a href="index.html" title="README">README</a></li>
+    
+  
+  </ul>
+
 <div class="clear"></div>
 <h2>Namespace Listing A-Z</h2>
 
         </ul>
       
         
-        <ul id="alpha_L" class="alpha">
-          <li class="letter">L</li>
+        <ul id="alpha_I" class="alpha">
+          <li class="letter">I</li>
           <ul>
             
               <li>
-                <span class='object_link'><a href="Lyricli/Lyricli.html" title="Lyricli::Lyricli (class)">Lyricli</a></span>
+                <span class='object_link'><a href="Lyricli/Sources/Itunes.html" title="Lyricli::Sources::Itunes (class)">Itunes</a></span>
                 
-                  <small>(Lyricli)</small>
+                  <small>(Lyricli::Sources)</small>
                 
               </li>
             
+          </ul>
+        </ul>
+      
+        
+        <ul id="alpha_L" class="alpha">
+          <li class="letter">L</li>
+          <ul>
+            
               <li>
                 <span class='object_link'><a href="Lyricli.html" title="Lyricli (module)">Lyricli</a></span>
                 
               </li>
             
+              <li>
+                <span class='object_link'><a href="Lyricli/Lyricli.html" title="Lyricli::Lyricli (class)">Lyricli</a></span>
+                
+                  <small>(Lyricli)</small>
+                
+              </li>
+            
               <li>
                 <span class='object_link'><a href="Lyricli/LyricsEngine.html" title="Lyricli::LyricsEngine (class)">LyricsEngine</a></span>
                 
 </div>
 
     <div id="footer">
-  Generated on Fri Oct  5 22:31:14 2012 by
+  Generated on Sat Oct  6 02:05:50 2012 by
   <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
-  0.8.1 (ruby-1.9.2).
+  0.8.2.1 (ruby-1.9.2).
 </div>
 
   </body>
index 6652d8bc8d46b787b0bd50b0a81c3a8b40ed9468..ca6a9fe312e8f6d30d092f1282effa58fcfb65ae 100644 (file)
@@ -45,7 +45,7 @@
 
       <ul id="full_list" class="class">
         <li><span class='object_link'><a href="top-level-namespace.html" title=" (root)">Top Level Namespace</a></span></li>
-<li><a class='toggle'></a> <span class='object_link'><a href="Lyricli.html" title="Lyricli (module)">Lyricli</a></span><small class='search_info'>Top Level Namespace</small></li><ul><li><span class='object_link'><a href="Lyricli/Configuration.html" title="Lyricli::Configuration (class)">Configuration</a></span> &lt; Object<small class='search_info'>Lyricli</small></li><li><span class='object_link'><a href="Lyricli/Lyricli.html" title="Lyricli::Lyricli (class)">Lyricli</a></span> &lt; Object<small class='search_info'>Lyricli</small></li><li><span class='object_link'><a href="Lyricli/LyricsEngine.html" title="Lyricli::LyricsEngine (class)">LyricsEngine</a></span> &lt; Object<small class='search_info'>Lyricli</small></li><li><span class='object_link'><a href="Lyricli/SourceManager.html" title="Lyricli::SourceManager (class)">SourceManager</a></span> &lt; Object<small class='search_info'>Lyricli</small></li><li><a class='toggle'></a> <span class='object_link'><a href="Lyricli/Sources.html" title="Lyricli::Sources (module)">Sources</a></span><small class='search_info'>Lyricli</small></li><ul><li><span class='object_link'><a href="Lyricli/Sources/Arguments.html" title="Lyricli::Sources::Arguments (class)">Arguments</a></span> &lt; Object<small class='search_info'>Lyricli::Sources</small></li><li><span class='object_link'><a href="Lyricli/Sources/Rdio.html" title="Lyricli::Sources::Rdio (class)">Rdio</a></span> &lt; Object<small class='search_info'>Lyricli::Sources</small></li></ul><li><span class='object_link'><a href="Lyricli/Util.html" title="Lyricli::Util (module)">Util</a></span><small class='search_info'>Lyricli</small></li></ul>
+<li><a class='toggle'></a> <span class='object_link'><a href="Lyricli.html" title="Lyricli (module)">Lyricli</a></span><small class='search_info'>Top Level Namespace</small></li><ul><li><span class='object_link'><a href="Lyricli/Configuration.html" title="Lyricli::Configuration (class)">Configuration</a></span> &lt; Object<small class='search_info'>Lyricli</small></li><li><span class='object_link'><a href="Lyricli/Lyricli.html" title="Lyricli::Lyricli (class)">Lyricli</a></span> &lt; Object<small class='search_info'>Lyricli</small></li><li><span class='object_link'><a href="Lyricli/LyricsEngine.html" title="Lyricli::LyricsEngine (class)">LyricsEngine</a></span> &lt; Object<small class='search_info'>Lyricli</small></li><li><span class='object_link'><a href="Lyricli/SourceManager.html" title="Lyricli::SourceManager (class)">SourceManager</a></span> &lt; Object<small class='search_info'>Lyricli</small></li><li><a class='toggle'></a> <span class='object_link'><a href="Lyricli/Sources.html" title="Lyricli::Sources (module)">Sources</a></span><small class='search_info'>Lyricli</small></li><ul><li><span class='object_link'><a href="Lyricli/Sources/Arguments.html" title="Lyricli::Sources::Arguments (class)">Arguments</a></span> &lt; Object<small class='search_info'>Lyricli::Sources</small></li><li><span class='object_link'><a href="Lyricli/Sources/Itunes.html" title="Lyricli::Sources::Itunes (class)">Itunes</a></span> &lt; Object<small class='search_info'>Lyricli::Sources</small></li><li><span class='object_link'><a href="Lyricli/Sources/Rdio.html" title="Lyricli::Sources::Rdio (class)">Rdio</a></span> &lt; Object<small class='search_info'>Lyricli::Sources</small></li></ul><li><span class='object_link'><a href="Lyricli/Util.html" title="Lyricli::Util (module)">Util</a></span><small class='search_info'>Lyricli</small></li></ul>
 
       </ul>
     </div>
index 1f6ffe35140bdd76343875b99ead7f762029c09b..9393d924b5d5901c6ccbd3d9e85dab5fef69e41e 100644 (file)
@@ -46,6 +46,9 @@
       <ul id="full_list" class="file">
         
 
+  <li class="r1"><a href="index.html" title="README">README</a></li>
+  
+
       </ul>
     </div>
   </body>
index a9e232bd4e157798dca12c9eb86e6d280b0b466e..892743ecde6002b3cbdafed5ebfc65ff5b81bbf1 100644 (file)
@@ -4,7 +4,7 @@
 <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>Documentation by YARD 0.8.1</title>
+       <title>Documentation by YARD 0.8.2.1</title>
 </head>
 <script type="text/javascript" charset="utf-8">
 window.onload = function() {
index 7d92f25d516f6258ff91a69ccbdeade825cd3579..87b6d5b70f114dc74b5db652b9087d4787017bde 100644 (file)
@@ -2,9 +2,11 @@
   "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" />
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
 <title>
-  Documentation by YARD 0.8.1
+  File: README
+  
+    &mdash; Documentation by YARD 0.8.2.1
   
 </title>
 
@@ -29,6 +31,9 @@
     <div id="header">
       <div id="menu">
   
+    <a href="_index.html">Index</a> &raquo; 
+    <span class="title">File: README</span>
+  
 
   <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
 </div>
 
     <iframe id="search_frame"></iframe>
 
-    <div id="content"><h1 class="noborder title">Documentation by YARD 0.8.1</h1>
-<div id="listing">
-  <h1 class="alphaindex">Alphabetic Index</h1>
-  
-<div class="clear"></div>
-<h2>Namespace Listing A-Z</h2>
-
-
-
-
-<table>
-  <tr>
-    <td valign='top' width="33%">
-      
-        
-        <ul id="alpha_A" class="alpha">
-          <li class="letter">A</li>
-          <ul>
-            
-              <li>
-                <span class='object_link'><a href="Lyricli/Sources/Arguments.html" title="Lyricli::Sources::Arguments (class)">Arguments</a></span>
-                
-                  <small>(Lyricli::Sources)</small>
-                
-              </li>
-            
-          </ul>
-        </ul>
-      
-        
-        <ul id="alpha_C" class="alpha">
-          <li class="letter">C</li>
-          <ul>
-            
-              <li>
-                <span class='object_link'><a href="Lyricli/Configuration.html" title="Lyricli::Configuration (class)">Configuration</a></span>
-                
-                  <small>(Lyricli)</small>
-                
-              </li>
-            
-          </ul>
-        </ul>
-      
-        
-        <ul id="alpha_L" class="alpha">
-          <li class="letter">L</li>
-          <ul>
-            
-              <li>
-                <span class='object_link'><a href="Lyricli/Lyricli.html" title="Lyricli::Lyricli (class)">Lyricli</a></span>
-                
-                  <small>(Lyricli)</small>
-                
-              </li>
-            
-              <li>
-                <span class='object_link'><a href="Lyricli.html" title="Lyricli (module)">Lyricli</a></span>
-                
-              </li>
-            
-              <li>
-                <span class='object_link'><a href="Lyricli/LyricsEngine.html" title="Lyricli::LyricsEngine (class)">LyricsEngine</a></span>
-                
-                  <small>(Lyricli)</small>
-                
-              </li>
-            
-          </ul>
-        </ul>
-      
-        
-        <ul id="alpha_R" class="alpha">
-          <li class="letter">R</li>
-          <ul>
-            
-              <li>
-                <span class='object_link'><a href="Lyricli/Sources/Rdio.html" title="Lyricli::Sources::Rdio (class)">Rdio</a></span>
-                
-                  <small>(Lyricli::Sources)</small>
-                
-              </li>
-            
-          </ul>
-        </ul>
-      
-        
-        <ul id="alpha_S" class="alpha">
-          <li class="letter">S</li>
-          <ul>
-            
-              <li>
-                <span class='object_link'><a href="Lyricli/SourceManager.html" title="Lyricli::SourceManager (class)">SourceManager</a></span>
-                
-                  <small>(Lyricli)</small>
-                
-              </li>
-            
-              <li>
-                <span class='object_link'><a href="Lyricli/Sources.html" title="Lyricli::Sources (module)">Sources</a></span>
-                
-                  <small>(Lyricli)</small>
-                
-              </li>
-            
-          </ul>
-        </ul>
-      
-        
-        <ul id="alpha_U" class="alpha">
-          <li class="letter">U</li>
-          <ul>
-            
-              <li>
-                <span class='object_link'><a href="Lyricli/Util.html" title="Lyricli::Util (module)">Util</a></span>
-                
-                  <small>(Lyricli)</small>
-                
-              </li>
-            
-          </ul>
-        </ul>
-      
-    </td>
-  </tr>
-</table>
+    <div id="content"><div id='filecontents'><h1>Lyricli</h1>
 
-</div>
+<h2>The command line client for lyrics</h2>
 
-</div>
+<p>This is a quick introduction for Lyricli. Right now it&#39;s in really early
+stages of development, so it&#39;s lacking in a lot of stuff (mainly tests
+and documentation) ... But it generally works and here&#39;s a tutorial to
+see how to get it working.</p>
+
+<h3>Installing</h3>
+
+<ol>
+<li>Clone this Repo</li>
+<li><code>gem build lyricli.gemspec</code></li>
+<li><code>gem install lyricli-0.0.1.gem</code></li>
+<li>Voila!</li>
+</ol>
+
+<h3>Usage</h3>
+
+<p>Lyricli can be invoked with the command <code>lrc</code> and there are three basic
+ways of using it:</p>
+
+<p><code>lrc</code></p>
+
+<p>When you run it without arguments, it will look in the available sources
+to try to find a playing song and extract the lyrics.</p>
+
+<p><code>lrc artist song</code></p>
+
+<p>When you run it with arguments, it will use them to search for the
+lyrics. This won&#39;t work if you manually disable the arguments source in
+your configuration file.</p>
+
+<h4>Commands</h4>
+
+<p>The third way to use it is by passing it one of the following special
+commands:</p>
+
+<ul>
+<li><code>lrc -l</code> or <code>lrc --list-sources</code> lists the available sources.</li>
+<li><code>lrc -e</code> or <code>lrc --enable SOURCE</code> enable a source from the list.</li>
+<li><code>lrc -d</code> or <code>lrc --disable SOURCE</code> disable a source from the list.</li>
+<li><code>lrc -r</code> or <code>lrc --reset SOURCE</code> reset all configuration for a source.</li>
+<li><code>lrc -v</code> or <code>lrc --version</code> show the installed version of lyricli.</li>
+<li><code>lrc -h</code> or <code>lrc --help</code> display some help</li>
+</ul>
+
+<h3>Roadmap</h3>
+
+<p>There is not much defined right now as a roadmap, but this needs to be
+done:</p>
+
+<ul>
+<li>Specs for all the components</li>
+<li>YARD documentation for all the components</li>
+</ul>
+
+<p>And the first thing I want to work on after that is done is separating
+the Lyrics Engines so we can add/remove lyrics engines in a similar way to how
+we currently add/remove sources.</p>
+
+<h3>Leave Feedback Please!</h3>
+
+<p>If you decide to use or hack away at Lyricly, please don&#39;t forget to
+post any issues you find.</p>
+
+<h3>License</h3>
+
+<p>Licensed under 3-clause-BSD.</p>
+</div></div>
 
     <div id="footer">
-  Generated on Fri Oct  5 22:31:14 2012 by
+  Generated on Sat Oct  6 02:05:50 2012 by
   <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
-  0.8.1 (ruby-1.9.2).
+  0.8.2.1 (ruby-1.9.2).
 </div>
 
   </body>
index 3bbd61ed42fbbcbaedbaf47aa47527d31b52dee2..c150289298c5acdcb0aa8afd7426bea8e56eada3 100644 (file)
@@ -103,28 +103,34 @@ function keyboardShortcuts() {
 
 function summaryToggle() {
   $('.summary_toggle').click(function() {
-    localStorage.summaryCollapsed = $(this).text();
-    $(this).text($(this).text() == "collapse" ? "expand" : "collapse");
-    var next = $(this).parent().parent().nextAll('ul.summary').first();
-    if (next.hasClass('compact')) {
-      next.toggle();
-      next.nextAll('ul.summary').first().toggle();
-    }
-    else if (next.hasClass('summary')) {
-      var list = $('<ul class="summary compact" />');
-      list.html(next.html());
-      list.find('.summary_desc, .note').remove();
-      list.find('a').each(function() {
-        $(this).html($(this).find('strong').html());
-        $(this).parent().html($(this)[0].outerHTML);
-      });
-      next.before(list);
-      next.toggle();
+    if (localStorage) {
+      localStorage.summaryCollapsed = $(this).text();
     }
+    $('.summary_toggle').each(function() {
+      $(this).text($(this).text() == "collapse" ? "expand" : "collapse");
+      var next = $(this).parent().parent().nextAll('ul.summary').first();
+      if (next.hasClass('compact')) {
+        next.toggle();
+        next.nextAll('ul.summary').first().toggle();
+      }
+      else if (next.hasClass('summary')) {
+        var list = $('<ul class="summary compact" />');
+        list.html(next.html());
+        list.find('.summary_desc, .note').remove();
+        list.find('a').each(function() {
+          $(this).html($(this).find('strong').html());
+          $(this).parent().html($(this)[0].outerHTML);
+        });
+        next.before(list);
+        next.toggle();
+      }
+    });
     return false;
   });
   if (localStorage) {
-    if (localStorage.summaryCollapsed == "collapse") $('.summary_toggle').click();
+    if (localStorage.summaryCollapsed == "collapse") {
+      $('.summary_toggle').first().click();
+    }
     else localStorage.summaryCollapsed = "expand";
   }
 }
index 638dd0bc321682613f2ee19169c0d34ec621188a..f731b8e91e08bde4d6ef451eaffddaa1c17fdde2 100644 (file)
   
 
   <li class="r1 ">
+    <span class='object_link'><a href="Lyricli/SourceManager.html#available_sources-instance_method" title="Lyricli::SourceManager#available_sources (method)">#available_sources</a></span>
+    
+      <small>Lyricli::SourceManager</small>
+    
+  </li>
+  
+
+  <li class="r2 ">
     <span class='object_link'><a href="Lyricli/Util.html#camelize-instance_method" title="Lyricli::Util#camelize (method)">#camelize</a></span>
     
       <small>Lyricli::Util</small>
@@ -70,7 +78,7 @@
   </li>
   
 
-  <li class="r2 ">
+  <li class="r1 ">
     <span class='object_link'><a href="Lyricli/Lyricli.html#check_params-instance_method" title="Lyricli::Lyricli#check_params (method)">#check_params</a></span>
     
       <small>Lyricli::Lyricli</small>
@@ -78,7 +86,7 @@
   </li>
   
 
-  <li class="r1 ">
+  <li class="r2 ">
     <span class='object_link'><a href="Lyricli/Sources/Rdio.html#create_auth_token-class_method" title="Lyricli::Sources::Rdio.create_auth_token (method)">create_auth_token</a></span>
     
       <small>Lyricli::Sources::Rdio</small>
   </li>
   
 
+  <li class="r1 ">
+    <span class='object_link'><a href="Lyricli/Sources/Rdio.html#current_track-instance_method" title="Lyricli::Sources::Rdio#current_track (method)">#current_track</a></span>
+    
+      <small>Lyricli::Sources::Rdio</small>
+    
+  </li>
+  
+
   <li class="r2 ">
     <span class='object_link'><a href="Lyricli/Sources/Arguments.html#current_track-instance_method" title="Lyricli::Sources::Arguments#current_track (method)">#current_track</a></span>
     
   
 
   <li class="r1 ">
-    <span class='object_link'><a href="Lyricli/SourceManager.html#current_track-instance_method" title="Lyricli::SourceManager#current_track (method)">#current_track</a></span>
+    <span class='object_link'><a href="Lyricli/Sources/Itunes.html#current_track-instance_method" title="Lyricli::Sources::Itunes#current_track (method)">#current_track</a></span>
     
-      <small>Lyricli::SourceManager</small>
+      <small>Lyricli::Sources::Itunes</small>
     
   </li>
   
 
   <li class="r2 ">
-    <span class='object_link'><a href="Lyricli/Sources/Rdio.html#current_track-instance_method" title="Lyricli::Sources::Rdio#current_track (method)">#current_track</a></span>
+    <span class='object_link'><a href="Lyricli/SourceManager.html#current_track-instance_method" title="Lyricli::SourceManager#current_track (method)">#current_track</a></span>
     
-      <small>Lyricli::Sources::Rdio</small>
+      <small>Lyricli::SourceManager</small>
     
   </li>
   
 
   <li class="r1 ">
+    <span class='object_link'><a href="Lyricli/Configuration.html#delete-instance_method" title="Lyricli::Configuration#delete (method)">#delete</a></span>
+    
+      <small>Lyricli::Configuration</small>
+    
+  </li>
+  
+
+  <li class="r2 ">
     <span class='object_link'><a href="Lyricli/SourceManager.html#disable-instance_method" title="Lyricli::SourceManager#disable (method)">#disable</a></span>
     
       <small>Lyricli::SourceManager</small>
   </li>
   
 
+  <li class="r1 ">
+    <span class='object_link'><a href="Lyricli.html#disable-class_method" title="Lyricli.disable (method)">disable</a></span>
+    
+      <small>Lyricli</small>
+    
+  </li>
+  
+
   <li class="r2 ">
-    <span class='object_link'><a href="Lyricli/SourceManager.html#enable-instance_method" title="Lyricli::SourceManager#enable (method)">#enable</a></span>
+    <span class='object_link'><a href="Lyricli/Sources/Itunes.html#enable-class_method" title="Lyricli::Sources::Itunes.enable (method)">enable</a></span>
     
-      <small>Lyricli::SourceManager</small>
+      <small>Lyricli::Sources::Itunes</small>
     
   </li>
   
   
 
   <li class="r2 ">
-    <span class='object_link'><a href="Lyricli/Sources/Rdio.html#enable-class_method" title="Lyricli::Sources::Rdio.enable (method)">enable</a></span>
+    <span class='object_link'><a href="Lyricli.html#enable-class_method" title="Lyricli.enable (method)">enable</a></span>
     
-      <small>Lyricli::Sources::Rdio</small>
+      <small>Lyricli</small>
     
   </li>
   
 
   <li class="r1 ">
-    <span class='object_link'><a href="Lyricli.html#execute-class_method" title="Lyricli.execute (method)">execute</a></span>
+    <span class='object_link'><a href="Lyricli/SourceManager.html#enable-instance_method" title="Lyricli::SourceManager#enable (method)">#enable</a></span>
     
-      <small>Lyricli</small>
+      <small>Lyricli::SourceManager</small>
     
   </li>
   
 
   <li class="r2 ">
+    <span class='object_link'><a href="Lyricli/Sources/Rdio.html#enable-class_method" title="Lyricli::Sources::Rdio.enable (method)">enable</a></span>
+    
+      <small>Lyricli::Sources::Rdio</small>
+    
+  </li>
+  
+
+  <li class="r1 ">
     <span class='object_link'><a href="Lyricli/Lyricli.html#exit_with_error-instance_method" title="Lyricli::Lyricli#exit_with_error (method)">#exit_with_error</a></span>
     
       <small>Lyricli::Lyricli</small>
   </li>
   
 
+  <li class="r2 ">
+    <span class='object_link'><a href="Lyricli/SourceManager.html#format_sources-instance_method" title="Lyricli::SourceManager#format_sources (method)">#format_sources</a></span>
+    
+      <small>Lyricli::SourceManager</small>
+    
+  </li>
+  
+
   <li class="r1 ">
     <span class='object_link'><a href="Lyricli/Lyricli.html#get_lyrics-instance_method" title="Lyricli::Lyricli#get_lyrics (method)">#get_lyrics</a></span>
     
   
 
   <li class="r1 ">
-    <span class='object_link'><a href="Lyricli/SourceManager.html#initialize-instance_method" title="Lyricli::SourceManager#initialize (method)">#initialize</a></span>
+    <span class='object_link'><a href="Lyricli/Sources/Rdio.html#initialize-instance_method" title="Lyricli::Sources::Rdio#initialize (method)">#initialize</a></span>
     
-      <small>Lyricli::SourceManager</small>
+      <small>Lyricli::Sources::Rdio</small>
     
   </li>
   
 
   <li class="r2 ">
-    <span class='object_link'><a href="Lyricli/Configuration.html#initialize-instance_method" title="Lyricli::Configuration#initialize (method)">#initialize</a></span>
+    <span class='object_link'><a href="Lyricli/SourceManager.html#initialize-instance_method" title="Lyricli::SourceManager#initialize (method)">#initialize</a></span>
     
-      <small>Lyricli::Configuration</small>
+      <small>Lyricli::SourceManager</small>
     
   </li>
   
 
   <li class="r1 ">
-    <span class='object_link'><a href="Lyricli/Sources/Arguments.html#initialize-instance_method" title="Lyricli::Sources::Arguments#initialize (method)">#initialize</a></span>
+    <span class='object_link'><a href="Lyricli/Configuration.html#initialize-instance_method" title="Lyricli::Configuration#initialize (method)">#initialize</a></span>
     
-      <small>Lyricli::Sources::Arguments</small>
+      <small>Lyricli::Configuration</small>
     
   </li>
   
   
 
   <li class="r1 ">
-    <span class='object_link'><a href="Lyricli/Sources/Rdio.html#initialize-instance_method" title="Lyricli::Sources::Rdio#initialize (method)">#initialize</a></span>
+    <span class='object_link'><a href="Lyricli/LyricsEngine.html#initialize-instance_method" title="Lyricli::LyricsEngine#initialize (method)">#initialize</a></span>
     
-      <small>Lyricli::Sources::Rdio</small>
+      <small>Lyricli::LyricsEngine</small>
     
   </li>
   
 
   <li class="r2 ">
-    <span class='object_link'><a href="Lyricli/LyricsEngine.html#initialize-instance_method" title="Lyricli::LyricsEngine#initialize (method)">#initialize</a></span>
+    <span class='object_link'><a href="Lyricli/Sources/Itunes.html#initialize-instance_method" title="Lyricli::Sources::Itunes#initialize (method)">#initialize</a></span>
     
-      <small>Lyricli::LyricsEngine</small>
+      <small>Lyricli::Sources::Itunes</small>
     
   </li>
   
 
   <li class="r1 ">
+    <span class='object_link'><a href="Lyricli/Sources/Arguments.html#initialize-instance_method" title="Lyricli::Sources::Arguments#initialize (method)">#initialize</a></span>
+    
+      <small>Lyricli::Sources::Arguments</small>
+    
+  </li>
+  
+
+  <li class="r2 ">
     <span class='object_link'><a href="Lyricli/Configuration.html#instance-class_method" title="Lyricli::Configuration.instance (method)">instance</a></span>
     
       <small>Lyricli::Configuration</small>
   </li>
   
 
+  <li class="r1 ">
+    <span class='object_link'><a href="Lyricli/Configuration.html#load_config-instance_method" title="Lyricli::Configuration#load_config (method)">#load_config</a></span>
+    
+      <small>Lyricli::Configuration</small>
+    
+  </li>
+  
+
   <li class="r2 ">
+    <span class='object_link'><a href="Lyricli.html#lyrics-class_method" title="Lyricli.lyrics (method)">lyrics</a></span>
+    
+      <small>Lyricli</small>
+    
+  </li>
+  
+
+  <li class="r1 ">
     <span class='object_link'><a href="Lyricli/Sources/Rdio.html#name-class_method" title="Lyricli::Sources::Rdio.name (method)">name</a></span>
     
       <small>Lyricli::Sources::Rdio</small>
   </li>
   
 
-  <li class="r1 ">
+  <li class="r2 ">
     <span class='object_link'><a href="Lyricli/Sources/Arguments.html#name-class_method" title="Lyricli::Sources::Arguments.name (method)">name</a></span>
     
       <small>Lyricli::Sources::Arguments</small>
   </li>
   
 
+  <li class="r1 ">
+    <span class='object_link'><a href="Lyricli/Sources/Itunes.html#name-class_method" title="Lyricli::Sources::Itunes.name (method)">name</a></span>
+    
+      <small>Lyricli::Sources::Itunes</small>
+    
+  </li>
+  
+
   <li class="r2 ">
     <span class='object_link'><a href="Lyricli/Util.html#parse_class-instance_method" title="Lyricli::Util#parse_class (method)">#parse_class</a></span>
     
   
 
   <li class="r1 ">
+    <span class='object_link'><a href="Lyricli/Sources/Rdio.html#reset-class_method" title="Lyricli::Sources::Rdio.reset (method)">reset</a></span>
+    
+      <small>Lyricli::Sources::Rdio</small>
+    
+  </li>
+  
+
+  <li class="r2 ">
     <span class='object_link'><a href="Lyricli/SourceManager.html#reset-instance_method" title="Lyricli::SourceManager#reset (method)">#reset</a></span>
     
       <small>Lyricli::SourceManager</small>
   </li>
   
 
+  <li class="r1 ">
+    <span class='object_link'><a href="Lyricli.html#reset-class_method" title="Lyricli.reset (method)">reset</a></span>
+    
+      <small>Lyricli</small>
+    
+  </li>
+  
+
   <li class="r2 ">
-    <span class='object_link'><a href="Lyricli/Sources/Arguments.html#reset-class_method" title="Lyricli::Sources::Arguments.reset (method)">reset</a></span>
+    <span class='object_link'><a href="Lyricli/Sources/Itunes.html#reset-class_method" title="Lyricli::Sources::Itunes.reset (method)">reset</a></span>
     
-      <small>Lyricli::Sources::Arguments</small>
+      <small>Lyricli::Sources::Itunes</small>
     
   </li>
   
 
   <li class="r1 ">
-    <span class='object_link'><a href="Lyricli/Sources/Rdio.html#reset-class_method" title="Lyricli::Sources::Rdio.reset (method)">reset</a></span>
+    <span class='object_link'><a href="Lyricli/Sources/Arguments.html#reset-class_method" title="Lyricli::Sources::Arguments.reset (method)">reset</a></span>
     
-      <small>Lyricli::Sources::Rdio</small>
+      <small>Lyricli::Sources::Arguments</small>
     
   </li>
   
   
 
   <li class="r1 ">
+    <span class='object_link'><a href="Lyricli/Configuration.html#save_config-instance_method" title="Lyricli::Configuration#save_config (method)">#save_config</a></span>
+    
+      <small>Lyricli::Configuration</small>
+    
+  </li>
+  
+
+  <li class="r2 ">
     <span class='object_link'><a href="Lyricli/Lyricli.html#set_current_track-instance_method" title="Lyricli::Lyricli#set_current_track (method)">#set_current_track</a></span>
     
       <small>Lyricli::Lyricli</small>
   </li>
   
 
+  <li class="r1 ">
+    <span class='object_link'><a href="Lyricli.html#sources-class_method" title="Lyricli.sources (method)">sources</a></span>
+    
+      <small>Lyricli</small>
+    
+  </li>
+  
+
+  <li class="r2 ">
+    <span class='object_link'><a href="Lyricli.html#version-class_method" title="Lyricli.version (method)">version</a></span>
+    
+      <small>Lyricli</small>
+    
+  </li>
+  
+
       </ul>
     </div>
   </body>
index 236d9d1daffc3457b58796111799b46a8e44f398..9f9bf14f5ca508ff11cd15936afee0b311ece04b 100644 (file)
@@ -6,7 +6,7 @@
 <title>
   Top Level Namespace
   
-    &mdash; Documentation by YARD 0.8.1
+    &mdash; Documentation by YARD 0.8.2.1
   
 </title>
 
 </div>
 
     <div id="footer">
-  Generated on Fri Oct  5 22:31:14 2012 by
+  Generated on Sat Oct  6 02:05:51 2012 by
   <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
-  0.8.1 (ruby-1.9.2).
+  0.8.2.1 (ruby-1.9.2).
 </div>
 
   </body>
index 557fa3bc331dc65806360374bfc2861e3af07f4b..1c908b0f1bce666553e266f3b89e9fa4e404685f 100755 (executable)
@@ -39,21 +39,26 @@ module Lyricli
   end
 
   # Returns a list of the available sources to enable or disable
+  # @return [String] the list of available sources. Enabled sources have
+  #                   a star appended.
   def self.sources
     source_manager = SourceManager.new
     source_manager.available_sources(true).join(", ")
   end
 
+  # Enables a source via the Source Manager
   def self.enable(source_name)
     source_manager = SourceManager.new
     source_manager.enable(source_name)
   end
 
+  # Disables a source via the Source Manager
   def self.disable(source_name)
     source_manager = SourceManager.new
     source_manager.disable(source_name)
   end
 
+  # Resets all configuration for a source via the Source Manager
   def self.reset(source_name)
     source_manager = SourceManager.new
     source_manager.reset(source_name)
index 031101720bc87ee74b6bbdec421fb5908cec1cfd..720070ced8181acaa438851a009429e927dbc6a3 100644 (file)
@@ -1,6 +1,9 @@
 module Lyricli
+
+  # This class handles the configuration of Lyricli
   class Configuration
 
+    # Defines the paths to the default and user configuration files
     def initialize
       @config_path = "~/.lyricli.conf"
       @defaults_path = "defaults.json"
@@ -9,21 +12,37 @@ module Lyricli
 
     @@instance = Configuration.new
 
+    # Ensure this is only called once. Only use the instance class variable
+    # to access this method, as its constructor is private.
     def self.instance
       @@instance
     end
 
+    # Access configuration properties, loads config if needed beforehand.
+    #
+    # @param [String] key the configuration key to access
+    # @return [String, Hash, Array] the value of the configuration key.
     def [](key)
       load_config unless @config
       @config[key]
     end
 
+    # Assigns a new value to a configuration key, loads config if needed and
+    # saves it after updating.
+    #
+    # @param [String] key the configuration key to set
+    # @param [Object] value the value for the configuration key, can be any
+    #                 object as long as it can be converted to JSON
     def []=(key, value)
       load_config unless @config
       @config[key] = value
       save_config
     end
 
+    # Deletes a key from the configuration, loads config if needed and saves
+    # it after deleting.
+    #
+    # @param [String] key the key to delete
     def delete(key)
       load_config unless @config
       @config.delete(key)
@@ -32,8 +51,8 @@ module Lyricli
 
     private_class_method :new
 
-    # TODO: Apart from this, load a default yml that will be used for this.
-    # And just extend everything from the user's config.
+    # Loads the configuration from the user file, attempts to create it from
+    # defaults if it's not present. sets the `@config` instance variable.
     def load_config
       path = File.expand_path(@config_path)
 
@@ -45,6 +64,7 @@ module Lyricli
       end
     end
 
+    # Serializes the `@config` Hash to JSON and saves it to a file.
     def save_config
       path = File.expand_path(@config_path)
       file = File.new(path, "w")
@@ -54,6 +74,7 @@ module Lyricli
 
     private
 
+    # Loads the default configuration from a JSON file
     def load_default_config
       # Load the default
       path_root = File.expand_path(File.dirname(__FILE__))
index 06302f50948080335de90fd65303485826ba4d1f..518db2df8d380f7671d58c8986c931eb6b8afa1c 100644 (file)
@@ -1,14 +1,26 @@
 module Lyricli
+
+  # This class has the basic logic for extracting the lyrics and controlling the
+  # application
   class Lyricli
 
+    # Constructor, initializes `@source_manager`
     def initialize
       @source_manager = SourceManager.new
     end
 
+    # Raises an InvalidLyricsException which means we did not get any valid
+    # artist/song from any of the sources
+    #
+    # @raise [Lyricli::InvalidLyricsException] because we found nothing
     def exit_with_error
-      raise InvalidLyrics
+      raise InvalidLyricsException
     end
 
+    # Extracts the current track, validates it and requests the lyrics from our
+    # LyricsEngine
+    #
+    # @return [String] the found lyrics, or a string indicating none were found
     def get_lyrics
       set_current_track
       check_params
@@ -22,10 +34,13 @@ module Lyricli
       end
     end
 
+    # Set the `@current_track` instance variable by asking the SourceManager for
+    # its current track
     def set_current_track
       @current_track = @source_manager.current_track
     end
 
+    # Exits with error when there is an empty field from the current track.
     def check_params
       self.exit_with_error if @current_track[:artist].nil? or @current_track[:artist].empty?
       self.exit_with_error if @current_track[:song].nil? or @current_track[:song].empty?
index e7dcfc776156ccb917efe460d2fac54713a1514d..e7320d0d761f6be4e49b68699d2097a1177b240b 100644 (file)
@@ -1,9 +1,20 @@
 module Lyricli
+  # This module contains several utility functions.
   module Util
+
+    # Transforms a string from snake_case to UpperCamelCase
+    #
+    # @param [String] str the string that will be Camelized
+    # @return [String] the Camelized string.
     def camelize(str)
       str.split('_').map {|w| w.capitalize}.join
     end
 
+    # Takes a class name in snake_case and attempts to find the corresponding
+    # class from the sources.
+    #
+    # @param [String] class_name the snake_case name of the class to search for.
+    # @return [Class,nil] the found class or nil
     def parse_class(class_name)
       begin
         path = "Sources::#{class_name}"
@@ -13,6 +24,11 @@ module Lyricli
       end
     end
 
+    # Simply escapes a param and substitutes spaces and escaped plus signs for
+    # plus signs.
+    #
+    # @param [String] p the parameter to be sanitized
+    # @return [String] the sanitized parameter
     def sanitize_param(p)
       URI.encode_www_form_component(p.gsub(/ /, "+")).gsub("%2B", "+")
     end