applocate 0.0.2 → 0.0.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 567f2cda14537e4d92569ae62db36e4f8062f100
4
- data.tar.gz: 56b1d3ac871cf8ca8b89429279b763242484520d
3
+ metadata.gz: 94a009e3aba558b43848450449190ae120735d4e
4
+ data.tar.gz: 6a1c6123b9deb30cf84ddad9c31804b86d84964e
5
5
  SHA512:
6
- metadata.gz: 11448db8587fbf384b3291992bbae44bad93d6ed0654f200e5561ef5a8678a622f1ee54fb648170bbf014e5b8bef8042ebd2298d2cafce8927724cc5defaf5b4
7
- data.tar.gz: b0da9bf360435f23858f0a06241048cc227fb79cf0d4af0d62dbece537d86673f565f66ad53006794aa6d03f13b0c271d8705ece506d3d8098cfeb27e6212459
6
+ metadata.gz: aaf232eb71db7e8b7f5e7d3a56149f52cc482de04de0bab88fa1c116fe47bf35a6e55e778c8343c04bdcc3eeca472dddd89cc2effa6c392b9770f91a514d6165
7
+ data.tar.gz: cda7033f429cce05eec92fd7051131263ceb74c8642fe3cb80ef3717263bf7e99e8cb00a52e1c7bd58ea58a1d19421e4353b03ce598efd8d144ff1d17093d194
data/lib/applocate/api.rb CHANGED
@@ -9,42 +9,42 @@ module Applocate
9
9
 
10
10
  # expected options { uuid: "ABCD-DCCDDC-12394812389-CDC" }
11
11
  def self.restrict(options)
12
- response = self.post('/deploy/profile', { body: options.to_json }, authentication)
12
+ response = self.post('/deploy/profile', { body: options.to_json, headers: authentication })
13
13
  JSON.parse response.body rescue []
14
14
  end
15
15
 
16
16
  # expected options { uuid: "ABCD-DCCDDC-12394812389-CDC" }
17
17
  def self.unrestrict(options)
18
- response = self.delete('/deploy/profile', { body: options.to_json }, authentication)
18
+ response = self.delete('/deploy/profile', { body: options.to_json, headers: authentication })
19
19
  JSON.parse response.body rescue []
20
20
  end
21
21
 
22
22
  # expected options { uuid: "ABCD-DCCDDC-12394812389-CDC", itunes_id: "284910350" }
23
23
  def self.install_app(options)
24
- response = self.post('/deploy/app', { body: options.to_json }, authentication)
24
+ response = self.post('/deploy/app', { body: options.to_json, headers: authentication })
25
25
  JSON.parse response.body rescue []
26
26
  end
27
27
 
28
28
  # expected options { uuid: "ABCD-DCCDDC-12394812389-CDC" }
29
29
  def self.app_list(options)
30
- response = self.post('/deploy/app_list', { body: options.to_json }, authentication)
30
+ response = self.post('/deploy/app_list', { body: options.to_json, headers: authentication })
31
31
  JSON.parse response.body rescue []
32
32
  end
33
33
 
34
34
  # expected options { uuid: "ABCD-DCCDDC-12394812389-CDC", itunes_id: "284910350" }
35
35
  def self.register_device
36
- response = self.post('/api/devices', { body: options.to_json }, authentication)
36
+ response = self.post('/api/devices', { headers: authentication })
37
37
  JSON.parse response.body rescue []
38
38
  end
39
39
 
40
40
  # expected options { uuid: "ABCD-DCCDDC-12394812389-CDC" }
41
41
  def self.list_devices
42
- response = self.get('/api/devices', { body: options.to_json }, authentication)
42
+ response = self.get('/api/devices', { headers: authentication })
43
43
  JSON.parse response.body rescue []
44
44
  end
45
45
 
46
46
  def self.authentication
47
- { "X-Applocate-Secret" => secret, "X-Applocate-Token" => token }
47
+ { "X-Applocate-Secret" => secret, "X-Applocate-Token" => token, 'Content-Type' => "application/json" }
48
48
  end
49
49
 
50
50
  def self.token
@@ -7,7 +7,7 @@ module Applocate
7
7
  def initialize
8
8
  @token = ENV["APPLOCATE_TOKEN"]
9
9
  @secret = ENV["APPLOCATE_SECRET"]
10
- @base_url = ENV["BASE_URL"] || "https://www.applocate.com/api/v1"
10
+ @base_url = ENV["BASE_URL"] || "https://www.applocate.com"
11
11
  end
12
12
  end
13
13
 
@@ -1,3 +1,3 @@
1
1
  module Applocate
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -17,7 +17,7 @@ describe Applocate::API do
17
17
  expect(subject.secret).to eq('secret')
18
18
  end
19
19
  it 'uses the base URI to be set to the default' do
20
- expect(subject.base_uri).to eq("https://www.applocate.com/api/v1")
20
+ expect(subject.base_uri).to eq("https://www.applocate.com")
21
21
  end
22
22
  end
23
23
 
@@ -27,7 +27,7 @@ describe Applocate::API do
27
27
  results = []
28
28
 
29
29
  Applocate::API.should_receive(:post)
30
- .with('/deploy/profile', { body: device_list.to_json }, Applocate::API.authentication)
30
+ .with('/deploy/profile', { body: device_list.to_json, headers: Applocate::API.authentication })
31
31
  .and_return(results)
32
32
 
33
33
  Applocate::API.restrict device_list
@@ -39,7 +39,7 @@ describe Applocate::API do
39
39
  results = []
40
40
 
41
41
  Applocate::API.should_receive(:delete)
42
- .with('/deploy/profile', { body: device_list.to_json }, Applocate::API.authentication)
42
+ .with('/deploy/profile', { body: device_list.to_json, headers: Applocate::API.authentication })
43
43
  .and_return(results)
44
44
 
45
45
  Applocate::API.unrestrict device_list
@@ -52,7 +52,7 @@ describe Applocate::API do
52
52
  results = []
53
53
 
54
54
  Applocate::API.should_receive(:post)
55
- .with('/deploy/app', { body: options.to_json }, Applocate::API.authentication)
55
+ .with('/deploy/app', { body: options.to_json, headers: Applocate::API.authentication })
56
56
  .and_return(results)
57
57
 
58
58
  Applocate::API.install_app options
@@ -65,7 +65,7 @@ describe Applocate::API do
65
65
  results = []
66
66
 
67
67
  Applocate::API.should_receive(:post)
68
- .with('/deploy/app_list', { body: device_list.to_json }, Applocate::API.authentication)
68
+ .with('/deploy/app_list', { body: device_list.to_json, headers: Applocate::API.authentication })
69
69
  .and_return(results)
70
70
 
71
71
  Applocate::API.app_list device_list
@@ -46,7 +46,7 @@ describe Applocate::Configuration do
46
46
  end
47
47
 
48
48
  it 'has a default value for base url' do
49
- expect(subject.base_url).to eq("https://www.applocate.com/api/v1")
49
+ expect(subject.base_url).to eq("https://www.applocate.com")
50
50
  end
51
51
  end
52
52
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: applocate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Madsen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-19 00:00:00.000000000 Z
11
+ date: 2015-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty