applocate 0.3.2 → 0.3.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: 392aa32427fc01df5b96187dee2dc2d4a31a6664
4
- data.tar.gz: 11dac0e52db1742bb3016e02dd5bf41eaadf457a
3
+ metadata.gz: 5dac7a77bf6bcf4d0a9af55cab719614b9f714c6
4
+ data.tar.gz: 2e8b720b0032362a8e586c4dc15fcc8c9464cd33
5
5
  SHA512:
6
- metadata.gz: 7296632d41963d23117054fc2f768cb03b7a77a123ef7353e59b8617d793d263ad9afc43bb2ab4406197207adf796db31cb2d2b693751f8b580ce83d92e1b069
7
- data.tar.gz: 3ca2e34f031dcc38f671f2ec46772b287bb6f903b3afd5f04b5707df1cd2626cad9bee703529b2e538609f8c2c01d1e61ab257118a295df224acbb1ba4eb5432
6
+ metadata.gz: 0a7948336988a91bd2920357a1d6d74eaf8a979f1c030fe16cccd06f2a76619456777fb9e70cb70b2230a874799024927c8ab5aebb0a80ac5d4c501fd7457f83
7
+ data.tar.gz: 1cc7be2017305bd422eaafeb24f4f4b38de3712fa7214e22b7e9686ec72247542ac6d2a6ebc637bb5b19108cd6752292e2084dcfa8f26f4b0de0fe528cd91649
data/README.md CHANGED
@@ -44,6 +44,7 @@ Currently the following methods are supported:
44
44
 
45
45
  ```ruby
46
46
  # expected options -> { udid: "ABCD-DCCDDC-12394812389-CDC", restrictions: {"allowSafari" => false} }
47
+ # optional options -> { expires_at: "2000-01-01T00:00:00Z", expires_in: 1337, profile_name: "com.example.my.profile"}
47
48
  Applocate::API.restrict(options)
48
49
  # returns a list (Array) of UUIDs with their status from the command.
49
50
 
@@ -97,7 +98,13 @@ Applocate::API.recent_commands(udid)
97
98
  Applocate::API.active_commands(udid)
98
99
  # returns a list of the active commands for a device.
99
100
 
100
- # expected params: udid = "ABCD-DCCDDC-12394812389-CDC", name = "me.example.restrictions" options { ... Apple MDM Restrictions Profile ... }
101
+ # expected params, udid = "ABCD-DCCDDC-12394812389-CDC"
102
+ Applocate::API.restrictions(udid)
103
+ # returns a list of the restrictions for a device.
104
+
105
+ # expected params: udid = "ABCD-DCCDDC-12394812389-CDC", name = "me.example.restrictions", options = {}
106
+ # required options -> { restrictions: {"allowSafari" => false} }
107
+ # optional options -> { expires_at: "2000-01-01T00:00:00Z", expires_in: 1337 }
101
108
  Applocate::API.apply_named_restrictions(udid, name, options)
102
109
  # returns the udid and the status of the command as JSON
103
110
 
@@ -26,6 +26,12 @@ module Applocate
26
26
  JSON.parse response.body rescue []
27
27
  end
28
28
 
29
+ # expected params, udid = "ABCD-DCCDDC-12394812389-CDC"
30
+ def self.restrictions(udid)
31
+ response = self.get("/api/devices/#{udid}/restrictions", { headers: authentication })
32
+ JSON.parse response.body rescue []
33
+ end
34
+
29
35
  # expected params, udid = "ABCD-DCCDDC-12394812389-CDC"
30
36
  def self.profile_list(udid)
31
37
  response = self.get("/api/devices/#{udid}/profiles", { headers: authentication })
@@ -1,3 +1,3 @@
1
1
  module Applocate
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  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.3.2
4
+ version: 0.3.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: 2016-02-25 00:00:00.000000000 Z
11
+ date: 2016-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty