]>
git.r.bdr.sh - rbdr/lyricli.rb/blob - lib/lyricli/sources/itunes.rb
3 # The source for iTunes
12 # The enable method should run all of the tasks needed to validate
13 # the source. In the case of Rdio it has to authenticate with OAuth.
18 # Instantiates everything it needs to run.
20 @config = Configuration
.instance
21 @script = "current_song.scpt"
24 # The current_track method should return the name of the current
26 # @return [Hash] A hash containing the current `:song` and `:artist`.
28 path_root
= File
.expand_path(File
.dirname(__FILE__
))
29 path
= File
.join(path_root
, @script)
30 current
= `osascript #{path}`
31 current
= current
.split("<-SEP->")
32 {:artist => current
[0], :song => current
[1]}
35 # The reset method resets any configurations it may have