playlyfe 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/client.rb +3 -1
- data/lib/playlyfe.rb +2 -2
- data/test/test.rb +1 -1
- metadata +1 -1
data/lib/client.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'faraday'
|
2
2
|
require 'logger'
|
3
|
+
require 'access_token'
|
3
4
|
|
4
5
|
module OAuth2
|
5
6
|
# The OAuth2::Client class
|
@@ -138,7 +139,8 @@ module OAuth2
|
|
138
139
|
response = request(options[:token_method], token_url, opts)
|
139
140
|
error = Error.new(response)
|
140
141
|
fail(error) if options[:raise_errors] && !(response.parsed.is_a?(Hash) && response.parsed['access_token'])
|
141
|
-
|
142
|
+
AccessToken.from_hash(self, response.parsed.merge(access_token_opts))
|
143
|
+
#access_token_class.from_hash(self, response.parsed.merge(access_token_opts))
|
142
144
|
end
|
143
145
|
|
144
146
|
# The Client Credentials strategy
|
data/lib/playlyfe.rb
CHANGED
@@ -20,8 +20,8 @@ class Playlyfe
|
|
20
20
|
|
21
21
|
# You can initiate a client by giving the client_id and client_secret params
|
22
22
|
# This will authorize a client and get the token
|
23
|
-
def self.
|
24
|
-
puts '
|
23
|
+
def self.init(options = {})
|
24
|
+
puts 'Playlyfe Initializing...............................................'
|
25
25
|
begin
|
26
26
|
@@client = OAuth2::Client.new(
|
27
27
|
options[:client_id],
|
data/test/test.rb
CHANGED
@@ -4,7 +4,7 @@ require 'playlyfe'
|
|
4
4
|
class PlaylyfeTest < Test::Unit::TestCase
|
5
5
|
|
6
6
|
def test_start
|
7
|
-
Playlyfe.
|
7
|
+
Playlyfe.init(
|
8
8
|
client_id: "NjZlZWFiMWEtN2ZiOC00YmVmLTk2YWMtNDEyYTNmMjQ5NDBl",
|
9
9
|
client_secret: "NGRhMWJlYzUtODJiNS00ZTdkLTgzNTctMTQyMGEzNTljN2MwMTU2MGM3NTAtZjZiZS0xMWUzLTgxZjYtNmZhMGYyMzRkZGU3"
|
10
10
|
)
|