sul_orcid_client 0.3.1 → 0.4.0

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
  SHA256:
3
- metadata.gz: 57218fe5c199745f0479d48ffde6483d94ec7dac3f33d278bb37a796bcd5534a
4
- data.tar.gz: 21824eef4efdb0c1c668483b1d4b1c4e42f7d8417db77c0ef85eb79d6cbe1fa6
3
+ metadata.gz: f1cb74cbce1d27862da0f058974e0ca4233e5e8cbcaa956ce5682be779206bb0
4
+ data.tar.gz: 71e80c4c62957681faf99df97cc843e34d83c3c450b1cb7471b2d39ad347adce
5
5
  SHA512:
6
- metadata.gz: 5623cd78ba366d9ddf1e33aa6eb858d787aca52deee5c569a7ae6fa1333e8f2134b39781aac6c47e772367ed4d51a4eea348ea728acb2ba4b8c64697d3041ff4
7
- data.tar.gz: 64c1672225217bbd8b6cc7b962bea2549ef2432558902a396919778ede223fa78922b54dc73a7eee4087c5bada798c53fb4abe86e385afc35cf87199a989bf38
6
+ metadata.gz: '09f5190810198153c3f5a6726113f8d57cfa1942ead9a38aa43c392c5b42ec7f7403a228c35f4e04a79a0e18696916b066900f7faf33429abda23eeeeb8c955e'
7
+ data.tar.gz: 016d439926b46f5098a659fed9a90b1fe4f4fb699b8edee598861d4bdf04f3f791d2144785c642d4c4fa657213dcf87da5b49d867c986f451d5e23d7cca2b522
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sul_orcid_client (0.3.1)
4
+ sul_orcid_client (0.4.0)
5
5
  activesupport (>= 4.2, < 8)
6
6
  cocina-models (~> 0.90)
7
7
  faraday
@@ -12,40 +12,50 @@ PATH
12
12
  GEM
13
13
  remote: https://rubygems.org/
14
14
  specs:
15
- activesupport (7.0.7)
15
+ activesupport (7.1.2)
16
+ base64
17
+ bigdecimal
16
18
  concurrent-ruby (~> 1.0, >= 1.0.2)
19
+ connection_pool (>= 2.2.5)
20
+ drb
17
21
  i18n (>= 1.6, < 2)
18
22
  minitest (>= 5.1)
23
+ mutex_m
19
24
  tzinfo (~> 2.0)
20
25
  addressable (2.8.5)
21
26
  public_suffix (>= 2.0.2, < 6.0)
22
27
  ast (2.4.2)
23
28
  attr_extras (7.1.0)
24
- base64 (0.1.1)
29
+ base64 (0.2.0)
30
+ bigdecimal (3.1.4)
25
31
  byebug (11.1.3)
26
- cocina-models (0.90.0)
32
+ cocina-models (0.93.0)
27
33
  activesupport
28
34
  deprecation
29
35
  dry-struct (~> 1.0)
30
36
  dry-types (~> 1.1)
31
37
  edtf
32
38
  equivalent-xml
39
+ i18n
33
40
  jsonpath
34
41
  nokogiri
35
42
  openapi3_parser
36
- openapi_parser (>= 0.11.1, < 1.0)
43
+ openapi_parser (~> 1.0)
37
44
  rss
38
45
  super_diff
39
46
  thor
40
47
  zeitwerk (~> 2.1)
41
48
  commonmarker (0.23.10)
42
49
  concurrent-ruby (1.2.2)
50
+ connection_pool (2.4.1)
43
51
  crack (0.4.5)
44
52
  rexml
45
53
  deprecation (1.1.0)
46
54
  activesupport
47
55
  diff-lcs (1.5.0)
48
56
  docile (1.4.0)
57
+ drb (2.2.0)
58
+ ruby2_keywords
49
59
  dry-core (1.0.1)
50
60
  concurrent-ruby (~> 1.0)
51
61
  zeitwerk (~> 2.6)
@@ -69,7 +79,8 @@ GEM
69
79
  activesupport (>= 3.0, < 8.0)
70
80
  equivalent-xml (0.6.0)
