puree 2.9.2 → 2.10.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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +1 -2
- data/lib/puree/model/resource.rb +8 -0
- data/lib/puree/version.rb +1 -1
- data/lib/puree/xml_extractor/resource.rb +6 -0
- data/test/test_helper.rb +2 -2
- data/test/xml_extractor/xml_extractor_dataset_test.rb +35 -19
- data/test/xml_extractor/xml_extractor_project_test.rb +9 -3
- data/test/xml_extractor/xml_extractor_research_output_test.rb +4 -0
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6dd0b06031b0dce2cce517c85c91980f7ac6888e29f38777c467c1232429b0a3
|
|
4
|
+
data.tar.gz: '0397729310faef872d30dab6da50951908f70d8446d6409fa0d0269ed74fcb81'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 362173200782ba48932c1515de3a53d487f19f4c8a342ef2091c4633cb6a8118e644b4293efa0a492957d60cfe26a86b8a5beca3e10a34811dba3f39693a740e
|
|
7
|
+
data.tar.gz: e3d11f4e64a3507581c2229cf7c86242c7973b7f0c0a0e26764ea9483c723639e7d30f28a52d7026d35b6fed488dec4025824874cb06dcdb761f9929884c6cdb
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
|
3
3
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
|
4
4
|
|
|
5
|
+
## 2.10.0 2025-10-14
|
|
6
|
+
### Added
|
|
7
|
+
Dataset, research output - portal_url.
|
|
8
|
+
|
|
5
9
|
## 2.9.2 2023-08-31
|
|
6
10
|
### Removed
|
|
7
11
|
- Pessimistic operator for Ruby.
|
data/README.md
CHANGED
|
@@ -26,8 +26,6 @@ Or install it yourself as:
|
|
|
26
26
|
# For Extractor and REST modules.
|
|
27
27
|
config = {
|
|
28
28
|
url: 'https://YOUR_HOST/ws/api/YOUR_API_VERSION',
|
|
29
|
-
username: 'YOUR_USERNAME',
|
|
30
|
-
password: 'YOUR_PASSWORD',
|
|
31
29
|
api_key: 'YOUR_API_KEY'
|
|
32
30
|
}
|
|
33
31
|
```
|
|
@@ -42,6 +40,7 @@ Purée version | Pure API version
|
|
|
42
40
|
2.7 | 513
|
|
43
41
|
2.8 | 514
|
|
44
42
|
2.9 | 515, 516, 517, 518, 519, 520, 521, 522, 523, 524
|
|
43
|
+
2.10 | 524
|
|
45
44
|
|
|
46
45
|
## Extractor module
|
|
47
46
|
```ruby
|
data/lib/puree/model/resource.rb
CHANGED
|
@@ -26,6 +26,9 @@ module Puree
|
|
|
26
26
|
# @return [Time, nil]
|
|
27
27
|
attr_reader :modified_at
|
|
28
28
|
|
|
29
|
+
# @return [String, nil]
|
|
30
|
+
attr_reader :portal_url
|
|
31
|
+
|
|
29
32
|
# @param v [String]
|
|
30
33
|
def id=(v)
|
|
31
34
|
@id = v if v && !v.empty?
|
|
@@ -61,6 +64,11 @@ module Puree
|
|
|
61
64
|
@modified_at = v
|
|
62
65
|
end
|
|
63
66
|
|
|
67
|
+
# @param v [String]
|
|
68
|
+
def portal_url=(v)
|
|
69
|
+
@portal_url = v
|
|
70
|
+
end
|
|
71
|
+
|
|
64
72
|
end
|
|
65
73
|
end
|
|
66
74
|
end
|
data/lib/puree/version.rb
CHANGED
|
@@ -52,6 +52,11 @@ module Puree
|
|
|
52
52
|
xpath_query_for_multi_value '/info/previousUuids/previousUuid'
|
|
53
53
|
end
|
|
54
54
|
|
|
55
|
+
# @return [String, nil]
|
|
56
|
+
def portal_url
|
|
57
|
+
xpath_query_for_single_value('/info/portalUrl')
|
|
58
|
+
end
|
|
59
|
+
|
|
55
60
|
private
|
|
56
61
|
|
|
57
62
|
def xpath_query(path)
|
|
@@ -70,6 +75,7 @@ module Puree
|
|
|
70
75
|
@model.modified_by = modified_by
|
|
71
76
|
@model.modified_at = modified_at
|
|
72
77
|
@model.previous_uuids = previous_uuids
|
|
78
|
+
@model.portal_url = portal_url
|
|
73
79
|
end
|
|
74
80
|
|
|
75
81
|
end
|
data/test/test_helper.rb
CHANGED
|
@@ -34,24 +34,6 @@ class TestXMLExtractorDataset < Minitest::Test
|
|
|
34
34
|
assert_instance_of String, x.doi
|
|
35
35
|
refute_empty x.doi
|
|
36
36
|
|
|
37
|
-
assert_instance_of Array, x.files
|
|
38
|
-
assert_instance_of Puree::Model::File, x.files.first
|
|
39
|
-
assert x.files.first.data?
|
|
40
|
-
|
|
41
|
-
data = x.files.first
|
|
42
|
-
assert_instance_of Puree::Model::File, data
|
|
43
|
-
assert data.data?
|
|
44
|
-
assert_instance_of String, data.name
|
|
45
|
-
refute_empty data.name
|
|
46
|
-
# assert_instance_of String, data.mime
|
|
47
|
-
# refute_empty data.mime
|
|
48
|
-
# assert_instance_of Integer, data.size
|
|
49
|
-
assert_instance_of String, data.url
|
|
50
|
-
refute_empty data.url
|
|
51
|
-
assert_instance_of Puree::Model::CopyrightLicense, data.license
|
|
52
|
-
assert_instance_of String, data.license.name
|
|
53
|
-
refute_empty data.license.name
|
|
54
|
-
|
|
55
37
|
assert_instance_of Array, x.keywords
|
|
56
38
|
assert_instance_of String, x.keywords.first
|
|
57
39
|
refute_empty x.keywords.first
|
|
@@ -69,7 +51,7 @@ class TestXMLExtractorDataset < Minitest::Test
|
|
|
69
51
|
|
|
70
52
|
assert_instance_of Array, x.persons_external
|
|
71
53
|
assert_instance_of Puree::Model::EndeavourPerson, x.persons_external.first
|
|
72
|
-
assert_endeavour_person x.persons_external.first
|
|
54
|
+
assert_endeavour_person x.persons_external.first
|
|
73
55
|
|
|
74
56
|
assert_instance_of Puree::Model::TemporalRange, x.production
|
|
75
57
|
assert_temporal_range x.production
|
|
@@ -94,6 +76,14 @@ class TestXMLExtractorDataset < Minitest::Test
|
|
|
94
76
|
refute_empty x.workflow
|
|
95
77
|
end
|
|
96
78
|
|
|
79
|
+
def test_portal_url
|
|
80
|
+
# The 2014 Ebola virus disease outbreak in West Africa
|
|
81
|
+
id = 'b050f4b5-e272-4914-8cac-3bdc1e673c58'
|
|
82
|
+
x = xml_extractor_from_id id
|
|
83
|
+
|
|
84
|
+
assert_instance_of String, x.portal_url
|
|
85
|
+
end
|
|
86
|
+
|
|
97
87
|
def test_persons_other
|
|
98
88
|
# Plant diversity and root traits influence soil physical properties
|
|
99
89
|
id = '18cb8b7c-c3dd-43b8-ac65-bdf76910a6cc'
|
|
@@ -119,6 +109,30 @@ class TestXMLExtractorDataset < Minitest::Test
|
|
|
119
109
|
assert_instance_of Float, x.spatial_point.longitude
|
|
120
110
|
end
|
|
121
111
|
|
|
112
|
+
def test_files
|
|
113
|
+
# Influenza C in Lancaster, winter 2014-2015
|
|
114
|
+
id = 'a762a8a2-a9ed-4abb-ba91-a67752b1c54d'
|
|
115
|
+
x = xml_extractor_from_id id
|
|
116
|
+
|
|
117
|
+
assert_instance_of Array, x.files
|
|
118
|
+
assert_instance_of Puree::Model::File, x.files.first
|
|
119
|
+
assert x.files.first.data?
|
|
120
|
+
|
|
121
|
+
data = x.files.first
|
|
122
|
+
assert_instance_of Puree::Model::File, data
|
|
123
|
+
assert data.data?
|
|
124
|
+
assert_instance_of String, data.name
|
|
125
|
+
refute_empty data.name
|
|
126
|
+
# assert_instance_of String, data.mime
|
|
127
|
+
# refute_empty data.mime
|
|
128
|
+
# assert_instance_of Integer, data.size
|
|
129
|
+
assert_instance_of String, data.url
|
|
130
|
+
refute_empty data.url
|
|
131
|
+
assert_instance_of Puree::Model::CopyrightLicense, data.license
|
|
132
|
+
assert_instance_of String, data.license.name
|
|
133
|
+
refute_empty data.license.name
|
|
134
|
+
end
|
|
135
|
+
|
|
122
136
|
def test_absence
|
|
123
137
|
xml = '<foo/>'
|
|
124
138
|
x = Puree::XMLExtractor::Dataset.new xml
|
|
@@ -149,6 +163,8 @@ class TestXMLExtractorDataset < Minitest::Test
|
|
|
149
163
|
assert_instance_of Array, x.persons_other
|
|
150
164
|
assert_empty x.persons_other
|
|
151
165
|
|
|
166
|
+
# assert_nil x.portal_url
|
|
167
|
+
|
|
152
168
|
assert_nil x.production
|
|
153
169
|
|
|
154
170
|
assert_instance_of Array, x.research_outputs
|
|
@@ -27,9 +27,6 @@ class TestXMLExtractorProject < Minitest::Test
|
|
|
27
27
|
# pure_id = '236466684'
|
|
28
28
|
x = xml_extractor_from_id id
|
|
29
29
|
|
|
30
|
-
assert_instance_of String, x.acronym
|
|
31
|
-
refute_empty x.acronym
|
|
32
|
-
|
|
33
30
|
assert_instance_of Array, x.external_organisations
|
|
34
31
|
assert_instance_of Puree::Model::ExternalOrganisationHeader, x.external_organisations.first
|
|
35
32
|
assert x.external_organisations.first.data?
|
|
@@ -119,6 +116,15 @@ class TestXMLExtractorProject < Minitest::Test
|
|
|
119
116
|
assert_endeavour_person x.persons_external.first
|
|
120
117
|
end
|
|
121
118
|
|
|
119
|
+
def test_acronym
|
|
120
|
+
# Children, flood and urban resilience
|
|
121
|
+
id = '31834af4-2b68-49c4-9caf-6875d1ba78eb'
|
|
122
|
+
x = xml_extractor_from_id id
|
|
123
|
+
|
|
124
|
+
assert_instance_of String, x.acronym
|
|
125
|
+
refute_empty x.acronym
|
|
126
|
+
end
|
|
127
|
+
|
|
122
128
|
def test_absence
|
|
123
129
|
xml = '<foo/>'
|
|
124
130
|
x = Puree::XMLExtractor::Project.new xml
|
|
@@ -69,6 +69,8 @@ class TestXMLExtractorResearchOutput < Minitest::Test
|
|
|
69
69
|
assert_instance_of Array, x.persons_external
|
|
70
70
|
assert_endeavour_person x.persons_external.first
|
|
71
71
|
|
|
72
|
+
assert_instance_of String, x.portal_url
|
|
73
|
+
|
|
72
74
|
assert_instance_of Array, x.previous_uuids
|
|
73
75
|
refute_empty x.previous_uuids
|
|
74
76
|
assert_instance_of String, x.previous_uuids.first
|
|
@@ -246,6 +248,8 @@ class TestXMLExtractorResearchOutput < Minitest::Test
|
|
|
246
248
|
assert_instance_of Array, x.persons_other
|
|
247
249
|
assert_empty x.persons_other
|
|
248
250
|
|
|
251
|
+
assert_nil x.portal_url
|
|
252
|
+
|
|
249
253
|
assert_instance_of Array, x.previous_uuids
|
|
250
254
|
assert_empty x.previous_uuids
|
|
251
255
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: puree
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.10.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Adrian Albin-Clark
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2025-10-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: http
|
|
@@ -236,7 +236,7 @@ licenses:
|
|
|
236
236
|
- MIT
|
|
237
237
|
metadata:
|
|
238
238
|
source_code_uri: https://github.com/lulibrary/puree
|
|
239
|
-
documentation_uri: https://www.rubydoc.info/gems/puree/2.
|
|
239
|
+
documentation_uri: https://www.rubydoc.info/gems/puree/2.10.0
|
|
240
240
|
post_install_message:
|
|
241
241
|
rdoc_options: []
|
|
242
242
|
require_paths:
|
|
@@ -252,7 +252,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
252
252
|
- !ruby/object:Gem::Version
|
|
253
253
|
version: '0'
|
|
254
254
|
requirements: []
|
|
255
|
-
rubygems_version: 3.
|
|
255
|
+
rubygems_version: 3.5.16
|
|
256
256
|
signing_key:
|
|
257
257
|
specification_version: 4
|
|
258
258
|
summary: Metadata extraction from the Pure Research Information System.
|