<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/lyricli.rb,<br /> lib/lyricli/sources.rb,<br /> lib/lyricli/exceptions.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>
+ lib/lyricli/util.rb,<br /> lib/lyricli/sources.rb,<br /> lib/lyricli/lyricli.rb,<br /> lib/lyricli/exceptions.rb,<br /> lib/lyricli/sources/rdio.rb,<br /> lib/lyricli/configuration.rb,<br /> lib/lyricli/lyrics_engine.rb,<br /> lib/lyricli/sources/itunes.rb,<br /> lib/lyricli/source_manager.rb,<br /> lib/lyricli/sources/arguments.rb,<br /> lib/lyricli/exceptions/reset_source_error.rb,<br /> lib/lyricli/exceptions/start_source_error.rb,<br /> lib/lyricli/exceptions/enable_source_error.rb,<br /> lib/lyricli/exceptions/unknown_source_error.rb,<br /> lib/lyricli/exceptions/invalid_lyrics_error.rb,<br /> lib/lyricli/exceptions/disable_source_error.rb,<br /> lib/lyricli/exceptions/lyrics_not_found_error.rb,<br /> lib/lyricli/exceptions/source_configuration_error.rb</span>
</dd>
</dl>
<pre class="lines">
-56
-57
-58
-59</pre>
+70
+71
+72
+73
+74
+75
+76
+77</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'lib/lyricli.rb', line 56</span>
+ <pre class="code"><span class="info file"># File 'lib/lyricli.rb', line 70</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'>begin</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'>rescue</span> <span class='const'>Exceptions</span><span class='op'>::</span><span class='const'>UnknownSourceError</span>
+ <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>There is no such Source</span><span class='tstring_end'>"</span></span>
+ <span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
<pre class="lines">
-50
-51
-52
-53</pre>
+60
+61
+62
+63
+64
+65
+66
+67</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'lib/lyricli.rb', line 50</span>
+ <pre class="code"><span class="info file"># File 'lib/lyricli.rb', line 60</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'>begin</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'>rescue</span> <span class='const'>Exceptions</span><span class='op'>::</span><span class='const'>UnknownSourceError</span>
+ <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>There is no such Source</span><span class='tstring_end'>"</span></span>
+ <span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
<pre class="lines">
-30
-31
-32
-33</pre>
+40
+41
+42
+43</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'lib/lyricli.rb', line 30</span>
+ <pre class="code"><span class="info file"># File 'lib/lyricli.rb', line 40</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>
<pre class="lines">
-62
-63
-64
-65</pre>
+80
+81
+82
+83
+84
+85
+86
+87</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'lib/lyricli.rb', line 62</span>
+ <pre class="code"><span class="info file"># File 'lib/lyricli.rb', line 80</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'>begin</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'>rescue</span> <span class='const'>Exceptions</span><span class='op'>::</span><span class='const'>UnknownSourceError</span>
+ <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>There is no such Source</span><span class='tstring_end'>"</span></span>
+ <span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
<pre class="lines">
-44
-45
-46
-47</pre>
+54
+55
+56
+57</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.rb', line 54</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>
<pre class="lines">
-37
-38
-39</pre>
+47
+48
+49</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'lib/lyricli.rb', line 37</span>
+ <pre class="code"><span class="info file"># File 'lib/lyricli.rb', line 47</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'>"</span><span class='tstring_content'>lyricli</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_version'>version</span>
</div>
<div id="footer">
- Generated on Sat Oct 6 02:34:27 2012 by
+ Generated on Sat Oct 6 03:20:24 2012 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.8.2.1 (ruby-1.9.2).
</div>
</div>
<div id="footer">
- Generated on Sat Oct 6 02:34:27 2012 by
+ Generated on Sat Oct 6 03:20:24 2012 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.8.2.1 (ruby-1.9.2).
</div>
<dt class="r1 last">Defined in:</dt>
- <dd class="r1 last">lib/lyricli/exceptions.rb</dd>
+ <dd class="r1 last">lib/lyricli/exceptions.rb<span class="defines">,<br />
+ lib/lyricli/exceptions/reset_source_error.rb,<br /> lib/lyricli/exceptions/start_source_error.rb,<br /> lib/lyricli/exceptions/enable_source_error.rb,<br /> lib/lyricli/exceptions/unknown_source_error.rb,<br /> lib/lyricli/exceptions/invalid_lyrics_error.rb,<br /> lib/lyricli/exceptions/disable_source_error.rb,<br /> lib/lyricli/exceptions/lyrics_not_found_error.rb,<br /> lib/lyricli/exceptions/source_configuration_error.rb</span>
+</dd>
</dl>
<div class="clear"></div>
<div class="tags">
-</div>
+</div><h2>Defined Under Namespace</h2>
+<p class="children">
+
+
+
+
+ <strong class="classes">Classes:</strong> <span class='object_link'><a href="Exceptions/DisableSourceError.html" title="Lyricli::Exceptions::DisableSourceError (class)">DisableSourceError</a></span>, <span class='object_link'><a href="Exceptions/EnableSourceError.html" title="Lyricli::Exceptions::EnableSourceError (class)">EnableSourceError</a></span>, <span class='object_link'><a href="Exceptions/InvalidLyricsError.html" title="Lyricli::Exceptions::InvalidLyricsError (class)">InvalidLyricsError</a></span>, <span class='object_link'><a href="Exceptions/LyricsNotFoundError.html" title="Lyricli::Exceptions::LyricsNotFoundError (class)">LyricsNotFoundError</a></span>, <span class='object_link'><a href="Exceptions/ResetSourceError.html" title="Lyricli::Exceptions::ResetSourceError (class)">ResetSourceError</a></span>, <span class='object_link'><a href="Exceptions/SourceConfigurationError.html" title="Lyricli::Exceptions::SourceConfigurationError (class)">SourceConfigurationError</a></span>, <span class='object_link'><a href="Exceptions/StartSourceError.html" title="Lyricli::Exceptions::StartSourceError (class)">StartSourceError</a></span>, <span class='object_link'><a href="Exceptions/UnknownSourceError.html" title="Lyricli::Exceptions::UnknownSourceError (class)">UnknownSourceError</a></span>
+
+
+</p>
+
</div>
<div id="footer">
- Generated on Sat Oct 6 02:34:27 2012 by
+ Generated on Sat Oct 6 03:20:24 2012 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.8.2.1 (ruby-1.9.2).
</div>
<span class="summary_desc"><div class='inline'><p>
-Raises an InvalidLyricsException which means we did not get any valid
+Raises an InvalidLyricsError which means we did not get any valid
artist/song from any of the sources.
</p>
</div></span>
<pre class="lines">
-44
-45
-46
-47</pre>
+49
+50
+51
+52
+53</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'lib/lyricli/lyricli.rb', line 44</span>
+ <pre class="code"><span class="info file"># File 'lib/lyricli/lyricli.rb', line 49</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'>unless</span> <span class='ivar'>@current_track</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>
<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'>:song</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'>:song</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
<span class='kw'>end</span></pre>
</h3><div class="docstring">
<div class="discussion">
<p>
-Raises an InvalidLyricsException which means we did not get any valid
+Raises an InvalidLyricsError which means we did not get any valid
artist/song from any of the sources
</p>
<li>
- <span class='type'>(<tt>Lyricli::InvalidLyricsException</tt>)</span>
+ <span class='type'>(<tt><span class='object_link'><a href="Exceptions/InvalidLyricsError.html" title="Lyricli::Exceptions::InvalidLyricsError (class)">Lyricli::Exceptions::InvalidLyricsError</a></span></tt>)</span>
<pre class="code"><span class="info file"># File 'lib/lyricli/lyricli.rb', line 16</span>
<span class='kw'>def</span> <span class='id identifier rubyid_exit_with_error'>exit_with_error</span>
- <span class='id identifier rubyid_raise'>raise</span> <span class='const'>InvalidLyricsException</span>
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'>Exceptions</span><span class='op'>::</span><span class='const'>InvalidLyricsError</span>
<span class='kw'>end</span></pre>
</td>
</tr>
32
33
34
-35</pre>
+35
+36
+37
+38
+39
+40</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/lyricli/lyricli.rb', line 24</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>
- <span class='id identifier rubyid_check_params'>check_params</span>
+
+ <span class='kw'>begin</span>
+ <span class='id identifier rubyid_set_current_track'>set_current_track</span>
+ <span class='id identifier rubyid_check_params'>check_params</span>
+ <span class='kw'>rescue</span> <span class='const'>Exceptions</span><span class='op'>::</span><span class='const'>InvalidLyricsError</span>
+ <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>No Artist/Song could be found :(</span><span class='tstring_end'>"</span></span>
+ <span class='kw'>end</span>
<span class='id identifier rubyid_engine'>engine</span> <span class='op'>=</span> <span class='const'>LyricsEngine</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='ivar'>@current_track</span><span class='lbracket'>[</span><span class='symbol'>:artist</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='ivar'>@current_track</span><span class='lbracket'>[</span><span class='symbol'>:song</span><span class='rbracket'>]</span><span class='rparen'>)</span>
<span class='kw'>begin</span>
- <span class='id identifier rubyid_engine'>engine</span><span class='period'>.</span><span class='id identifier rubyid_get_lyrics'>get_lyrics</span>
- <span class='kw'>rescue</span> <span class='const'>LyricsNotFoundException</span>
- <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Lyrics not found :(</span><span class='tstring_end'>"</span></span>
+ <span class='kw'>return</span> <span class='id identifier rubyid_engine'>engine</span><span class='period'>.</span><span class='id identifier rubyid_get_lyrics'>get_lyrics</span>
+ <span class='kw'>rescue</span> <span class='const'>Exceptions</span><span class='op'>::</span><span class='const'>LyricsNotFoundError</span>
+ <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Lyrics not found :(</span><span class='tstring_end'>"</span></span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
<pre class="lines">
-39
-40
-41</pre>
+44
+45
+46</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'lib/lyricli/lyricli.rb', line 39</span>
+ <pre class="code"><span class="info file"># File 'lib/lyricli/lyricli.rb', line 44</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>
</div>
<div id="footer">
- Generated on Sat Oct 6 02:34:27 2012 by
+ Generated on Sat Oct 6 03:20:24 2012 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.8.2.1 (ruby-1.9.2).
</div>
<span class='id identifier rubyid_doc'>doc</span> <span class='op'>=</span> <span class='const'>Nokogiri</span><span class='op'>::</span><span class='const'>HTML</span><span class='lparen'>(</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>url</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='rparen'>)</span>
<span class='id identifier rubyid_node'>node</span> <span class='op'>=</span> <span class='id identifier rubyid_doc'>doc</span><span class='period'>.</span><span class='id identifier rubyid_search'>search</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>.lyricbox</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
<span class='kw'>rescue</span>
- <span class='id identifier rubyid_raise'>raise</span> <span class='const'>Lyricli</span><span class='op'>::</span><span class='const'>LyricsNotFoundException</span>
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'>Exceptions</span><span class='op'>::</span><span class='const'>LyricsNotFoundError</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_node'>node</span><span class='period'>.</span><span class='id identifier rubyid_search'>search</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>.rtMatcher</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_n'>n</span><span class='op'>|</span>
</div>
<div id="footer">
- Generated on Sat Oct 6 02:34:27 2012 by
+ Generated on Sat Oct 6 03:20:24 2012 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.8.2.1 (ruby-1.9.2).
</div>
<span class='id identifier rubyid_current_source'>current_source</span> <span class='op'>=</span> <span class='id identifier rubyid_klass'>klass</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
<span class='ivar'>@enabled_sources</span> <span class='op'><<</span> <span class='id identifier rubyid_current_source'>current_source</span>
<span class='kw'>else</span>
- <span class='id identifier rubyid_raise'>raise</span> <span class='const'>StartSourceException</span>
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'>Exceptions</span><span class='op'>::</span><span class='const'>StartSourceError</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
<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'>"</span><span class='tstring_content'>arguments</span><span class='tstring_end'>"</span></span>
<span class='kw'>end</span>
<span class='kw'>rescue</span>
- <span class='id identifier rubyid_raise'>raise</span> <span class='const'>SourceConfigurationException</span>
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'>Exceptions</span><span class='op'>::</span><span class='const'>SourceConfigurationError</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_track'>track</span>
<span class='ivar'>@config</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>enabled_sources</span><span class='tstring_end'>"</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='id identifier rubyid_raise'>raise</span> <span class='const'>Exceptions</span><span class='op'>::</span><span class='const'>DisableSourceError</span>
<span class='kw'>end</span>
<span class='kw'>else</span>
- <span class='id identifier rubyid_raise'>raise</span> <span class='const'>UnknownSource</span>
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'>Exceptions</span><span class='op'>::</span><span class='const'>UnknownSourceError</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
<span class='ivar'>@config</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>enabled_sources</span><span class='tstring_end'>"</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='id identifier rubyid_raise'>raise</span> <span class='const'>Exceptions</span><span class='op'>::</span><span class='const'>EnableSourceError</span>
<span class='kw'>end</span>
<span class='kw'>else</span>
- <span class='id identifier rubyid_raise'>raise</span> <span class='const'>UnknownSource</span>
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'>Exceptions</span><span class='op'>::</span><span class='const'>UnknownSourceError</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
<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='id identifier rubyid_raise'>raise</span> <span class='const'>Exceptions</span><span class='op'>::</span><span class='const'>ResetSourceError</span>
<span class='kw'>end</span>
<span class='kw'>else</span>
- <span class='id identifier rubyid_raise'>raise</span> <span class='const'>UnknownSource</span>
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'>Exceptions</span><span class='op'>::</span><span class='const'>UnknownSourceError</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</div>
<div id="footer">
- Generated on Sat Oct 6 02:34:27 2012 by
+ Generated on Sat Oct 6 03:20:24 2012 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.8.2.1 (ruby-1.9.2).
</div>
</div>
<div id="footer">
- Generated on Sat Oct 6 02:34:27 2012 by
+ Generated on Sat Oct 6 03:20:24 2012 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.8.2.1 (ruby-1.9.2).
</div>
</div>
<div id="footer">
- Generated on Sat Oct 6 02:34:27 2012 by
+ Generated on Sat Oct 6 03:20:24 2012 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.8.2.1 (ruby-1.9.2).
</div>
</div>
<div id="footer">
- Generated on Sat Oct 6 02:34:27 2012 by
+ Generated on Sat Oct 6 03:20:24 2012 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.8.2.1 (ruby-1.9.2).
</div>
</div>
<div id="footer">
- Generated on Sat Oct 6 02:34:27 2012 by
+ Generated on Sat Oct 6 03:20:24 2012 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.8.2.1 (ruby-1.9.2).
</div>
</div>
<div id="footer">
- Generated on Sat Oct 6 02:34:27 2012 by
+ Generated on Sat Oct 6 03:20:24 2012 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.8.2.1 (ruby-1.9.2).
</div>
</ul>
+ <ul id="alpha_D" class="alpha">
+ <li class="letter">D</li>
+ <ul>
+
+ <li>
+ <span class='object_link'><a href="Lyricli/Exceptions/DisableSourceError.html" title="Lyricli::Exceptions::DisableSourceError (class)">DisableSourceError</a></span>
+
+ <small>(Lyricli::Exceptions)</small>
+
+ </li>
+
+ </ul>
+ </ul>
+
+
<ul id="alpha_E" class="alpha">
<li class="letter">E</li>
<ul>
+ <li>
+ <span class='object_link'><a href="Lyricli/Exceptions/EnableSourceError.html" title="Lyricli::Exceptions::EnableSourceError (class)">EnableSourceError</a></span>
+
+ <small>(Lyricli::Exceptions)</small>
+
+ </li>
+
<li>
<span class='object_link'><a href="Lyricli/Exceptions.html" title="Lyricli::Exceptions (module)">Exceptions</a></span>
<li class="letter">I</li>
<ul>
+ <li>
+ <span class='object_link'><a href="Lyricli/Exceptions/InvalidLyricsError.html" title="Lyricli::Exceptions::InvalidLyricsError (class)">InvalidLyricsError</a></span>
+
+ <small>(Lyricli::Exceptions)</small>
+
+ </li>
+
<li>
<span class='object_link'><a href="Lyricli/Sources/Itunes.html" title="Lyricli::Sources::Itunes (class)">Itunes</a></span>
</li>
+ <li>
+ <span class='object_link'><a href="Lyricli/Exceptions/LyricsNotFoundError.html" title="Lyricli::Exceptions::LyricsNotFoundError (class)">LyricsNotFoundError</a></span>
+
+ <small>(Lyricli::Exceptions)</small>
+
+ </li>
+
</ul>
</ul>
</li>
+ <li>
+ <span class='object_link'><a href="Lyricli/Exceptions/ResetSourceError.html" title="Lyricli::Exceptions::ResetSourceError (class)">ResetSourceError</a></span>
+
+ <small>(Lyricli::Exceptions)</small>
+
+ </li>
+
</ul>
</ul>
+ </td><td valign='top' width="33%">
+
+
<ul id="alpha_S" class="alpha">
<li class="letter">S</li>
<ul>
+ <li>
+ <span class='object_link'><a href="Lyricli/Exceptions/SourceConfigurationError.html" title="Lyricli::Exceptions::SourceConfigurationError (class)">SourceConfigurationError</a></span>
+
+ <small>(Lyricli::Exceptions)</small>
+
+ </li>
+
<li>
<span class='object_link'><a href="Lyricli/SourceManager.html" title="Lyricli::SourceManager (class)">SourceManager</a></span>
</li>
+ <li>
+ <span class='object_link'><a href="Lyricli/Exceptions/StartSourceError.html" title="Lyricli::Exceptions::StartSourceError (class)">StartSourceError</a></span>
+
+ <small>(Lyricli::Exceptions)</small>
+
+ </li>
+
</ul>
</ul>
- </td><td valign='top' width="33%">
-
-
<ul id="alpha_U" class="alpha">
<li class="letter">U</li>
<ul>
+ <li>
+ <span class='object_link'><a href="Lyricli/Exceptions/UnknownSourceError.html" title="Lyricli::Exceptions::UnknownSourceError (class)">UnknownSourceError</a></span>
+
+ <small>(Lyricli::Exceptions)</small>
+
+ </li>
+
<li>
<span class='object_link'><a href="Lyricli/Util.html" title="Lyricli::Util (module)">Util</a></span>
</div>
<div id="footer">
- Generated on Sat Oct 6 02:34:26 2012 by
+ Generated on Sat Oct 6 03:20:24 2012 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.8.2.1 (ruby-1.9.2).
</div>
<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> < Object<small class='search_info'>Lyricli</small></li><li><span class='object_link'><a href="Lyricli/Exceptions.html" title="Lyricli::Exceptions (module)">Exceptions</a></span><small class='search_info'>Lyricli</small></li><li><span class='object_link'><a href="Lyricli/Lyricli.html" title="Lyricli::Lyricli (class)">Lyricli</a></span> < 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> < 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> < 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> < 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> < 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> < 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> < Object<small class='search_info'>Lyricli</small></li><li><a class='toggle'></a> <span class='object_link'><a href="Lyricli/Exceptions.html" title="Lyricli::Exceptions (module)">Exceptions</a></span><small class='search_info'>Lyricli</small></li><ul><li><span class='object_link'><a href="Lyricli/Exceptions/DisableSourceError.html" title="Lyricli::Exceptions::DisableSourceError (class)">DisableSourceError</a></span> < StandardError<small class='search_info'>Lyricli::Exceptions</small></li><li><span class='object_link'><a href="Lyricli/Exceptions/EnableSourceError.html" title="Lyricli::Exceptions::EnableSourceError (class)">EnableSourceError</a></span> < StandardError<small class='search_info'>Lyricli::Exceptions</small></li><li><span class='object_link'><a href="Lyricli/Exceptions/InvalidLyricsError.html" title="Lyricli::Exceptions::InvalidLyricsError (class)">InvalidLyricsError</a></span> < StandardError<small class='search_info'>Lyricli::Exceptions</small></li><li><span class='object_link'><a href="Lyricli/Exceptions/LyricsNotFoundError.html" title="Lyricli::Exceptions::LyricsNotFoundError (class)">LyricsNotFoundError</a></span> < StandardError<small class='search_info'>Lyricli::Exceptions</small></li><li><span class='object_link'><a href="Lyricli/Exceptions/ResetSourceError.html" title="Lyricli::Exceptions::ResetSourceError (class)">ResetSourceError</a></span> < StandardError<small class='search_info'>Lyricli::Exceptions</small></li><li><span class='object_link'><a href="Lyricli/Exceptions/SourceConfigurationError.html" title="Lyricli::Exceptions::SourceConfigurationError (class)">SourceConfigurationError</a></span> < StandardError<small class='search_info'>Lyricli::Exceptions</small></li><li><span class='object_link'><a href="Lyricli/Exceptions/StartSourceError.html" title="Lyricli::Exceptions::StartSourceError (class)">StartSourceError</a></span> < StandardError<small class='search_info'>Lyricli::Exceptions</small></li><li><span class='object_link'><a href="Lyricli/Exceptions/UnknownSourceError.html" title="Lyricli::Exceptions::UnknownSourceError (class)">UnknownSourceError</a></span> < StandardError<small class='search_info'>Lyricli::Exceptions</small></li></ul><li><span class='object_link'><a href="Lyricli/Lyricli.html" title="Lyricli::Lyricli (class)">Lyricli</a></span> < 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> < 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> < 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> < 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> < 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> < 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>
</div></div>
<div id="footer">
- Generated on Sat Oct 6 02:34:26 2012 by
+ Generated on Sat Oct 6 03:20:24 2012 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.8.2.1 (ruby-1.9.2).
</div>
</div></div>
<div id="footer">
- Generated on Sat Oct 6 02:34:26 2012 by
+ Generated on Sat Oct 6 03:20:24 2012 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.8.2.1 (ruby-1.9.2).
</div>
<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>
+ <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::Sources::Rdio</small>
+ <small>Lyricli::Sources::Itunes</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>
+ <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::Arguments</small>
+ <small>Lyricli::SourceManager</small>
</li>
<li class="r1 ">
- <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>
+ <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::Itunes</small>
+ <small>Lyricli::Sources::Rdio</small>
</li>
<li class="r2 ">
- <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/Arguments.html#current_track-instance_method" title="Lyricli::Sources::Arguments#current_track (method)">#current_track</a></span>
- <small>Lyricli::SourceManager</small>
+ <small>Lyricli::Sources::Arguments</small>
</li>
<li class="r2 ">
- <span class='object_link'><a href="Lyricli/Sources/Itunes.html#enable-class_method" title="Lyricli::Sources::Itunes.enable (method)">enable</a></span>
+ <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::Itunes</small>
+ <small>Lyricli::Sources::Rdio</small>
</li>
<li class="r1 ">
- <span class='object_link'><a href="Lyricli/Sources/Arguments.html#enable-class_method" title="Lyricli::Sources::Arguments.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::Sources::Arguments</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/Sources/Arguments.html#enable-class_method" title="Lyricli::Sources::Arguments.enable (method)">enable</a></span>
- <small>Lyricli::Sources::Rdio</small>
+ <small>Lyricli::Sources::Arguments</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>
+ <span class='object_link'><a href="Lyricli/LyricsEngine.html#get_lyrics-instance_method" title="Lyricli::LyricsEngine#get_lyrics (method)">#get_lyrics</a></span>
- <small>Lyricli::Lyricli</small>
+ <small>Lyricli::LyricsEngine</small>
</li>
<li class="r2 ">
- <span class='object_link'><a href="Lyricli/LyricsEngine.html#get_lyrics-instance_method" title="Lyricli::LyricsEngine#get_lyrics (method)">#get_lyrics</a></span>
+ <span class='object_link'><a href="Lyricli/Lyricli.html#get_lyrics-instance_method" title="Lyricli::Lyricli#get_lyrics (method)">#get_lyrics</a></span>
- <small>Lyricli::LyricsEngine</small>
+ <small>Lyricli::Lyricli</small>
</li>
<li class="r1 ">
- <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/Lyricli.html#initialize-instance_method" title="Lyricli::Lyricli#initialize (method)">#initialize</a></span>
- <small>Lyricli::Configuration</small>
+ <small>Lyricli::Lyricli</small>
</li>
<li class="r2 ">
- <span class='object_link'><a href="Lyricli/Lyricli.html#initialize-instance_method" title="Lyricli::Lyricli#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::Lyricli</small>
+ <small>Lyricli::Sources::Itunes</small>
</li>
<li class="r1 ">
- <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/Configuration.html#initialize-instance_method" title="Lyricli::Configuration#initialize (method)">#initialize</a></span>
- <small>Lyricli::LyricsEngine</small>
+ <small>Lyricli::Configuration</small>
</li>
<li class="r2 ">
- <span class='object_link'><a href="Lyricli/Sources/Itunes.html#initialize-instance_method" title="Lyricli::Sources::Itunes#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::Itunes</small>
+ <small>Lyricli::LyricsEngine</small>
</li>
</div>
<div id="footer">
- Generated on Sat Oct 6 02:34:26 2012 by
+ Generated on Sat Oct 6 03:20:24 2012 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.8.2.1 (ruby-1.9.2).
</div>
# Enables a source via the Source Manager
def self.enable(source_name)
source_manager = SourceManager.new
- source_manager.enable(source_name)
+ begin
+ source_manager.enable(source_name)
+ rescue Exceptions::UnknownSourceError
+ "There is no such Source"
+ end
end
# Disables a source via the Source Manager
def self.disable(source_name)
source_manager = SourceManager.new
- source_manager.disable(source_name)
+ begin
+ source_manager.disable(source_name)
+ rescue Exceptions::UnknownSourceError
+ "There is no such Source"
+ end
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)
+ begin
+ source_manager.reset(source_name)
+ rescue Exceptions::UnknownSourceError
+ "There is no such Source"
+ end
end
end
module Lyricli
module Exceptions
+ # There was an error when disabling a source
class DisableSourceError < StandardError
end
end
module Lyricli
module Exceptions
+ # There was an error when enabling the source
class EnableSourceError < StandardError
end
end
module Lyricli
module Exceptions
+ # No artist/song was found.
class InvalidLyricsError < StandardError
end
end
module Lyricli
module Exceptions
+ # No lyrics could be found for this artist/song pair
class LyricsNotFoundError < StandardError
end
end
module Lyricli
module Exceptions
+ # There was an error while resetting a source
class ResetSourceError < StandardError
end
end
module Lyricli
module Exceptions
+ # There is an error with the source's configuration and it can't
+ # find its current track.
class SourceConfigurationError < StandardError
end
end
module Lyricli
module Exceptions
+ # There was an error while starting a source
class StartSourceError < StandardError
end
end
module Lyricli
module Exceptions
+ # An unknown source was tried to enable/disable/reset
class UnknownSourceError < StandardError
end
end