]> git.r.bdr.sh - rbdr/lyricli.rb/blame - doc/Lyricli/Sources/Itunes.html
Add some stuff to the SourceManagerSpec
[rbdr/lyricli.rb] / doc / Lyricli / Sources / Itunes.html
CommitLineData
f2ec7254
BB
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6<title>
7 Class: Lyricli::Sources::Itunes
8
9 &mdash; Documentation by YARD 0.8.2.1
10
11</title>
12
13 <link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
14
15 <link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />
16
17<script type="text/javascript" charset="utf-8">
18 hasFrames = window.top.frames.main ? true : false;
19 relpath = '../../';
20 framesUrl = "../../frames.html#!" + escape(window.location.href);
21</script>
22
23
24 <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
25
26 <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
27
28
29 </head>
30 <body>
31 <div id="header">
32 <div id="menu">
33
34 <a href="../../_index.html">Index (I)</a> &raquo;
35 <span class='title'><span class='object_link'><a href="../../Lyricli.html" title="Lyricli (module)">Lyricli</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Sources.html" title="Lyricli::Sources (module)">Sources</a></span></span>
36 &raquo;
37 <span class="title">Itunes</span>
38
39
40 <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41</div>
42
43 <div id="search">
44
45 <a class="full_list_link" id="class_list_link"
46 href="../../class_list.html">
47 Class List
48 </a>
49
50 <a class="full_list_link" id="method_list_link"
51 href="../../method_list.html">
52 Method List
53 </a>
54
55 <a class="full_list_link" id="file_list_link"
56 href="../../file_list.html">
57 File List
58 </a>
59
60</div>
61 <div class="clear"></div>
62 </div>
63
64 <iframe id="search_frame"></iframe>
65
66 <div id="content"><h1>Class: Lyricli::Sources::Itunes
67
68
69
70</h1>
71
72<dl class="box">
73
74 <dt class="r1">Inherits:</dt>
75 <dd class="r1">
76 <span class="inheritName">Object</span>
77
78 <ul class="fullTree">
79 <li>Object</li>
80
81 <li class="next">Lyricli::Sources::Itunes</li>
82
83 </ul>
84 <a href="#" class="inheritanceTree">show all</a>
85
86 </dd>
87
88
89
90
91
92
93
94
95
96 <dt class="r2 last">Defined in:</dt>
97 <dd class="r2 last">lib/lyricli/sources/itunes.rb</dd>
98
99</dl>
100<div class="clear"></div>
101
102<h2>Overview</h2><div class="docstring">
103 <div class="discussion">
104 <p>
105The source for iTunes
106</p>
107
108
109 </div>
110</div>
111<div class="tags">
112
113
114</div>
115
116
117
118 <h2>Class Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
119 <ul class="summary">
120
121 <li class="public ">
122 <span class="summary_signature">
123
124 <a href="#name-class_method" title="name (class method)">+ (Object) <strong>name</strong> </a>
125
126
127
128 </span>
129
130
131
132
133
134
135
136
137
138
139
140
141 <span class="summary_desc"><div class='inline'><p>
142Returns the value of attribute name.
143</p>
144</div></span>
145
146</li>
147
148
149 </ul>
150
151
152
153
154
155 <h2>
156 Class Method Summary
157 <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
158 </h2>
159
160 <ul class="summary">
161
162 <li class="public ">
163 <span class="summary_signature">
164
165 <a href="#enable-class_method" title="enable (class method)">+ (Object) <strong>enable</strong> </a>
166
167
168
169 </span>
170
171
172
173
174
175
176
177
178
179 <span class="summary_desc"><div class='inline'><p>
180The enable method should run all of the tasks needed to validate the
181source.
182</p>
183</div></span>
184
185</li>
186
187
188 <li class="public ">
189 <span class="summary_signature">
190
191 <a href="#reset-class_method" title="reset (class method)">+ (Object) <strong>reset</strong> </a>
192
193
194
195 </span>
196
197
198
199
200
201
202
203
204
205 <span class="summary_desc"><div class='inline'><p>
206The reset method resets any configurations it may have.
207</p>
208</div></span>
209
210</li>
211
212
213 </ul>
214
215 <h2>
216 Instance Method Summary
217 <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
218 </h2>
219
220 <ul class="summary">
221
222 <li class="public ">
223 <span class="summary_signature">
224
225 <a href="#current_track-instance_method" title="#current_track (instance method)">- (Hash) <strong>current_track</strong> </a>
226
227
228
229 </span>
230
231
232
233
234
235
236
237
238
239 <span class="summary_desc"><div class='inline'><p>
240The current_track method should return the name of the current artist and
241song.
242</p>
243</div></span>
244
245</li>
246
247
248 <li class="public ">
249 <span class="summary_signature">
250
251 <a href="#initialize-instance_method" title="#initialize (instance method)">- (Itunes) <strong>initialize</strong> </a>
252
253
254
255 </span>
256
257
258 <span class="note title constructor">constructor</span>
259
260
261
262
263
264
265
266
267 <span class="summary_desc"><div class='inline'><p>
268Instantiates everything it needs to run.
269</p>
270</div></span>
271
272</li>
273
274
275 </ul>
276
277
278<div id="constructor_details" class="method_details_list">
279 <h2>Constructor Details</h2>
280
281 <div class="method_details first">
282 <h3 class="signature first" id="initialize-instance_method">
283
284 - (<tt><span class='object_link'><a href="" title="Lyricli::Sources::Itunes (class)">Itunes</a></span></tt>) <strong>initialize</strong>
285
286
287
288
289
290</h3><div class="docstring">
291 <div class="discussion">
292 <p>
293Instantiates everything it needs to run.
294</p>
295
296
297 </div>
298</div>
299<div class="tags">
300
301
302</div><table class="source_code">
303 <tr>
304 <td>
305 <pre class="lines">
306
307
30819
30920
31021
31122</pre>
312 </td>
313 <td>
314 <pre class="code"><span class="info file"># File 'lib/lyricli/sources/itunes.rb', line 19</span>
315
316<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
317 <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>
318 <span class='ivar'>@script</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>current_song.scpt</span><span class='tstring_end'>&quot;</span></span>
319<span class='kw'>end</span></pre>
320 </td>
321 </tr>
322</table>
323</div>
324
325</div>
326
327 <div id="class_attr_details" class="attr_details">
328 <h2>Class Attribute Details</h2>
329
330
331 <span id="name=-class_method"></span>
332 <div class="method_details first">
333 <h3 class="signature first" id="name-class_method">
334
335 + (<tt>Object</tt>) <strong>name</strong>
336
337
338
339
340
341</h3><div class="docstring">
342 <div class="discussion">
343 <p>
344Returns the value of attribute name
345</p>
346
347
348 </div>
349</div>
350<div class="tags">
351
352
353</div><table class="source_code">
354 <tr>
355 <td>
356 <pre class="lines">
357
358
3597
3608
3619</pre>
362 </td>
363 <td>
364 <pre class="code"><span class="info file"># File 'lib/lyricli/sources/itunes.rb', line 7</span>
365
366<span class='kw'>def</span> <span class='id identifier rubyid_name'>name</span>
367 <span class='ivar'>@name</span>
368<span class='kw'>end</span></pre>
369 </td>
370 </tr>
371</table>
372</div>
373
374 </div>
375
376
377 <div id="class_method_details" class="method_details_list">
378 <h2>Class Method Details</h2>
379
380
381 <div class="method_details first">
382 <h3 class="signature first" id="enable-class_method">
383
384 + (<tt>Object</tt>) <strong>enable</strong>
385
386
387
388
389
390</h3><div class="docstring">
391 <div class="discussion">
392 <p>
393The enable method should run all of the tasks needed to validate the
394source. In the case of Rdio it has to authenticate with OAuth.
395</p>
396
397
398 </div>
399</div>
400<div class="tags">
401
402
403</div><table class="source_code">
404 <tr>
405 <td>
406 <pre class="lines">
407
408
40914
41015
41116</pre>
412 </td>
413 <td>
414 <pre class="code"><span class="info file"># File 'lib/lyricli/sources/itunes.rb', line 14</span>
415
416<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_enable'>enable</span>
417 <span class='comment'># Nothing to do
418</span><span class='kw'>end</span></pre>
419 </td>
420 </tr>
421</table>
422</div>
423
424 <div class="method_details ">
425 <h3 class="signature " id="reset-class_method">
426
427 + (<tt>Object</tt>) <strong>reset</strong>
428
429
430
431
432
433</h3><div class="docstring">
434 <div class="discussion">
435 <p>
436The reset method resets any configurations it may have
437</p>
438
439
440 </div>
441</div>
442<div class="tags">
443
444
445</div><table class="source_code">
446 <tr>
447 <td>
448 <pre class="lines">
449
450
45136
45237
45338</pre>
454 </td>
455 <td>
456 <pre class="code"><span class="info file"># File 'lib/lyricli/sources/itunes.rb', line 36</span>
457
458<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_reset'>reset</span>
459 <span class='comment'># Nothing to do
460</span><span class='kw'>end</span></pre>
461 </td>
462 </tr>
463</table>
464</div>
465
466 </div>
467
468 <div id="instance_method_details" class="method_details_list">
469 <h2>Instance Method Details</h2>
470
471
472 <div class="method_details first">
473 <h3 class="signature first" id="current_track-instance_method">
474
475 - (<tt>Hash</tt>) <strong>current_track</strong>
476
477
478
479
480
481</h3><div class="docstring">
482 <div class="discussion">
483 <p>
484The current_track method should return the name of the current artist and
485song.
486</p>
487
488
489 </div>
490</div>
491<div class="tags">
492
493<p class="tag_title">Returns:</p>
494<ul class="return">
495
496 <li>
497
498
499 <span class='type'>(<tt>Hash</tt>)</span>
500
501
502
503 &mdash;
504 <div class='inline'><p>
505A hash containing the current `:song` and `:artist`.
506</p>
507</div>
508
509 </li>
510
511</ul>
512
513</div><table class="source_code">
514 <tr>
515 <td>
516 <pre class="lines">
517
518
51927
52028
52129
52230
52331
52432
52533</pre>
526 </td>
527 <td>
528 <pre class="code"><span class="info file"># File 'lib/lyricli/sources/itunes.rb', line 27</span>
529
530<span class='kw'>def</span> <span class='id identifier rubyid_current_track'>current_track</span>
531 <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>
532 <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_join'>join</span><span class='lparen'>(</span><span class='id identifier rubyid_path_root'>path_root</span><span class='comma'>,</span> <span class='ivar'>@script</span><span class='rparen'>)</span>
533 <span class='id identifier rubyid_current'>current</span> <span class='op'>=</span> <span class='backtick'>`</span><span class='tstring_content'>osascript </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_path'>path</span><span class='rbrace'>}</span><span class='tstring_end'>`</span></span>
534 <span class='id identifier rubyid_current'>current</span> <span class='op'>=</span> <span class='id identifier rubyid_current'>current</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'>&lt;-SEP-&gt;</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
535 <span class='lbrace'>{</span><span class='label'>artist:</span> <span class='id identifier rubyid_current'>current</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='label'>song:</span> <span class='id identifier rubyid_current'>current</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='rbrace'>}</span>
536<span class='kw'>end</span></pre>
537 </td>
538 </tr>
539</table>
540</div>
541
542 </div>
543
544</div>
545
546 <div id="footer">
278e6d0a 547 Generated on Sat Oct 6 03:20:24 2012 by
f2ec7254
BB
548 <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
549 0.8.2.1 (ruby-1.9.2).
550</div>
551
552 </body>
553</html>