orcid_client 0.1 → 0.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 54f06cf497dfe171a49f47fde54c1e48ea99d23e
4
- data.tar.gz: 080aa75e6d0fe7f21caf5bba3989089a942f7028
3
+ metadata.gz: 06aedf6fc89c166ce34cf962980c670b03002dc6
4
+ data.tar.gz: 99915c37f16c28789753bdbd0e4ff7cc962d63c2
5
5
  SHA512:
6
- metadata.gz: ff5f961def7bff03bcee0d545eba8239866ed41a3f35ea7ca575764b611f859cc0d237588bf30c12333c57b6da9039a25a8f000d8bd9c91a9aecd6fa48b86ffe
7
- data.tar.gz: 0e92bcefad358d649f24df1807f36c9bb4b210ad9a259c321f683b3ce3dc70b6635d17de6d2f328d04e817f7d84a956cb3a3c99f4e025db8d7b246d597b58ff8
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.12.5
115
+ 1.13.6
@@ -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
@@ -1,3 +1,3 @@
1
1
  module OrcidClient
2
- VERSION = "0.1"
2
+ VERSION = "0.1.3"
3
3
  end
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: '0.1'
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-18 00:00:00.000000000 Z
11
+ date: 2016-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: maremma