71
81
  nokogiri (>= 1.4.3)
72
- faraday (2.7.10)
82
+ faraday (2.7.11)
83
+ base64
73
84
  faraday-net_http (>= 2.0, < 3.1)
74
85
  ruby2_keywords (>= 0.0.4)
75
86
  faraday-net_http (3.0.2)
@@ -81,14 +92,15 @@ GEM
81
92
  concurrent-ruby (~> 1.0)
82
93
  ice_nine (0.11.2)
83
94
  json (2.6.3)
84
- jsonpath (1.1.3)
95
+ jsonpath (1.1.5)
85
96
  multi_json
86
97
  jwt (2.7.1)
87
98
  language_server-protocol (3.17.0.3)
88
99
  lint_roller (1.1.0)
89
- minitest (5.19.0)
100
+ minitest (5.20.0)
90
101
  multi_json (1.15.0)
91
102
  multi_xml (0.6.0)
103
+ mutex_m (0.2.0)
92
104
  nokogiri (1.15.4-x86_64-darwin)
93
105
  racc (~> 1.4)
94
106
  nokogiri (1.15.4-x86_64-linux)
@@ -102,20 +114,20 @@ GEM
102
114
  version_gem (~> 1.1)
103
115
  openapi3_parser (0.9.2)
104
116
  commonmarker (~> 0.17)
105
- openapi_parser (0.15.0)
117
+ openapi_parser (1.0.0)
106
118
  optimist (3.1.0)
107
119
  parallel (1.23.0)
108
- parser (3.2.2.3)
120
+ parser (3.2.2.4)
109
121
  ast (~> 2.4.1)
110
122
  racc
111
123
  patience_diff (1.2.0)
112
124
  optimist (~> 3.0)
113
125
  public_suffix (5.0.3)
114
- racc (1.7.1)
126
+ racc (1.7.3)
115
127
  rack (3.0.8)
116
128
  rainbow (3.1.1)
117
- rake (13.0.6)
118
- regexp_parser (2.8.1)
129
+ rake (13.1.0)
130
+ regexp_parser (2.8.2)
119
131
  rexml (3.2.6)
120
132
  rspec (3.12.0)
121
133
  rspec-core (~> 3.12.0)
@@ -132,29 +144,28 @@ GEM
132
144
  rspec-support (3.12.1)
133
145
  rss (0.3.0)
134
146
  rexml
135
- rubocop (1.56.1)
136
- base64 (~> 0.1.1)
147
+ rubocop (1.57.2)
137
148
  json (~> 2.3)
138
149
  language_server-protocol (>= 3.17.0)
139
150
  parallel (~> 1.10)
140
- parser (>= 3.2.2.3)
151
+ parser (>= 3.2.2.4)
141
152
  rainbow (>= 2.2.2, < 4.0)
142
153
  regexp_parser (>= 1.8, < 3.0)
143
154
  rexml (>= 3.2.5, < 4.0)
144
155
  rubocop-ast (>= 1.28.1, < 2.0)
145
156
  ruby-progressbar (~> 1.7)
146
157
  unicode-display_width (>= 2.4.0, < 3.0)
147
- rubocop-ast (1.29.0)
158
+ rubocop-ast (1.30.0)
148
159
  parser (>= 3.2.1.0)
149
- rubocop-capybara (2.18.0)
160
+ rubocop-capybara (2.19.0)
150
161
  rubocop (~> 1.41)
151
- rubocop-factory_bot (2.23.1)
162
+ rubocop-factory_bot (2.24.0)
152
163
  rubocop (~> 1.33)
153
- rubocop-performance (1.19.0)
164
+ rubocop-performance (1.19.1)
154
165
  rubocop (>= 1.7.0, < 2.0)
155
166
  rubocop-ast (>= 0.4.0)
156
- rubocop-rspec (2.23.2)
157
- rubocop (~> 1.33)
167
+ rubocop-rspec (2.25.0)
168
+ rubocop (~> 1.40)
158
169
  rubocop-capybara (~> 2.17)
159
170
  rubocop-factory_bot (~> 2.22)
160
171
  ruby-progressbar (1.13.0)
