applocate 0.1.0 → 0.1.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/README.md +9 -8
- data/lib/applocate/api.rb +1 -2
- data/lib/applocate/configuration.rb +1 -1
- data/lib/applocate/version.rb +1 -1
- data/spec/applocate/api_spec.rb +2 -2
- data/spec/applocate/configuration_spec.rb +5 -9
- 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: 59ad8f19c65ecd825649ac7f410ecb6a213f7dd9
|
4
|
+
data.tar.gz: 31390a21e153de8b2ae0a6587adf9dcfa16f3423
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a96c5259edf768f8142a958b7e5dff1f6f053685b95179691ad8808b6777805c471454a29beab5d5670fabb544ce0e91617c8f2ac0934ee4b51824ba8993388
|
7
|
+
data.tar.gz: 4ef02c2163c4911e57d9093fd81b88e73a23c4c843365206aabf03b0ed88ed0dbc27285a313eea3200cb33b15c1274586475c5b2ac949cba50d6109e0be34801
|
data/README.md
CHANGED
@@ -43,32 +43,33 @@ end
|
|
43
43
|
Currently the following methods are supported:
|
44
44
|
|
45
45
|
```ruby
|
46
|
-
# expected options -> {
|
46
|
+
# expected options -> { udid: "ABCD-DCCDDC-12394812389-CDC", restrictions: {"allowSafari" => false} }
|
47
47
|
Applocate::API.restrict(options)
|
48
48
|
# returns a list (Array) of UUIDs with their status from the command.
|
49
49
|
|
50
|
-
# expected options -> {
|
50
|
+
# expected options -> { udid: "ABCD-DCCDDC-12394812389-CDC" }
|
51
51
|
Applocate::API.unrestrict(options)
|
52
52
|
# returns a list (Array) of UUIDs with their status from the command.
|
53
53
|
|
54
54
|
|
55
|
-
# expected options -> {
|
55
|
+
# expected options -> { udid: "ABCD-DCCDDC-12394812389-CDC", itunes_id: "003274092" }
|
56
56
|
Applocate::API.install_app(options)
|
57
57
|
# returns a list (Array) of UUIDs with their status from the command.
|
58
58
|
|
59
59
|
|
60
|
-
# expected options -> {
|
60
|
+
# expected options -> { udid: "ABCD-DCCDDC-12394812389-CDC" }
|
61
61
|
Applocate::API.app_list(options)
|
62
62
|
# returns a list (Array) of UUIDs with their apps.
|
63
63
|
|
64
64
|
# expected options -> { name: "the name your call the device (255 chars)", identifier: "INTERNAL_CORP_ID_UPTO_255CHAR" }
|
65
|
+
# NOTE: you can also add an optional configuration: "default" and it will apply a named configuration that matches.
|
65
66
|
Applocate::API.register_device(options)
|
66
|
-
# returns :id, :
|
67
|
-
# since the
|
67
|
+
# returns :id, :udid, :enrollment_url
|
68
|
+
# since the udid comes from the device it will be nil until the device enrolls
|
68
69
|
|
69
70
|
Applocate::API.list_devices
|
70
|
-
# return an array of devices containing :id, :
|
71
|
-
# once the device has enrolled it will have a :
|
71
|
+
# return an array of devices containing :id, :udid, :enrollment_url
|
72
|
+
# once the device has enrolled it will have a :udid but no :enrollment_url
|
72
73
|
|
73
74
|
```
|
74
75
|
|
data/lib/applocate/api.rb
CHANGED
@@ -31,9 +31,8 @@ module Applocate
|
|
31
31
|
JSON.parse response.body rescue []
|
32
32
|
end
|
33
33
|
|
34
|
-
# expected options { name: "Steve J's iPad Air", identifier: "XXX-123456 APPLE INC." }
|
34
|
+
# expected options { name: "Steve J's iPad Air", identifier: "XXX-123456 APPLE INC.", configuration: "default" }
|
35
35
|
def self.register_device(options = {})
|
36
|
-
options = { name: name, identifier: identifier }
|
37
36
|
response = self.post('/api/devices', { body: options.to_json, headers: authentication })
|
38
37
|
JSON.parse response.body rescue []
|
39
38
|
end
|
data/lib/applocate/version.rb
CHANGED
data/spec/applocate/api_spec.rb
CHANGED
@@ -3,12 +3,12 @@ require 'spec_helper'
|
|
3
3
|
describe Applocate::API do
|
4
4
|
describe 'configuration' do
|
5
5
|
subject { Applocate::API }
|
6
|
-
before(:all)
|
6
|
+
before(:all) do
|
7
7
|
Applocate.configure do |config|
|
8
8
|
config.token = 'token'
|
9
9
|
config.secret = 'secret'
|
10
10
|
end
|
11
|
-
|
11
|
+
end
|
12
12
|
|
13
13
|
it 'uses the configured token' do
|
14
14
|
expect(subject.token).to eq('token')
|
@@ -3,11 +3,11 @@ require 'spec_helper'
|
|
3
3
|
describe Applocate::Configuration do
|
4
4
|
describe 'configure' do
|
5
5
|
describe 'with ENV variables' do
|
6
|
-
before(:all)
|
6
|
+
before(:all) do
|
7
7
|
ENV["APPLOCATE_TOKEN"] = "APPLOCATE_TOKEN"
|
8
8
|
ENV["APPLOCATE_SECRET"] = "APPLOCATE_SECRET"
|
9
|
-
ENV["
|
10
|
-
|
9
|
+
ENV["APPLOCATE_BASE_URL"] = "APPLOCATE_BASE_URL"
|
10
|
+
end
|
11
11
|
|
12
12
|
it 'adds a friend as a participant to the current conversation' do
|
13
13
|
expect(subject.token).to eq('APPLOCATE_TOKEN')
|
@@ -16,21 +16,17 @@ describe Applocate::Configuration do
|
|
16
16
|
it 'adds a friend as a participant to the current conversation' do
|
17
17
|
expect(subject.secret).to eq('APPLOCATE_SECRET')
|
18
18
|
end
|
19
|
-
|
20
|
-
it 'adds a friend as a participant to the current conversation' do
|
21
|
-
expect(subject.base_url).to eq('BASE_URL')
|
22
|
-
end
|
23
19
|
end
|
24
20
|
|
25
21
|
describe 'with a configuration block' do
|
26
22
|
subject { Applocate.configuration }
|
27
|
-
before(:each)
|
23
|
+
before(:each) do
|
28
24
|
Applocate.configure do |config|
|
29
25
|
config.token = 'token'
|
30
26
|
config.secret = 'secret'
|
31
27
|
config.base_url = 'base_url'
|
32
28
|
end
|
33
|
-
|
29
|
+
end
|
34
30
|
|
35
31
|
it 'adds a friend as a participant to the current conversation' do
|
36
32
|
expect(subject.token).to eq('token')
|
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.1.
|
4
|
+
version: 0.1.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-
|
11
|
+
date: 2015-04-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|