sul_orcid_client 0.7.0 → 0.8.0

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
  SHA256:
3
- metadata.gz: 8c0b1ede02c640634f62eeeaecdc164ba772b6892cab517a3d33b3a1e6a880b8
4
- data.tar.gz: 1e16d0da5a41b5af16c7388f84cb4fcf6384d7987ae73f5327e8e61cdc077b3f
3
+ metadata.gz: a9f8c0cdbbd579e4e9922b2225c2780d8822b398e937ee1012d48dca1b00ad94
4
+ data.tar.gz: edb6936a029080f50ea8de31b2ea57f70a2f26ffe1c00570dd4283087ebaf5d1
5
5
  SHA512:
6
- metadata.gz: 6ec8a59ab3f5f8869d735eb56c04a5bf95eb4393fbd7441f3995d112e3dbb113ad532520d845406d8d2f44e1ef3675c660e566fc1794af725cd1c8f19f67bfb7
7
- data.tar.gz: a200843b3089908ce16aae221972b002aa0d6f586f9463b069b44252deada3e93423cd4eafc0cfb77c0f169e74f746d6c48c312c84a467fa4b44a287704ab282
6
+ metadata.gz: 7b760b6a8c634233fa2eb71ed7c812226a2f948eaab2e32a5f9104df736bf50f733cad45c395b73d9997f4d95c1adbd0f7e28cb94fe581b63e89a6c9572057c0
7
+ data.tar.gz: 78991a512207404b5a3d456c5f3149f091a522c17b4bea4b656d20b2c33d8a182454b4a2fd003e734c0559b46d93e09273409480c26fecc7d60e66d18b4a7590
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sul_orcid_client (0.7.0)
4
+ sul_orcid_client (0.8.0)
5
5
  activesupport (>= 4.2)
6
6
  cocina-models (~> 0.90)
7
7
  faraday
@@ -12,7 +12,7 @@ PATH
12
12
  GEM
13
13
  remote: https://rubygems.org/
14
14
  specs:
15
- activesupport (8.0.2)
15
+ activesupport (8.0.2.1)
16
16
  base64
17
17
  benchmark (>= 0.3)
18
18
  bigdecimal
@@ -31,9 +31,9 @@ GEM
31
31
  attr_extras (7.1.0)
32
32
  base64 (0.3.0)
33
33
  benchmark (0.4.1)
34
- bigdecimal (3.2.2)
34
+ bigdecimal (3.2.3)
35
35
  byebug (12.0.0)
36
- cocina-models (0.104.1)
36
+ cocina-models (0.106.0)
37
37
  activesupport
38
38
  deprecation
39
39
  dry-struct (~> 1.0)
@@ -48,7 +48,7 @@ GEM
48
48
  thor
49
49
  zeitwerk (~> 2.1)
50
50
  concurrent-ruby (1.3.5)
51
- connection_pool (2.5.3)
51
+ connection_pool (2.5.4)
52
52
  crack (1.0.0)
53
53
  bigdecimal
54
54
  rexml
@@ -83,7 +83,7 @@ GEM
83
83
  activesupport (>= 3.0, < 9.0)
84
84
  equivalent-xml (0.6.0)
85
85
  nokogiri (>= 1.4.3)
86
- faraday (2.13.2)
86
+ faraday (2.13.4)
87
87
  faraday-net_http (>= 2.0, < 3.5)
88
88
  json
89
89
  logger
@@ -91,12 +91,12 @@ GEM
91
91
  net-http (>= 0.5.0)
92
92
  faraday-retry (2.3.2)
93
93
  faraday (~> 2.0)
94
- hashdiff (1.2.0)
94
+ hashdiff (1.2.1)
95
95
  hashie (5.0.0)
96
96
  i18n (1.14.7)
97
97
  concurrent-ruby (~> 1.0)
98
98
  ice_nine (0.11.2)
