panoptes-client 0.3.0 → 0.3.1
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/CHANGELOG.md +4 -0
- data/lib/panoptes/client.rb +21 -7
- data/lib/panoptes/client/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 540f683db234bc8033e9431841393bb159adde19
|
|
4
|
+
data.tar.gz: d93345cca9db9d40c24a7abfbf2b15a6a79ac485
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 68939b3810367e0331b6a1d2a0c748d2fdd1d0c0fad07ba6e17925899b1cc8e7d44559f7e03ecf4f23d7fbb59b024d3e3bc2e30e268b3e9b336b2b9057e9872f
|
|
7
|
+
data.tar.gz: a8d8674148c5fe92a4c7fc3d337ccaec9eea3d90d0683c2f7cad8394b5132db11f415061c3b7b7eea3052064996964488b9915d451a78a758728652079b93c5b
|
data/CHANGELOG.md
CHANGED
data/lib/panoptes/client.rb
CHANGED
|
@@ -17,18 +17,21 @@ require 'panoptes/client/workflows'
|
|
|
17
17
|
module Panoptes
|
|
18
18
|
class Client
|
|
19
19
|
include Panoptes::Client::Me
|
|
20
|
+
|
|
21
|
+
# Panoptes
|
|
22
|
+
include Panoptes::Client::Classifications
|
|
23
|
+
include Panoptes::Client::Collections
|
|
20
24
|
include Panoptes::Client::Projects
|
|
21
25
|
include Panoptes::Client::Subjects
|
|
22
26
|
include Panoptes::Client::SubjectSets
|
|
23
27
|
include Panoptes::Client::UserGroups
|
|
24
28
|
include Panoptes::Client::Workflows
|
|
25
29
|
|
|
26
|
-
|
|
30
|
+
# Talk
|
|
27
31
|
include Panoptes::Client::Comments
|
|
32
|
+
include Panoptes::Client::Discussions
|
|
28
33
|
|
|
29
|
-
|
|
30
|
-
include Panoptes::Client::Classifications
|
|
31
|
-
|
|
34
|
+
# Cellect
|
|
32
35
|
include Panoptes::Client::Cellect
|
|
33
36
|
|
|
34
37
|
class GenericError < StandardError; end
|
|
@@ -39,12 +42,12 @@ module Panoptes
|
|
|
39
42
|
|
|
40
43
|
attr_reader :env, :auth, :panoptes, :talk, :cellect
|
|
41
44
|
|
|
42
|
-
def initialize(env: :production, auth: {}, public_key_path: nil
|
|
45
|
+
def initialize(env: :production, auth: {}, public_key_path: nil)
|
|
43
46
|
@env = env
|
|
44
47
|
@auth = auth
|
|
45
|
-
@public_key_path = public_key_path
|
|
48
|
+
@public_key_path = public_key_path || public_key_for_env(env)
|
|
46
49
|
@panoptes = Panoptes::Endpoints::JsonApiEndpoint.new(
|
|
47
|
-
auth: auth, url: panoptes_url, prefix: '/api'
|
|
50
|
+
auth: auth, url: panoptes_url, prefix: '/api'
|
|
48
51
|
)
|
|
49
52
|
@talk = Panoptes::Endpoints::JsonApiEndpoint.new(
|
|
50
53
|
auth: auth, url: talk_url
|
|
@@ -65,6 +68,17 @@ module Panoptes
|
|
|
65
68
|
@jwt_signing_public_key ||= OpenSSL::PKey::RSA.new(File.read(@public_key_path))
|
|
66
69
|
end
|
|
67
70
|
|
|
71
|
+
def public_key_for_env(env)
|
|
72
|
+
case env.to_s
|
|
73
|
+
when "staging"
|
|
74
|
+
File.expand_path(File.join("..", "..", "..", "data", "doorkeeper-jwt-staging.pub"), __FILE__)
|
|
75
|
+
when "production"
|
|
76
|
+
File.expand_path(File.join("..", "..", "..", "data", "doorkeeper-jwt-production.pub"), __FILE__)
|
|
77
|
+
else
|
|
78
|
+
nil
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
|
|
68
82
|
def panoptes_url
|
|
69
83
|
case env
|
|
70
84
|
when :production, 'production'.freeze
|
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.
|
|
4
|
+
version: 0.3.1
|
|
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-
|
|
11
|
+
date: 2017-06-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|
|
@@ -184,7 +184,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
184
184
|
version: '0'
|
|
185
185
|
requirements: []
|
|
186
186
|
rubyforge_project:
|
|
187
|
-
rubygems_version: 2.
|
|
187
|
+
rubygems_version: 2.6.8
|
|
188
188
|
signing_key:
|
|
189
189
|
specification_version: 4
|
|
190
190
|
summary: API wrapper for https://panoptes.zooniverse.org
|