panoptes-client 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/panoptes/client.rb +5 -2
- data/lib/panoptes/client/user_groups.rb +11 -0
- data/lib/panoptes/client/version.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: c9093577357d957e9de91f8cf05a4bc4a545ae13
|
4
|
+
data.tar.gz: f9be472c1e3558ef8d8f2d380f715b22a968fd0b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0adbd891e129ceacbc55b061e65cc5c63d532e0647d0fc6250c76d52a2a635c5aa7431ca5994bf34b1220417f530288306ccc3f25dcbedb92d3ed0dee522eec8
|
7
|
+
data.tar.gz: 70b9a45e53f6788fcfb47948800cd4861cd0996935036012a031bb8fda2cb90c3d44f64e76a801f0de0973b910fe89e2d9cae8be558e84d20ab121be0b966d9d
|
data/CHANGELOG.md
CHANGED
data/lib/panoptes/client.rb
CHANGED
@@ -63,8 +63,11 @@ module Panoptes
|
|
63
63
|
handle_response(response)
|
64
64
|
end
|
65
65
|
|
66
|
-
def delete(path, query = {})
|
67
|
-
|
66
|
+
def delete(path, query = {}, etag: nil)
|
67
|
+
headers = {}
|
68
|
+
headers["If-Match"] = etag if etag
|
69
|
+
|
70
|
+
response = conn.delete("/api" + path, query, headers)
|
68
71
|
handle_response(response)
|
69
72
|
end
|
70
73
|
|
@@ -22,6 +22,17 @@ module Panoptes
|
|
22
22
|
links: {user: user_id, user_group: user_group_id}
|
23
23
|
})["memberships"][0]
|
24
24
|
end
|
25
|
+
|
26
|
+
def remove_user_from_user_group(user_group_id, user_id)
|
27
|
+
delete("/user_groups/#{user_group_id}/links/users/#{user_id}")
|
28
|
+
end
|
29
|
+
|
30
|
+
def delete_user_group(user_group_id)
|
31
|
+
response = conn.get("/api/user_groups/#{user_group_id}")
|
32
|
+
etag = response.headers["ETag"]
|
33
|
+
|
34
|
+
delete("/user_groups/#{user_group_id}", {}, etag: etag)
|
35
|
+
end
|
25
36
|
end
|
26
37
|
end
|
27
38
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: panoptes-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marten Veldthuis
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|