99
- json (2.12.2)
99
+ json (2.14.1)
100
100
  jsonpath (1.1.5)
101
101
  multi_json
102
102
  jwt (3.1.2)
@@ -105,41 +105,41 @@ GEM
105
105
  lint_roller (1.1.0)
106
106
  logger (1.7.0)
107
107
  minitest (5.25.5)
108
- multi_json (1.15.0)
108
+ multi_json (1.17.0)
109
109
  multi_xml (0.7.2)
110
110
  bigdecimal (~> 3.1)
111
111
  net-http (0.6.0)
112
112
  uri
113
- nokogiri (1.18.8-arm64-darwin)
113
+ nokogiri (1.18.10-arm64-darwin)
114
114
  racc (~> 1.4)
115
- nokogiri (1.18.8-x86_64-darwin)
115
+ nokogiri (1.18.10-x86_64-darwin)
116
116
  racc (~> 1.4)
117
- nokogiri (1.18.8-x86_64-linux-gnu)
117
+ nokogiri (1.18.10-x86_64-linux-gnu)
118
118
  racc (~> 1.4)
119
- oauth2 (2.0.12)
119
+ oauth2 (2.0.17)
120
120
  faraday (>= 0.17.3, < 4.0)
121
121
  jwt (>= 1.0, < 4.0)
122
122
  logger (~> 1.2)
123
123
  multi_xml (~> 0.5)
124
124
  rack (>= 1.2, < 4)
125
125
  snaky_hash (~> 2.0, >= 2.0.3)
126
- version_gem (>= 1.1.8, < 3)
126
+ version_gem (~> 1.1, >= 1.1.9)
127
127
  openapi_parser (1.0.0)
128
128
  optimist (3.2.1)
129
129
  parallel (1.27.0)
130
- parser (3.3.8.0)
130
+ parser (3.3.9.0)
131
131
  ast (~> 2.4.1)
132
132
  racc
133
133
  patience_diff (1.2.0)
134
134
  optimist (~> 3.0)
135
- prism (1.4.0)
135
+ prism (1.5.1)
136
136
  public_suffix (6.0.2)
137
137
  racc (1.8.1)
138
- rack (3.1.16)
138
+ rack (3.2.1)
139
139
  rainbow (3.1.1)
140
140
  rake (13.3.0)
141
- regexp_parser (2.10.0)
142
- rexml (3.4.1)
141
+ regexp_parser (2.11.3)
142
+ rexml (3.4.4)
143
143
  rspec (3.13.1)
144
144
  rspec-core (~> 3.13.0)
145
145
  rspec-expectations (~> 3.13.0)
@@ -152,8 +152,8 @@ GEM
152
152
  rspec-mocks (3.13.5)
153
153
  diff-lcs (>= 1.2.0, < 2.0)
154
154
  rspec-support (~> 3.13.0)
155
- rspec-support (3.13.4)
156
- rubocop (1.77.0)
155
+ rspec-support (3.13.6)
156
+ rubocop (1.80.2)
157
157
  json (~> 2.3)
158
158
  language_server-protocol (~> 3.17.0.2)
159
159
  lint_roller (~> 1.1.0)
@@ -161,10 +161,10 @@ GEM
161
161
  parser (>= 3.3.0.2)
162
162
  rainbow (>= 2.2.2, < 4.0)
163
163
  regexp_parser (>= 2.9.3, < 3.0)
164
- rubocop-ast (>= 1.45.1, < 2.0)
164
+ rubocop-ast (>= 1.46.0, < 2.0)
165
165
  ruby-progressbar (~> 1.7)
166
166
  unicode-display_width (>= 2.4.0, < 4.0)
167
- rubocop-ast (1.45.1)
167
+ rubocop-ast (1.47.1)
168
168
  parser (>= 3.3.7.2)
169
169
  prism (~> 1.4)
170
170
  rubocop-capybara (2.22.1)
@@ -173,11 +173,11 @@ GEM
173
173
  rubocop-factory_bot (2.27.1)
