puree 2.6.0 → 2.7.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: 4c24eb641ac01ba9ed21562d4dce8df4046b08000f41940fc508a6db329ce7da
4
- data.tar.gz: d89a38743bf799cfe5ac1e40cdfbbf50194849d54e6a2dc7ddbf81121cf3fb4a
3
+ metadata.gz: d9e2d38e9e15a3b7da9abc9cc7350783a2bb4953b580ebbc4316532e10cff8a0
4
+ data.tar.gz: 68549513f64206b24c00fc0624584e27af33d98d95d33022c7af83c08cf7b5c8
5
5
  SHA512:
6
- metadata.gz: f0fc15bc9e77345916ff7bc1265dbf453a5a57c3dfe9045d47e5d8e56a45c6a94c42b9a5319c682f83db5cc52edd6c4a0c2dc7fcb8403b8b865e1b2cffd35991
7
- data.tar.gz: e782937aa2b31e9515e494f3d6dff3f0000fcd947670dfe38a0e5e65b566e966c1eb900ea08ed91b47e0ddf825c340e5539793610c012d6cec07a53c7422e175
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
@@ -38,7 +38,8 @@ Purée version | Pure API version
38
38
  :---: | :---:
39
39
  < 2.0 | < 59
40
40
  &gt;= 2.0, < 2.5 | 59, 510
41
- &gt;= 2.5 | 511, 512
41
+ &gt;= 2.5, < 2.7 | 511, 512
42
+ 2.7 | 513
42
43
 
43
44
  ## Extractor module
44
45
  ```ruby
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Puree
2
2
  # Semantic version number
3
3
  #
4
- VERSION = "2.6.0"
4
+ VERSION = "2.7.0"
5
5
  end
@@ -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}']/keywords/keyword"
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")
@@ -23,7 +23,7 @@ class TestResearchOutputTypes < Minitest::Test
23
23
  types.each do |type|
24
24
  params = {
25
25
  size: size,
26
- typeUri: [type[:uri]]
26
+ typeUris: [type[:uri]]
27
27
  }
28
28
  response = client.research_outputs.all_complex params: params
29
29
  # puts response
@@ -13,18 +13,17 @@ class TestResourceBase < Minitest::Test
13
13
  def test_post_request_collection
14
14
  params = {
15
15
  size: 3,
16
- employmentTypeUri: ['/dk/atira/pure/person/employmenttypes/academic'],
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
- employmentTypeUri: ['/dk/atira/pure/person/employmenttypes/academic'],
26
+ employmentTypeUris: ['/dk/atira/pure/person/employmenttypes/academic'],
28
27
  employmentStatus: 'ACTIVE'
29
28
  }
30
29
  extractor = Puree::Extractor::Person.new config
@@ -9,6 +9,8 @@ def asserts_resource(x)
9
9
 
10
10
  assert_instance_of String, x.modified_by
11
11
 
12
+ assert_instance_of String, x.id
13
+
12
14
  assert_instance_of String, x.uuid
13
15
  end
14
16
 
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.6.0
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-01-16 00:00:00.000000000 Z
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
- rubyforge_project:
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.