puree 2.3.0 → 2.4.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: dd7631adf7f39b6d041f3ae46b0b6648b6220a37d74313c86293df1a6b2b938f
4
- data.tar.gz: b19e093582fb9e14d2c0bad8898c6c63a9cc3afc501282566194e23b1d12e0a7
3
+ metadata.gz: 951d9defbfc0c08a02ce5a113e567fe2483bb0273fdaf6357b8b69b1af8f82d5
4
+ data.tar.gz: 644f09fe6de39e789ef0b186ece794a044bacc49aed60912d3c6ccf8cb6f958b
5
5
  SHA512:
6
- metadata.gz: '09784067f174ca5f1e310d35c6bbe7132148bc64b13623c12ed94920a5f8c934b7de19992ef117efbfbdea00803f3b19786675c7784ee1bb521d02a00ed9d50c'
7
- data.tar.gz: 9a2a672ae92da3c02ccba9dd92010b7d865d8792f2e2bb2218dd85ebe3b2cfda7215e4207fc530921b4035bb169e828550d690d9a8a1f2270f7aa78360e4ad14
6
+ metadata.gz: 0c5ae5ad398b0f593d0a89535bddf7ac9b42335457305d60657176b933d42d56ece5ed3d45b8366e46002bfdc9c225682506898a7b6ad24e6d75198256f7b973
7
+ data.tar.gz: ce2ad05d7fe37585fa768988b506be9de69c927e8156fb1c51d8e48197bb416c3e6c58b2b87fad242f0a7da8dd347c587d0d97af77273612a3e346f79d779915
data/CHANGELOG.md CHANGED
@@ -2,7 +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.3.0 2018-10-09
5
+ ## 2.4.0 2018-10-17
6
+ ### Added
7
+ - Research output - dois.
8
+
9
+ ### Fixed
10
+ - Research output - doi combining multiple dois.
11
+
12
+ ## 2.3.0 2018-10-09
6
13
  ### Added
7
14
  - POST for REST module.
8
15
  - Count and random in extractor extended with GET and POST parameters.
@@ -17,6 +17,9 @@ module Puree
17
17
  # @return [String, nil]
18
18
  attr_accessor :doi
19
19
 
20
+ # @return [Array<String>]
21
+ attr_accessor :dois
22
+
20
23
  # @return [Array<Puree::Model::ExternalOrganisationHeader>]
21
24
  attr_accessor :external_organisations
22
25
 
data/lib/puree/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Puree
2
2
  # Semantic version number
3
3
  #
4
- VERSION = "2.3.0"
4
+ VERSION = "2.4.0"
5
5
  end
@@ -31,10 +31,17 @@ module Puree
31
31
  xpath_query_for_single_value '/category'
32
32
  end
33
33
 
34
- # Digital Object Identifier
34
+ # Digital Object Identifier (first one, if many)
35
35
  # @return [String, nil]
36
36
  def doi
37
- xpath_query_for_single_value '/electronicVersions/electronicVersion[@type="wsElectronicVersionDoiAssociation"]/doi'
37
+ multiple_dois = dois
38
+ multiple_dois.empty? ? nil : multiple_dois.first
39
+ end
40
+
41
+ # Digital Object Identifiers
42
+ # @return [Array<String>]
43
+ def dois
44
+ xpath_query_for_multi_value '/electronicVersions/electronicVersion[@type="wsElectronicVersionDoiAssociation"]/doi'
38
45
  end
39
46
 
40
47
  # @return [Array<Puree::Model::File>]
@@ -170,6 +177,7 @@ module Puree
170
177
  @model.category = category
171
178
  @model.description = description
172
179
  @model.doi = doi
180
+ @model.dois = dois
173
181
  @model.files = files
174
182
  @model.keywords = keywords
175
183
  @model.language = language
data/puree.gemspec CHANGED
@@ -9,7 +9,9 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = 'Adrian Albin-Clark'
10
10
  spec.email = 'a.albin-clark@lancaster.ac.uk'
11
11
  spec.summary = %q{Metadata extraction from the Pure Research Information System.}
12
- spec.homepage = 'https://github.com/lulibrary/puree'
12
+ spec.metadata = {
13
+ 'source_code_uri' => 'https://github.com/lulibrary/puree'
14
+ }
13
15
  spec.license = 'MIT'
14
16
  spec.files = `git ls-files -z`.split("\x0")
15
17
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
@@ -88,6 +88,15 @@ class TestXMLExtractorResearchOutput < Minitest::Test
88
88
  refute_empty x.bibliographical_note
89
89
  end
90
90
 
91
+ def test_dois
92
+ # The spatial-temporal characteristics and health impacts of ambient fine particulate matter in China
93
+ id = 'a06ce5cd-a9e8-4e87-aa55-7a8616d1d69d'
94
+ x = xml_extractor_from_id id
95
+
96
+ assert_instance_of Array, x.dois
97
+ refute_empty x.dois
98
+ end
99
+
91
100
  def test_keywords
92
101
  # The effect of humic substances on barite precipitation-dissolution behaviour in natural and synthetic lake waters
93
102
  id = 'ce76dbda-8b22-422b-9bb6-8143820171b8'
@@ -170,6 +179,8 @@ class TestXMLExtractorResearchOutput < Minitest::Test
170
179
 
171
180
  assert_nil x.doi
172
181
 
182
+ assert_empty x.dois
183
+
173
184
  assert_instance_of Array, x.files
174
185
  assert_empty x.files
175
186
 
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.3.0
4
+ version: 2.4.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: 2018-10-12 00:00:00.000000000 Z
11
+ date: 2018-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http
@@ -222,10 +222,11 @@ files:
222
222
  - test/xml_extractor/xml_extractor_publisher_test.rb
223
223
  - test/xml_extractor/xml_extractor_research_output_test.rb
224
224
  - test/xml_extractor/xml_extractor_thesis_test.rb
225
- homepage: https://github.com/lulibrary/puree
225
+ homepage:
226
226
  licenses:
227
227
  - MIT
228
- metadata: {}
228
+ metadata:
229
+ source_code_uri: https://github.com/lulibrary/puree
229
230
  post_install_message:
230
231
  rdoc_options: []
231
232
  require_paths: