songdrop 0.1.17 → 0.1.18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/songdrop/client.rb +5 -4
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 14fe1dd59f07b6acfcea28d7233cf8505241d6ea
4
- data.tar.gz: 327028ce37643beeaf4ff19f21b702701f6a640b
3
+ metadata.gz: ef1f5f14d4df7387878cb26412b7bfcdca492c61
4
+ data.tar.gz: 98ee17d682c435a6e58d688674ef37b1a647db8c
5
5
  SHA512:
6
- metadata.gz: 14114116f6815822378c9f2e35892647031c5480c50b60bd4eb0e1f82d8a57c777a943c45d66b1f1b28ef8b9808342cfdaa756b6adc48da2829e16b3be029e59
7
- data.tar.gz: 61777a812e9f64646a350f618068390e9e79bd5e8ee11fc5133e957263f911d92ca9ce48d717cb03a8f4f02fe75c24b694536acad79180014cab473ac4b31fc0
6
+ metadata.gz: 106007c2f4e82a243e94b36f6b14bd2c92fb7e8fd21268c06abb4ab02ca75d1b4b046443b4f6fd5d30732f6ccfbbec7bd1cbc1bbc915159d4b1cf4f45582dc5b
7
+ data.tar.gz: e7afc1b2ecebdb641eeb825292aee2c4a9883629c864233171eaf9b33cb1f9eda76462ff72a1cafcd171ed4a9eaa5a66e489aca52bccccc2742e69f244398e5a
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: songdrop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.17
4
+ version: 0.1.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Taylor