X-Git-Url: https://git.r.bdr.sh/rbdr/lyricli.rb/blobdiff_plain/823e558b5cd2ec219d0fc7226c54f2ee7ad807d2..HEAD:/doc/Lyricli/Sources/Rdio.html?ds=inline diff --git a/doc/Lyricli/Sources/Rdio.html b/doc/Lyricli/Sources/Rdio.html index e99af89..d79cade 100644 --- a/doc/Lyricli/Sources/Rdio.html +++ b/doc/Lyricli/Sources/Rdio.html @@ -6,7 +6,7 @@ Class: Lyricli::Sources::Rdio - — Documentation by YARD 0.8.1 + — Documentation by YARD 0.8.2.1 @@ -99,8 +99,20 @@
+

Overview

+
+

+This is the Source for rdio +

+
+
+
+ + +
+

Class Attribute Summary (collapse)

@@ -319,19 +331,19 @@ Instantiates everything it needs to run.
 
 
-23
-24
-25
-26
-27
+29 +30 +31 +32 +33 -
# File 'lib/lyricli/sources/rdio.rb', line 23
+      
# File 'lib/lyricli/sources/rdio.rb', line 29
 
 def initialize
   @name = 'rdio'
-  @config = Lyricli::Configuration.instance
-  @rdio = Rdio::SimpleRdio.new([@config["rdio_key"], @config["rdio_secret"]], @config["rdio_auth_token"])
+  @config = Configuration.instance
+  @rdio = ::Rdio::SimpleRdio.new([@config["rdio_key"], @config["rdio_secret"]], @config["rdio_auth_token"])
 end
@@ -345,7 +357,6 @@ Instantiates everything it needs to run. -

@@ -373,12 +384,12 @@ Returns the value of attribute name
 
 
-6
-7
-8
+8 +9 +10

-
# File 'lib/lyricli/sources/rdio.rb', line 6
+      
# File 'lib/lyricli/sources/rdio.rb', line 8
 
 def name
   @name
@@ -423,14 +434,6 @@ token.
       
 
 
-46
-47
-48
-49
-50
-51
-52
-53
 54
 55
 56
@@ -439,19 +442,27 @@ token.
 59
 60
 61
-62
+62 +63 +64 +65 +66 +67 +68 +69 +70
-
# File 'lib/lyricli/sources/rdio.rb', line 46
+      
# File 'lib/lyricli/sources/rdio.rb', line 54
 
 def self.create_auth_token
-  @rdio = Rdio::SimpleRdio.new([@config["rdio_key"], @config["rdio_secret"]], @config["rdio_auth_token"])
+  rdio = ::Rdio::SimpleRdio.new([@config["rdio_key"], @config["rdio_secret"]], @config["rdio_auth_token"])
 
   # Request Authorization
   puts "Follow this URL to authorize lyricli:"
   auth_url = rdio.begin_authentication('oob')
   puts auth_url
-  Launchy.open(auth_url)
+  ::Launchy.open(auth_url)
 
   # Request Code, Obtain Token
   print "Please type the authorization code: "
@@ -494,25 +505,33 @@ source. In the case of Rdio it has to authenticate with OAuth.
       
 
 
-13
-14
 15
 16
 17
 18
 19
-20
+20 +21 +22 +23 +24 +25 +26
-
# File 'lib/lyricli/sources/rdio.rb', line 13
+      
# File 'lib/lyricli/sources/rdio.rb', line 15
 
 def self.enable
   # Validation Code
-  @config = Lyricli::Configuration.instance
+  @config = Configuration.instance
   unless @config["rdio_auth_token"] && !@config["rdio_auth_token"].empty?
     create_auth_token
   end
 
+  puts "***"
+  puts "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."
+  puts "***"
+
 end
@@ -546,16 +565,18 @@ The reset method resets any configurations it may have
 
 
-40
-41
-42
+47 +48 +49 +50
-
# File 'lib/lyricli/sources/rdio.rb', line 40
+      
# File 'lib/lyricli/sources/rdio.rb', line 47
 
 def self.reset
-  # Reset Code
-end
+ @config = Configuration.instance + @config.delete("rdio_auth_token") +end
@@ -614,15 +635,15 @@ A hash containing the current `:song` and `:artist`.
 
 
-32
-33
-34
-35
-36
-37
+39 +40 +41 +42 +43 +44
-
# File 'lib/lyricli/sources/rdio.rb', line 32
+      
# File 'lib/lyricli/sources/rdio.rb', line 39
 
 def current_track
   response = @rdio.call('currentUser', {'extras' => 'lastSongPlayed'})
@@ -640,9 +661,9 @@ A hash containing the current `:song` and `:artist`.