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 +4 -4
- data/lib/applocate/api.rb +7 -7
- data/lib/applocate/configuration.rb +1 -1
- data/lib/applocate/version.rb +1 -1
- data/spec/applocate/api_spec.rb +5 -5
- data/spec/applocate/configuration_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94a009e3aba558b43848450449190ae120735d4e
|
4
|
+
data.tar.gz: 6a1c6123b9deb30cf84ddad9c31804b86d84964e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
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
|
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
|
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', {
|
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', {
|
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
|
data/lib/applocate/version.rb
CHANGED
data/spec/applocate/api_spec.rb
CHANGED
@@ -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
|
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
|
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
|
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
|
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
|
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
|
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.
|
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-
|
11
|
+
date: 2015-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|