panoptes-client 0.3.2 → 0.3.3

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: c331204bb683ecc3c0873e97bd4558e0842887b9
4
- data.tar.gz: 5e8385fbec93b53f4c6150590b35752f2a9725f3
3
+ metadata.gz: abd5f8f842e58644904e3f1f6eea7d30b3bfeeb5
4
+ data.tar.gz: 1b5c1fbf52c95544b4e99f1c28dcf4400eb74ec3
5
5
  SHA512:
6
- metadata.gz: 2ea5b1801eea313d0fff586c8eaf1efb14f2a8fef6df2770ff1679e1ead823df958c2f75c4641ea8f29cdddc9c4be3c5c4cb7c4f24d32d0376e0e980d6d0c02d
7
- data.tar.gz: f06ec0ad6361cf463b895f15d1c4c9b5705eab352c93bc917905d9321580f41050f377c0cc4b89dbbd374f92f4bb1487ad00102b90ab89e5e1c4fd7f21dda044
6
+ metadata.gz: 0fa1849d30dde85e6ab1bb231b16ecf5b2ebd20c0b1e168a49581370aa66486d60c77421e7df518d0f751d9e343700fcfe584ff52c024e9c07b70dbd995d2d30
7
+ data.tar.gz: 5084426a472808ea540b0e7ae04700de3b3ae95ed05800edf00a4434c9c4667378597a3fa851502280cd36bef3641ca7babfd5f1c07d310272e2b8eaee91b11b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ # 0.3.3
2
+
3
+ * `client.get_subject_classifications` now paginates if there is more than one page
4
+
5
+ # 0.3.2
6
+
7
+ ?
8
+
1
9
  # 0.3.1
2
10
 
3
11
  * Automatically loads active public key (as of gem release)
@@ -2,11 +2,11 @@ module Panoptes
2
2
  class Client
3
3
  module Classifications
4
4
  def get_subject_classifications(subject_id, workflow_id)
5
- panoptes.get("/classifications/project", {
5
+ panoptes.paginate("/classifications/project", {
6
6
  admin: true,
7
7
  workflow_id: workflow_id,
8
8
  subject_id: subject_id
9
- })
9
+ }, resource: "classifications")
10
10
  end
11
11
  end
12
12
  end
@@ -5,11 +5,14 @@ module Panoptes
5
5
  #
6
6
  # @param subject_set_id [Integer] filter by subject set
7
7
  # @return list of subjects
8
- def subjects(subject_set_id:)
8
+ def subjects(subject_set_id: nil, workflow_id: nil)
9
9
  query = {}
10
- query[:subject_set_id] = subject_set_id
10
+ query[:subject_set_id] = subject_set_id if subject_set_id
11
+ query[:workflow_id] = workflow_id if workflow_id
11
12
 
12
- response = panoptes.get("/subjects", query)
13
+ raise 'Must filter on at least one of subject_set_id, workflow_id' if query.empty?
14
+
15
+ response = panoptes.paginate("/subjects", query)
13
16
  response.fetch("subjects")
14
17
  end
15
18
 
@@ -1,5 +1,5 @@
1
1
  module Panoptes
2
2
  class Client
3
- VERSION = "0.3.2".freeze
3
+ VERSION = "0.3.3".freeze
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.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marten Veldthuis
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-06-14 00:00:00.000000000 Z
11
+ date: 2017-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -184,9 +184,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
184
184
  version: '0'
185
185
  requirements: []
186
186
  rubyforge_project:
187
- rubygems_version: 2.6.8
187
+ rubygems_version: 2.6.11
188
188
  signing_key:
189
189
  specification_version: 4
190
190
  summary: API wrapper for https://panoptes.zooniverse.org
191
191
  test_files: []
192
- has_rdoc: