simplemdm 1.1.3 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 450a6e83352102b742d03a7ebb14ce5414e7cf1c
4
- data.tar.gz: 06edd1f7ee71fea449ce78ab6c57cef65bc525c6
3
+ metadata.gz: bd6300abfc864d55d51d9d315847e667ffd483fe
4
+ data.tar.gz: 60f7d7d4d0ed8a89914d856c6a724b14b8f8af1d
5
5
  SHA512:
6
- metadata.gz: 77622d9c6fb8e71f498faed61cd33bfbf0d2e223980e11287a4eb749fee0b2a2bb27b6e71af8a72662146b7c4100867f53bcb0a0824aa00b56add35578e36f6b
7
- data.tar.gz: 6fa0fa9a769cf91a9ff6885d0b272935429c73824e70421a5da9560bb27968416856389ecfbdaacb99493354202c0ae2f1270417a9eb2ea44efd8cac07cf1b5d
6
+ metadata.gz: 0ea0fba1a4b220ab613784a50cc4d3146d88431964f4a4367947e9bb9b877fdbdac88d9ce0f3b71111348fe392628e6f5711e1b379b853bf249b4724ece0fdc2
7
+ data.tar.gz: d7a080dcc2508ea310dcde358b2d835a13f6b9413541f8eaa32237db2ad5b7a90e738fe4892722d4fd97a5469c3fca171dbd59c7caa09ad622e1e8c477252d42
@@ -20,4 +20,12 @@
20
20
  ## [1.1.3] - 2016-9-29
21
21
  ### Fixed
22
22
  - New App objects failed to save when 'binary' was declared as an initialization argument.
23
- - App objects were not able to update their 'name' attribute.
23
+ - App objects were not able to update their 'name' attribute.
24
+
25
+ ## [1.2.0] - 2016-10-25
26
+ ### Added
27
+ - Create new devices
28
+ - Uninstall installed, managed apps from devices
29
+
30
+ ### Fixed
31
+ - App groups could not be deleted
data/README.md CHANGED
@@ -38,9 +38,9 @@ device.lock message: "This device has been locked. Please call the number p
38
38
 
39
39
  # upload an enterprise app and deploy it to a group of devices
40
40
 
41
- app_data = IO.binread('surfreport2.2.ipa')
42
- app = SimpleMDM::App.new name: "Surf Report",
43
- binary: data
41
+ data = File.open('surfreport2.2.ipa')
42
+ app = SimpleMDM::App.new name: "Surf Report",
43
+ binary: data
44
44
  app.save
45
45
 
46
46
  app_group = SimpleMDM::AppGroup.find(37)
@@ -59,7 +59,7 @@ module SimpleMDM
59
59
  def destroy
60
60
  raise "You cannot delete an app group that hasn't been created yet" if new?
61
61
 
62
- hash, code = fetch("app_groups/#{self.id}")
62
+ hash, code = fetch("app_groups/#{self.id}", :delete)
63
63
 
64
64
  code == 204
65
65
  end
@@ -13,6 +13,25 @@ module SimpleMDM
13
13
  build hash['data']
14
14
  end
15
15
 
16
+ def save
17
+ unless new?
18
+ raise "You can only save new device objects"
19
+ end
20
+
21
+ params = {}
22
+ params[:name] = self.name unless self.name.nil?
23
+ params[:group_id] = self.group_id unless self.group_id.nil?
24
+
25
+ hash, code = fetch("devices", :post, params)
26
+
27
+ self.id = hash['data']['id']
28
+ self.merge!(hash['data']['attributes'])
29
+
30
+ @dirty = false
31
+
32
+ self
33
+ end
34
+
16
35
  def installed_apps
17
36
  raise "You cannot retrieve installed apps for a device that hasn't been created yet." if new?
18
37
 
@@ -1,4 +1,19 @@
1
1
  module SimpleMDM
2
2
  class InstalledApp < Base
3
+
4
+ def self.find(id)
5
+ hash, code = fetch("installed_apps/#{id}")
6
+
7
+ build hash['data']
8
+ end
9
+
10
+ def uninstall
11
+ raise "You cannot uninstall an unmanaged app" if !self.managed
12
+
13
+ hash, code = fetch("installed_apps/#{id}", :delete)
14
+
15
+ code == 202
16
+ end
17
+
3
18
  end
4
19
  end
@@ -1,3 +1,3 @@
1
1
  module SimpleMDM
2
- VERSION = "1.1.3".freeze
2
+ VERSION = "1.2.0".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simplemdm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taylor Boyko
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-09-29 00:00:00.000000000 Z
11
+ date: 2016-10-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler