orcid_client 0.1 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/orcid_client/api.rb +3 -5
- data/lib/orcid_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: 06aedf6fc89c166ce34cf962980c670b03002dc6
|
4
|
+
data.tar.gz: 99915c37f16c28789753bdbd0e4ff7cc962d63c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f12959214bdabcc005dffc01d0171d3a513ecad5c200008d3e991ddad59bea309132e454f5963fd30934408bd0b02fdb60af391f737ffa42ddd927cdaa31b4b
|
7
|
+
data.tar.gz: e59c507d30647c106c508ccd112c0054f41bc4bc7dc4d992d950f44178e7dda7fa29c953d5394b45b38e9a0590b8483fdb78aa2f08177008563a4c04ecdc5fd2
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
orcid_client (0.1)
|
4
|
+
orcid_client (0.1.3)
|
5
5
|
activesupport (~> 4.2, >= 4.2.5)
|
6
6
|
builder (~> 3.2, >= 3.2.2)
|
7
7
|
dotenv (~> 2.1, >= 2.1.1)
|
@@ -112,4 +112,4 @@ DEPENDENCIES
|
|
112
112
|
webmock (~> 1.22, >= 1.22.3)
|
113
113
|
|
114
114
|
BUNDLED WITH
|
115
|
-
1.
|
115
|
+
1.13.6
|
data/lib/orcid_client/api.rb
CHANGED
@@ -21,7 +21,7 @@ module OrcidClient
|
|
21
21
|
url = "#{orcid_api_url}/v#{API_VERSION}/#{orcid}/work"
|
22
22
|
response = Maremma.post(url, content_type: 'application/vnd.orcid+xml', data: data, bearer: access_token)
|
23
23
|
put_code = response.fetch("headers", {}).fetch("Location", "").split("/").last
|
24
|
-
response.merge("put_code" => put_code)
|
24
|
+
response.merge("put_code" => put_code.present? ? put_code.to_i : nil)
|
25
25
|
end
|
26
26
|
|
27
27
|
def update_work(options={})
|
@@ -33,7 +33,7 @@ module OrcidClient
|
|
33
33
|
url = "#{orcid_api_url}/v#{API_VERSION}/#{orcid}/work/#{put_code}"
|
34
34
|
response = Maremma.put(url, content_type: 'application/vnd.orcid+xml', data: data, bearer: access_token)
|
35
35
|
put_code = response.fetch("headers", {}).fetch("Location", "").split("/").last
|
36
|
-
response.merge("put_code" => put_code)
|
36
|
+
response.merge("put_code" => put_code.present? ? put_code.to_i : nil)
|
37
37
|
end
|
38
38
|
|
39
39
|
def delete_work(options={})
|
@@ -44,8 +44,6 @@ module OrcidClient
|
|
44
44
|
|
45
45
|
url = "#{orcid_api_url}/v#{API_VERSION}/#{orcid}/work/#{put_code}"
|
46
46
|
response = Maremma.delete(url, content_type: 'application/vnd.orcid+xml', bearer: access_token)
|
47
|
-
put_code = response.fetch("headers", {}).fetch("Location", "").split("/").last
|
48
|
-
response.merge("put_code" => put_code)
|
49
47
|
end
|
50
48
|
|
51
49
|
def get_notification_access_token(client_id:, client_secret:, **options)
|
@@ -69,7 +67,7 @@ module OrcidClient
|
|
69
67
|
url = "#{orcid_api_url}/v#{API_VERSION}/#{orcid}/notification-permission"
|
70
68
|
response = Maremma.post(url, content_type: 'application/vnd.orcid+xml', data: data, bearer: notification_access_token)
|
71
69
|
put_code = response.fetch("headers", {}).fetch("Location", "").split("/").last
|
72
|
-
response.merge("put_code" => put_code)
|
70
|
+
response.merge("put_code" => put_code.present? ? put_code.to_i : nil)
|
73
71
|
end
|
74
72
|
end
|
75
73
|
end
|
data/lib/orcid_client/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: orcid_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Fenner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-11-
|
11
|
+
date: 2016-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: maremma
|