174
174
  lint_roller (~> 1.1)
175
175
  rubocop (~> 1.72, >= 1.72.1)
176
- rubocop-performance (1.25.0)
176
+ rubocop-performance (1.26.0)
177
177
  lint_roller (~> 1.1)
178
178
  rubocop (>= 1.75.0, < 2.0)
179
- rubocop-ast (>= 1.38.0, < 2.0)
180
- rubocop-rspec (3.6.0)
179
+ rubocop-ast (>= 1.44.0, < 2.0)
180
+ rubocop-rspec (3.7.0)
181
181
  lint_roller (~> 1.1)
182
182
  rubocop (~> 1.72, >= 1.72.1)
183
183
  rubocop-rspec_rails (2.31.0)
@@ -190,7 +190,7 @@ GEM
190
190
  docile (~> 1.1)
191
191
  simplecov-html (~> 0.11)
192
192
  simplecov_json_formatter (~> 0.1)
193
- simplecov-html (0.13.1)
193
+ simplecov-html (0.13.2)
194
194
  simplecov_json_formatter (0.1.4)
195
195
  snaky_hash (2.0.3)
196
196
  hashie (>= 0.1.0, < 6)
@@ -199,16 +199,16 @@ GEM
199
199
  attr_extras (>= 6.2.4)
200
200
  diff-lcs
201
201
  patience_diff
202
- thor (1.3.2)
202
+ thor (1.4.0)
203
203
  tzinfo (2.0.6)
204
204
  concurrent-ruby (~> 1.0)
205
- unicode-display_width (3.1.4)
206
- unicode-emoji (~> 4.0, >= 4.0.4)
207
- unicode-emoji (4.0.4)
205
+ unicode-display_width (3.2.0)
206
+ unicode-emoji (~> 4.1)
207
+ unicode-emoji (4.1.0)
208
208
  uri (1.0.3)
209
209
  vcr (6.3.1)
210
210
  base64
211
- version_gem (1.1.8)
211
+ version_gem (1.1.9)
212
212
  webmock (3.25.1)
213
213
  addressable (>= 2.8.0)
214
214
  crack (>= 0.3.2)
@@ -238,4 +238,4 @@ DEPENDENCIES
238
238
  webmock
239
239
 
240
240
  BUNDLED WITH
241
- 2.6.9
241
+ 2.7.2
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class SulOrcidClient
4
- VERSION = '0.7.0'
4
+ VERSION = '0.8.0'
5
5
  end
@@ -44,7 +44,7 @@ class SulOrcidClient
44
44
  attr_reader :description, :doi
45
45
 
46
46
  def map_title
47
- title = description.title.first&.value
47
+ title = simple_title.presence || structured_title
48
48
  raise WorkMapperError, 'Title not mapped' unless title
49
49
 
50
50
  {
@@ -54,6 +54,20 @@ class SulOrcidClient
54
54
  }
55
55
  end
56
56
 
57
+ def simple_title
58
+ first_title&.value
59
+ end
60
+
61
+ def structured_title
62
+ return if first_title.structuredValue.blank?
63
+
64
+ first_title.structuredValue.find { |sv| sv.type == 'main title' }&.value
65
+ end
66
+
67
+ def first_title
68
+ description.title.first
69
+ end
70
+
57
71
  def map_short_description
58
72
  description.note.find { |note| note.type == 'abstract' }&.value
59
73
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sul_orcid_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Mangiafico
8
8
  - Justin Littman
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-07-08 00:00:00.000000000 Z
11
+ date: 1980-01-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -290,7 +290,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
290
290
  - !ruby/object:Gem::Version
291
291
  version: '0'
292
292
  requirements: []
293
- rubygems_version: 3.6.2
293
+ rubygems_version: 3.7.0
294
294
  specification_version: 4
295
295
  summary: Interface for interacting with the ORCID API.
296
296
  test_files: []