panoptes-client 0.3.5 → 0.3.6
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/lib/panoptes/client.rb +4 -0
- data/lib/panoptes/client/project_preferences.rb +33 -0
- data/lib/panoptes/client/users.rb +10 -0
- data/lib/panoptes/client/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89ee396e9d5d582ce684a5c1d32f3341b6757e35
|
4
|
+
data.tar.gz: 5420c9d981e2e119d645943878d8c856f384d06f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1600fba32b1c616153c58dc661c762abf98bba509bd0773117e6d7fe579050d97f5cd9b5cf56cd23d1514ea795f135a49d7583aa7da15063a889d0f2c0f5164b
|
7
|
+
data.tar.gz: 20027bd022aa23c56ad328f2f0a51ca5f1781318e21a8945d741e5f83e13584b17cbcd6fe0f5d163fbf8babc0dbecf0ecb6e3238c668677ad4dcae1d8dddbe11
|
data/lib/panoptes/client.rb
CHANGED
@@ -8,8 +8,10 @@ require 'panoptes/client/comments'
|
|
8
8
|
require 'panoptes/client/discussions'
|
9
9
|
require 'panoptes/client/me'
|
10
10
|
require 'panoptes/client/projects'
|
11
|
+
require 'panoptes/client/project_preferences'
|
11
12
|
require 'panoptes/client/subject_sets'
|
12
13
|
require 'panoptes/client/subjects'
|
14
|
+
require 'panoptes/client/users'
|
13
15
|
require 'panoptes/client/user_groups'
|
14
16
|
require 'panoptes/client/version'
|
15
17
|
require 'panoptes/client/workflows'
|
@@ -22,8 +24,10 @@ module Panoptes
|
|
22
24
|
include Panoptes::Client::Classifications
|
23
25
|
include Panoptes::Client::Collections
|
24
26
|
include Panoptes::Client::Projects
|
27
|
+
include Panoptes::Client::ProjectPreferences
|
25
28
|
include Panoptes::Client::Subjects
|
26
29
|
include Panoptes::Client::SubjectSets
|
30
|
+
include Panoptes::Client::Users
|
27
31
|
include Panoptes::Client::UserGroups
|
28
32
|
include Panoptes::Client::Workflows
|
29
33
|
|
@@ -0,0 +1,33 @@
|
|
1
|
+
|
2
|
+
module Panoptes
|
3
|
+
class Client
|
4
|
+
module ProjectPreferences
|
5
|
+
def project_preferences(id)
|
6
|
+
response = panoptes.get("project_preferences/#{id}")
|
7
|
+
response.fetch("project_preferences").first
|
8
|
+
end
|
9
|
+
|
10
|
+
def user_project_preferences(user_id, project_id)
|
11
|
+
response = panoptes.get("project_preferences", {
|
12
|
+
user_id: user_id,
|
13
|
+
project_id: project_id
|
14
|
+
})
|
15
|
+
response.fetch("project_preferences").first
|
16
|
+
end
|
17
|
+
|
18
|
+
def promote_user_to_workflow(user_id, project_id, workflow_id)
|
19
|
+
id = panoptes.get("project_preferences", {
|
20
|
+
user_id: user_id,
|
21
|
+
project_id: project_id
|
22
|
+
}).fetch("project_preferences").first["id"]
|
23
|
+
|
24
|
+
response = panoptes.connection.get("/api/project_preferences/#{id}")
|
25
|
+
etag = response.headers["ETag"]
|
26
|
+
|
27
|
+
panoptes.put("project_preferences/#{id}", {
|
28
|
+
project_preferences: { settings: { workflow_id: workflow_id } }
|
29
|
+
}, etag: etag)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: panoptes-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marten Veldthuis
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2018-02-01 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: faraday
|
@@ -156,10 +156,12 @@ files:
|
|
156
156
|
- lib/panoptes/client/comments.rb
|
157
157
|
- lib/panoptes/client/discussions.rb
|
158
158
|
- lib/panoptes/client/me.rb
|
159
|
+
- lib/panoptes/client/project_preferences.rb
|
159
160
|
- lib/panoptes/client/projects.rb
|
160
161
|
- lib/panoptes/client/subject_sets.rb
|
161
162
|
- lib/panoptes/client/subjects.rb
|
162
163
|
- lib/panoptes/client/user_groups.rb
|
164
|
+
- lib/panoptes/client/users.rb
|
163
165
|
- lib/panoptes/client/version.rb
|
164
166
|
- lib/panoptes/client/workflows.rb
|
165
167
|
- lib/panoptes/endpoints/base_endpoint.rb
|