songdrop 0.1.17 → 0.1.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/songdrop/client.rb +5 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef1f5f14d4df7387878cb26412b7bfcdca492c61
|
4
|
+
data.tar.gz: 98ee17d682c435a6e58d688674ef37b1a647db8c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 106007c2f4e82a243e94b36f6b14bd2c92fb7e8fd21268c06abb4ab02ca75d1b4b046443b4f6fd5d30732f6ccfbbec7bd1cbc1bbc915159d4b1cf4f45582dc5b
|
7
|
+
data.tar.gz: e7afc1b2ecebdb641eeb825292aee2c4a9883629c864233171eaf9b33cb1f9eda76462ff72a1cafcd171ed4a9eaa5a66e489aca52bccccc2742e69f244398e5a
|
data/lib/songdrop/client.rb
CHANGED
@@ -7,11 +7,12 @@ module Songdrop
|
|
7
7
|
@endpoint = options[:endpoint] || 'https://songdrop.com/v1'
|
8
8
|
@auth_token = options[:auth_token]
|
9
9
|
@ip_address = options[:ip_address] # if the client is proxying for the user
|
10
|
+
@user_agent = options[:user_agent] # if the client is proxying for the user
|
10
11
|
end
|
11
12
|
|
12
13
|
def get(path, params={}, &block)
|
13
14
|
puts "[Songdrop::Client] GET #{path} with #{params.inspect} block? #{block_given?}"
|
14
|
-
params.merge!(:client => @token, :token => @auth_token, :ip => @ip_address)
|
15
|
+
params.merge!(:client => @token, :token => @auth_token, :ip => @ip_address, :ua => @user_agent)
|
15
16
|
HTTP.get(full_url(path), params) do |response, headers, error|
|
16
17
|
handle_response(response, headers, error, &block)
|
17
18
|
end
|
@@ -19,7 +20,7 @@ module Songdrop
|
|
19
20
|
|
20
21
|
def put(path, params={}, &block)
|
21
22
|
puts "[Songdrop::Client] PUT #{path} with #{params.inspect} block? #{block_given?}"
|
22
|
-
params.merge!(:client => @token, :token => @auth_token, :ip => @ip_address)
|
23
|
+
params.merge!(:client => @token, :token => @auth_token, :ip => @ip_address, :ua => @user_agent)
|
23
24
|
HTTP.put(full_url(path), params) do |response, headers, error|
|
24
25
|
handle_response(response, headers, error, &block)
|
25
26
|
end
|
@@ -27,7 +28,7 @@ module Songdrop
|
|
27
28
|
|
28
29
|
def post(path, params={}, &block)
|
29
30
|
puts "[Songdrop::Client] POST #{path} with #{params.inspect} block? #{block_given?}"
|
30
|
-
params.merge!(:client => @token, :token => @auth_token, :ip => @ip_address)
|
31
|
+
params.merge!(:client => @token, :token => @auth_token, :ip => @ip_address, :ua => @user_agent)
|
31
32
|
HTTP.post(full_url(path), params) do |response, headers, error|
|
32
33
|
handle_response(response, headers, error, &block)
|
33
34
|
end
|
@@ -35,7 +36,7 @@ module Songdrop
|
|
35
36
|
|
36
37
|
def delete(path, params={}, &block)
|
37
38
|
puts "[Songdrop::Client] DELETE #{path} with #{params.inspect} block? #{block_given?}"
|
38
|
-
params.merge!(:client => @token, :token => @auth_token, :ip => @ip_address)
|
39
|
+
params.merge!(:client => @token, :token => @auth_token, :ip => @ip_address, :ua => @user_agent)
|
39
40
|
HTTP.delete(full_url(path), params) do |response, headers, error|
|
40
41
|
handle_response(response, headers, error, &block)
|
41
42
|
end
|