panoptes-client 0.2.1 → 0.2.2

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: 717325a4ffbf4a7add1c22245be7fccbc8596d3c
4
- data.tar.gz: 78b4f088dd3e324300b5a4f1795e36e32c4a60b5
3
+ metadata.gz: 1018268bfcfe069a1d041e58bd81a01ac49b0e48
4
+ data.tar.gz: 7353ed216c2c7207b8abeb4b6b7c2d0e1f7604f6
5
5
  SHA512:
6
- metadata.gz: ac3d2005a05fc8825ab9a23813edfdd19fd12c7bb7f952a42d1d5980eabac7bb2405416a37141babc9522a0c232b77e01e835af6e344844db5eaece777c3dd01
7
- data.tar.gz: 0c61ec6c31d831c30417ecb64ca1a89bf5cc0de803a728cd2316e70a786fd54874f6afc4859fb39aa248a3dc5a6f3a842a7a9658e253a65b311806475e49cdab
6
+ metadata.gz: 22777c5680c58d4f0ccd351bbddc9c78024b82a34217605ea4641ba51a54f925c097d9bc467ebc90a89d182c4bcf39e17c1f69dd2b324d7389206433e9568a5c
7
+ data.tar.gz: e0b0e7c779471b6b6cb28056b9fc7f5108fc7add67f43fb5a1897f27deea802db5070486d777fba25eb6ae0ba8baabeb8541a20cbcbbc6fc817cf4b645723bc7
@@ -98,7 +98,7 @@ module Panoptes
98
98
  when 404
99
99
  raise ResourceNotFound, status: response.status, body: response.body
100
100
  when 400..600
101
- raise ServerError
101
+ raise ServerError.new(response)
102
102
  else
103
103
  response.body
104
104
  end
@@ -11,6 +11,17 @@ module Panoptes
11
11
  name: name
12
12
  })["user_groups"][0]
13
13
  end
14
+
15
+ def user_groups
16
+ get("/user_groups")["user_groups"]
17
+ end
18
+
19
+ def join_user_group(user_group_id, user_id, join_token:)
20
+ post("/memberships", memberships: {
21
+ join_token: join_token,
22
+ links: {user: user_id, user_group: user_group_id}
23
+ })["memberships"][0]
24
+ end
14
25
  end
15
26
  end
16
27
  end
@@ -1,5 +1,5 @@
1
1
  module Panoptes
2
2
  class Client
3
- VERSION = "0.2.1"
3
+ VERSION = "0.2.2"
4
4
  end
5
5
  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.1
4
+ version: 0.2.2
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-02-10 00:00:00.000000000 Z
11
+ date: 2016-02-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
140
140
  version: '0'
141
141
  requirements: []
142
142
  rubyforge_project:
143
- rubygems_version: 2.5.1
143
+ rubygems_version: 2.5.2
144
144
  signing_key:
145
145
  specification_version: 4
146
146
  summary: API wrapper for https://panoptes.zooniverse.org