@@ -168,35 +179,36 @@ GEM
168
179
  snaky_hash (2.0.1)
169
180
  hashie
170
181
  version_gem (~> 1.1, >= 1.1.1)
171
- standard (1.31.0)
182
+ standard (1.32.0)
172
183
  language_server-protocol (~> 3.17.0.2)
173
184
  lint_roller (~> 1.0)
174
- rubocop (~> 1.56.0)
185
+ rubocop (~> 1.57.2)
175
186
  standard-custom (~> 1.0.0)
176
187
  standard-performance (~> 1.2)
177
188
  standard-custom (1.0.2)
178
189
  lint_roller (~> 1.0)
179
190
  rubocop (~> 1.50)
180
- standard-performance (1.2.0)
191
+ standard-performance (1.2.1)
181
192
  lint_roller (~> 1.1)
182
- rubocop-performance (~> 1.19.0)
193
+ rubocop-performance (~> 1.19.1)
183
194
  super_diff (0.10.0)
184
195
  attr_extras (>= 6.2.4)
185
196
  diff-lcs
186
197
  patience_diff
187
- thor (1.2.2)
198
+ thor (1.3.0)
188
199
  tzinfo (2.0.6)
189
200
  concurrent-ruby (~> 1.0)
190
- unicode-display_width (2.4.2)
201
+ unicode-display_width (2.5.0)
191
202
  vcr (6.2.0)
192
203
  version_gem (1.1.3)
193
- webmock (3.18.1)
204
+ webmock (3.19.1)
194
205
  addressable (>= 2.8.0)
195
206
  crack (>= 0.3.2)
196
207
  hashdiff (>= 0.4.0, < 2.0.0)
197
- zeitwerk (2.6.11)
208
+ zeitwerk (2.6.12)
198
209
 
199
210
  PLATFORMS
211
+ x86_64-darwin-19
200
212
  x86_64-darwin-22
201
213
  x86_64-linux
202
214
 
@@ -1,5 +1,9 @@
1
1
  class SulOrcidClient
2
2
  # Helper methods for working with Orcid in Cocina
3
+ # NOTE: there is similar code in dor_indexing_app which fetches
4
+ # ORCIDs out of cocina. Consider consolidating at some point or keeping in sync.
5
+ # see https://github.com/sul-dlss/dor_indexing_app/blob/main/app/services/orcid_builder.rb
6
+ # and https://github.com/sul-dlss/dor_indexing_app/issues/1022
3
7
  class CocinaSupport
4
8
  # @param [Cocina::Models::Contributor] contributor to check
5
9
  # @return [Boolean] true unless the contributor has a citation status of false
@@ -13,7 +17,11 @@ class SulOrcidClient
13
17
  identifier = contributor.identifier.find { |identifier| identifier.type == "ORCID" }
14
18
  return unless identifier
15
19
 
16
- URI.join(identifier.source.uri, identifier.value).to_s
20
+ # some records have the full ORCID URI in the data, just return it if so, e.g. druid:gf852zt8324
21
+ return identifier.uri if identifier.uri
22
+ return identifier.value if identifier.value.start_with?("https://orcid.org/")
23
+
24
+ URI.join("https://orcid.org/", identifier.value).to_s
17
25
  end
18
26
 
19
27
  # @param [Cocina::Models::Description] description containing contributors to check
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class SulOrcidClient
4
- VERSION = "0.3.1"
4
+ VERSION = "0.4.0"
5
5
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "active_support/core_ext/module/delegation"
4
- require "active_support/core_ext/hash/indifferent_access"
3
+ require "active_support"
4
+ require "active_support/core_ext"
5
5
 
6
6
  require "faraday"
7
7
  require "faraday/retry"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sul_orcid_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Mangiafico
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2023-08-25 00:00:00.000000000 Z
12
+ date: 2023-11-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -244,7 +244,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
244
244
  - !ruby/object:Gem::Version
245
245
  version: '0'
246
246
  requirements: []
247
- rubygems_version: 3.4.10
247
+ rubygems_version: 3.4.21
248
248
  signing_key:
249
249
  specification_version: 4
250
250
  summary: Interface for interacting with the ORCID API.