puree 2.6.0 → 2.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +2 -1
- data/lib/puree/model/resource.rb +8 -0
- data/lib/puree/version.rb +1 -1
- data/lib/puree/xml_extractor/mixins/keyword_mixin.rb +1 -1
- data/lib/puree/xml_extractor/resource.rb +6 -0
- data/puree.gemspec +2 -1
- data/test/integration/research_output_types_test.rb +1 -1
- data/test/rest/base_test.rb +2 -3
- data/test/test_xml_extractor_helper.rb +2 -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: d9e2d38e9e15a3b7da9abc9cc7350783a2bb4953b580ebbc4316532e10cff8a0
|
4
|
+
data.tar.gz: 68549513f64206b24c00fc0624584e27af33d98d95d33022c7af83c08cf7b5c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 47858f41df3685614811f02d9336c2b0c19c8f88d3e14b797bec0a1154f3d1de73dd9ea7e42aeb31f2dfd20105b8bb9f9c120be5081b94ef61ff832449878b5f
|
7
|
+
data.tar.gz: 56dec4190827a75dc549af1cd7424146090efccbce1488a4996a585c0840e2d57c91196756f56227b598a1b4fa8b1cccee5fcf5c9388311f7643c4eb9d0ce685
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,14 @@
|
|
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.7.0 2019-06-06
|
6
|
+
### Changed
|
7
|
+
- For Pure API 513.
|
8
|
+
- Dataset, person, research output - keywords.
|
9
|
+
|
10
|
+
### Added
|
11
|
+
- Resource subclasses - id.
|
12
|
+
|
5
13
|
## 2.6.0 2019-01-14
|
6
14
|
### Added
|
7
15
|
- Resource subclasses - previous_uuids.
|
data/README.md
CHANGED
data/lib/puree/model/resource.rb
CHANGED
@@ -5,6 +5,9 @@ module Puree
|
|
5
5
|
#
|
6
6
|
class Resource
|
7
7
|
|
8
|
+
# @return [String, nil]
|
9
|
+
attr_reader :id
|
10
|
+
|
8
11
|
# @return [String, nil]
|
9
12
|
attr_reader :uuid
|
10
13
|
|
@@ -23,6 +26,11 @@ module Puree
|
|
23
26
|
# @return [Time, nil]
|
24
27
|
attr_reader :modified_at
|
25
28
|
|
29
|
+
# @param v [String]
|
30
|
+
def id=(v)
|
31
|
+
@id = v if v && !v.empty?
|
32
|
+
end
|
33
|
+
|
26
34
|
# @param v [String]
|
27
35
|
def uuid=(v)
|
28
36
|
@uuid = v if v && !v.empty?
|
data/lib/puree/version.rb
CHANGED
@@ -10,7 +10,7 @@ module Puree
|
|
10
10
|
|
11
11
|
# @return [Array<String>]
|
12
12
|
def keyword_group(logical_name)
|
13
|
-
xpath_result = xpath_query "/keywordGroups/keywordGroup[@logicalName='#{logical_name}']
|
13
|
+
xpath_result = xpath_query "/keywordGroups/keywordGroup[@logicalName='#{logical_name}']//freeKeyword"
|
14
14
|
data_arr = xpath_result.map { |i| i.text.strip }
|
15
15
|
data_arr.uniq
|
16
16
|
end
|
@@ -37,6 +37,11 @@ module Puree
|
|
37
37
|
Time.parse xpath_result if xpath_result
|
38
38
|
end
|
39
39
|
|
40
|
+
# @return [String, nil]
|
41
|
+
def id
|
42
|
+
xpath_query_for_single_value '/@pureId'
|
43
|
+
end
|
44
|
+
|
40
45
|
# @return [String, nil]
|
41
46
|
def uuid
|
42
47
|
xpath_query_for_single_value '/@uuid'
|
@@ -58,6 +63,7 @@ module Puree
|
|
58
63
|
# @return [Hash]
|
59
64
|
def combine_metadata
|
60
65
|
raise 'No model to populate' if !@model
|
66
|
+
@model.id = id
|
61
67
|
@model.uuid = uuid
|
62
68
|
@model.created_by = created_by
|
63
69
|
@model.created_at = created_at
|
data/puree.gemspec
CHANGED
@@ -10,7 +10,8 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = 'a.albin-clark@lancaster.ac.uk'
|
11
11
|
spec.summary = %q{Metadata extraction from the Pure Research Information System.}
|
12
12
|
spec.metadata = {
|
13
|
-
'source_code_uri' => 'https://github.com/lulibrary/puree'
|
13
|
+
'source_code_uri' => 'https://github.com/lulibrary/puree',
|
14
|
+
"documentation_uri" => "https://www.rubydoc.info/gems/puree/2.7.0",
|
14
15
|
}
|
15
16
|
spec.license = 'MIT'
|
16
17
|
spec.files = `git ls-files -z`.split("\x0")
|
data/test/rest/base_test.rb
CHANGED
@@ -13,18 +13,17 @@ class TestResourceBase < Minitest::Test
|
|
13
13
|
def test_post_request_collection
|
14
14
|
params = {
|
15
15
|
size: 3,
|
16
|
-
|
16
|
+
employmentTypeUris: ['/dk/atira/pure/person/employmenttypes/academic'],
|
17
17
|
employmentStatus: 'ACTIVE'
|
18
18
|
}
|
19
19
|
response = client.persons.all_complex params: params
|
20
|
-
# puts response
|
21
20
|
assert_equal response.code, 200
|
22
21
|
assert_instance_of HTTP::Response, response
|
23
22
|
end
|
24
23
|
|
25
24
|
def test_collection_count
|
26
25
|
params = {
|
27
|
-
|
26
|
+
employmentTypeUris: ['/dk/atira/pure/person/employmenttypes/academic'],
|
28
27
|
employmentStatus: 'ACTIVE'
|
29
28
|
}
|
30
29
|
extractor = Puree::Extractor::Person.new config
|
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.7.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: 2019-
|
11
|
+
date: 2019-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http
|
@@ -236,6 +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.7.0
|
239
240
|
post_install_message:
|
240
241
|
rdoc_options: []
|
241
242
|
require_paths:
|
@@ -251,8 +252,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
251
252
|
- !ruby/object:Gem::Version
|
252
253
|
version: '0'
|
253
254
|
requirements: []
|
254
|
-
|
255
|
-
rubygems_version: 2.7.3
|
255
|
+
rubygems_version: 3.0.3
|
256
256
|
signing_key:
|
257
257
|
specification_version: 4
|
258
258
|
summary: Metadata extraction from the Pure Research Information System.
|