puree 1.8.0 → 1.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4995f2080d8092029331df8ba6752cea555b1b48
4
- data.tar.gz: 24aec0bda1634d0bbced242f261634bf28675e5d
3
+ metadata.gz: 514ab272826cb82a877bcc22863cecb49743a0a6
4
+ data.tar.gz: 78d14d563e1e3d30e5c077f238b1dc144f7f5c10
5
5
  SHA512:
6
- metadata.gz: 07a2f1c6329cda2041e0afaa3f97993671dbb2fd995d20acb5dcb53073c11681f29771ba939281f76681dab12c7b11c2d31f317c67175eb65719b095e5853d75
7
- data.tar.gz: 9c3bc62895e8abf97120d11dee78e6d2130a965db3c29b68ed9330b44043dcb0ced0ddd381760833419084b1c6bdae45576c8d51edc0818d00dbbd831958e17c
6
+ metadata.gz: 6aa295ea3badb41bdab7bc42132fa927ffb23bbf7d0c088005c396b49a77b4e11167f54c69661d1deaf1437fd4bdb5a9b9365566440f3a0d557388859ebe8a6a
7
+ data.tar.gz: c5af1358e5c5c084da8b3b6d9e0d077196f57d0d88f83f8d5cd96266da854694ae3402b16b2ba1f446ff774f68ce587b85521cd84cca371322128b8a5f38426f
data/CHANGELOG.md CHANGED
@@ -5,6 +5,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).
5
5
  ## Unreleased
6
6
  - Metadata: activity?, clipping?, externalPerson?
7
7
 
8
+ ## 1.9.0 - 2018-03-09
9
+ ### Added
10
+ - Publication - doi.
11
+
8
12
  ## 1.8.0 - 2018-03-02
9
13
  ### Added
10
14
  - Publication - Scopus id.
@@ -21,6 +21,7 @@ module Puree
21
21
  @model.bibliographical_note = @extractor.bibliographical_note
22
22
  @model.category = @extractor.category
23
23
  @model.description = @extractor.description
24
+ @model.doi = @extractor.doi
24
25
  @model.dois = @extractor.dois
25
26
  @model.external_organisations = @extractor.external_organisations
26
27
  @model.files = @extractor.files
@@ -17,6 +17,9 @@ module Puree
17
17
  # @return [String, nil]
18
18
  attr_accessor :description
19
19
 
20
+ # @return [String]
21
+ attr_accessor :doi
22
+
20
23
  # @return [Array<String>]
21
24
  attr_accessor :dois
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 = "1.8.0"
4
+ VERSION = "1.9.0"
5
5
  end
@@ -29,6 +29,13 @@ module Puree
29
29
  xpath_query_for_single_value '/abstract/localizedString'
30
30
  end
31
31
 
32
+ # @return [String, nil]
33
+ def doi
34
+ multiple_dois = dois
35
+ multiple_dois.empty? ? nil : multiple_dois.first
36
+ end
37
+
38
+ # @deprecated Please use {#doi} instead
32
39
  # @return [Array<String>, nil]
33
40
  def dois
34
41
  xpath_query_for_multi_value '/electronicVersionAssociations/electronicVersionDOIAssociations/electronicVersionDOIAssociation/doi'
@@ -118,7 +125,6 @@ module Puree
118
125
 
119
126
  # @return [String, nil]
120
127
  def scopus_id
121
- # xpath_result = xpath_query_for_single_value '/external/secondarySource'
122
128
  xpath_result = xpath_query '/external/secondarySource'
123
129
  return if xpath_result.empty?
124
130
  source = xpath_result.xpath('@source')
@@ -33,6 +33,10 @@ describe 'Publication' do
33
33
  expect(@p.description).to be_a String if @p.description
34
34
  end
35
35
 
36
+ it '#doi' do
37
+ expect(@p.doi).to be_a String if @p.doi
38
+ end
39
+
36
40
  it '#dois' do
37
41
  expect(@p.dois).to all( be_a String )
38
42
  end
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: 1.8.0
4
+ version: 1.9.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-03-02 00:00:00.000000000 Z
11
+ date: 2018-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http