pandora_client 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,9 @@
1
+ ## 0.1.1 (2012-05-21)
2
+
3
+ * Added `Pandora::User#reauthenticate` and `Pandora::Partner#reauthenticate` to
4
+ refresh authentication tokens and state. Useful for 1001 INVALID_AUTH_TOKEN
5
+ API errors.
6
+
1
7
  ## 0.1.0 (2012-05-20)
2
8
 
3
9
  * First release. Basic Tuner API with station song fetching support.
@@ -14,12 +14,12 @@ module Pandora
14
14
  authenticate
15
15
  end
16
16
 
17
- def login_user(username, password)
18
- User.new(self, username, password)
17
+ def reauthenticate
18
+ authenticate
19
19
  end
20
20
 
21
- def cryptor
22
- @cryptor ||= Cryptor.new(@encryption_key, @decryption_key)
21
+ def login_user(username, password)
22
+ User.new(self, username, password)
23
23
  end
24
24
 
25
25
  def marshal_dump
@@ -35,6 +35,10 @@ module Pandora
35
35
 
36
36
  private
37
37
 
38
+ def cryptor
39
+ @cryptor ||= Cryptor.new(@encryption_key, @decryption_key)
40
+ end
41
+
38
42
  def authenticate
39
43
  result = call 'auth.partnerLogin', { secure: true, encrypt: false }, {
40
44
  username: @username,
@@ -18,6 +18,11 @@ module Pandora
18
18
  login
19
19
  end
20
20
 
21
+ def reauthenticate
22
+ @partner.reauthenticate
23
+ login
24
+ end
25
+
21
26
  def stations
22
27
  call('user.getStationList')['stations'].map do |station_data|
23
28
  Station.new(self, station_data)
@@ -1,3 +1,3 @@
1
1
  module Pandora
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pandora_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-20 00:00:00.000000000 Z
12
+ date: 2012-05-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday