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