research_metadata 2.0.0 → 2.1.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
- SHA1:
3
- metadata.gz: 7861dd7bacfce9d729ef20167e9864a8b15d6143
4
- data.tar.gz: 920b37ed1c76a2a20eed3299cd73767bc90b7511
2
+ SHA256:
3
+ metadata.gz: 145adb0ec690282f6795a927f2d939ece543d6a5e2e83a8d1bb1afaed4aa34a0
4
+ data.tar.gz: bfdec1fe38f7f46d2416873d29b33e8c1fa0d5ce21cbf46d37894ae8f6ffc0c9
5
5
  SHA512:
6
- metadata.gz: e8f6fcfd79df3cef1b04b6b311037aef402b4428628e55f42c1ace8c6891f113b7b5e361b76d79aa6822628193c366e8c30cf9aec6328dd15cfcfbc1e0edc71f
7
- data.tar.gz: 9d0fe4acd36a77025ef170efc8584508fba4fbf272f973e649a10742d719112d7ec59bd142f8f458f84d808aebbb41fe19e1c36e2e1b5efa30889baad714a127
6
+ metadata.gz: ee79ce8a5ac67eb20d80236ed59c40c4f9236751384021efffd7d4f00c5a0e34ae104eafd542ee6dfb00be29ff8c6044a657201cb03f3c40e930298865413899
7
+ data.tar.gz: de025edd7b3420ffeb50e463e710363180f0709ed4b64c86cd4906858cffc187dfddc95e896e5db0a01db5e62e19840221ff53d9a6b37c9e044eca0ca14f0240
@@ -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.1.0 2019-10-02
6
+ ### Added
7
+ - Transformer - raise error.
8
+
5
9
  ## 2.0.0 2017-12-20
6
10
  ### Added
7
11
  - Research output - translated title.
@@ -23,29 +23,33 @@ module ResearchMetadata
23
23
  # @param doi [String]
24
24
  # @return [String, nil]
25
25
  def transform(id:, doi:)
26
- @dataset = @dataset_extractor.find id
27
- return nil if !@dataset
28
- person_o = person
29
- file_o = file
30
- resource = ::Datacite::Mapping::Resource.new(
31
- identifier: identifier(doi),
32
- creators: person_o['creator'],
33
- titles: [ title ],
34
- publisher: publisher,
35
- publication_year: publication_year,
36
- subjects: subjects,
37
- contributors: person_o['contributor'],
38
- dates: dates,
39
- # language: language,
40
- resource_type: resource_type,
41
- related_identifiers: related_identifiers,
42
- # sizes: sizes(file_o),
43
- # formats: formats(file_o),
44
- rights_list: rights_list(file_o),
45
- descriptions: description,
46
- geo_locations: spatial
47
- )
48
- resource.write_xml
26
+ begin
27
+ @dataset = @dataset_extractor.find id
28
+ return nil if !@dataset
29
+ person_o = person
30
+ file_o = file
31
+ resource = ::Datacite::Mapping::Resource.new(
32
+ identifier: identifier(doi),
33
+ creators: person_o['creator'],
34
+ titles: [ title ],
35
+ publisher: publisher,
36
+ publication_year: publication_year,
37
+ subjects: subjects,
38
+ contributors: person_o['contributor'],
39
+ dates: dates,
40
+ # language: language,
41
+ resource_type: resource_type,
42
+ related_identifiers: related_identifiers,
43
+ # sizes: sizes(file_o),
44
+ # formats: formats(file_o),
45
+ rights_list: rights_list(file_o),
46
+ descriptions: description,
47
+ geo_locations: spatial
48
+ )
49
+ resource.write_xml
50
+ rescue => error
51
+ raise error
52
+ end
49
53
  end
50
54
 
51
55
  private
@@ -25,26 +25,30 @@ module ResearchMetadata
25
25
  # @param doi [String]
26
26
  # @return [String, nil]
27
27
  def transform(id:, doi:)
28
- @research_output = @research_output_extractor.find id
29
- return nil if !@research_output
30
- person_o = person
31
- file_o = file
32
- resource = ::Datacite::Mapping::Resource.new(
33
- identifier: identifier(doi),
34
- creators: person_o['creator'],
35
- titles: titles,
36
- publication_year: publication_year,
37
- publisher: publisher,
38
- subjects: subjects,
39
- contributors: person_o['contributor'],
40
- language: language,
41
- resource_type: resource_type,
42
- sizes: sizes(file_o),
43
- formats: formats(file_o),
44
- rights_list: rights_list(file_o),
45
- descriptions: description
46
- )
47
- resource.write_xml
28
+ begin
29
+ @research_output = @research_output_extractor.find id
30
+ return nil if !@research_output
31
+ person_o = person
32
+ file_o = file
33
+ resource = ::Datacite::Mapping::Resource.new(
34
+ identifier: identifier(doi),
35
+ creators: person_o['creator'],
36
+ titles: titles,
37
+ publication_year: publication_year,
38
+ publisher: publisher,
39
+ subjects: subjects,
40
+ contributors: person_o['contributor'],
41
+ language: language,
42
+ resource_type: resource_type,
43
+ sizes: sizes(file_o),
44
+ formats: formats(file_o),
45
+ rights_list: rights_list(file_o),
46
+ descriptions: description
47
+ )
48
+ resource.write_xml
49
+ rescue => error
50
+ raise error
51
+ end
48
52
  end
49
53
 
50
54
  private
@@ -1,5 +1,5 @@
1
1
  module ResearchMetadata
2
2
  # Semantic version number
3
3
  #
4
- VERSION = "2.0.0"
4
+ VERSION = "2.1.0"
5
5
  end
@@ -9,9 +9,11 @@ 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 and transformation of the metadata into the DataCite format.}
12
- spec.homepage = 'https://github.com/lulibrary/research_metadata'
12
+ spec.metadata = {
13
+ 'source_code_uri' => "https://github.com/lulibrary/#{spec.name}",
14
+ "documentation_uri" => "https://www.rubydoc.info/gems/#{spec.name}/#{spec.version}",
15
+ }
13
16
  spec.license = 'MIT'
14
-
15
17
  spec.files = `git ls-files -z`.split("\x0")
16
18
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
19
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
@@ -9,7 +9,7 @@ require 'research_metadata'
9
9
 
10
10
  def config
11
11
  {
12
- url: ENV['PURE_URL_TEST_59'],
12
+ url: ENV['PURE_URL'],
13
13
  username: ENV['PURE_USERNAME'],
14
14
  password: ENV['PURE_PASSWORD'],
15
15
  api_key: ENV['PURE_API_KEY']
@@ -1,4 +1,4 @@
1
- require 'test_helper'
1
+ require './test/test_helper'
2
2
 
3
3
  class TestTransformerThesis < Minitest::Test
4
4
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: research_metadata
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.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: 2017-12-20 00:00:00.000000000 Z
11
+ date: 2019-10-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: puree
@@ -74,10 +74,12 @@ files:
74
74
  - test/test_helper.rb
75
75
  - test/transformer/dataset_test.rb
76
76
  - test/transformer/thesis_test.rb
77
- homepage: https://github.com/lulibrary/research_metadata
77
+ homepage:
78
78
  licenses:
79
79
  - MIT
80
- metadata: {}
80
+ metadata:
81
+ source_code_uri: https://github.com/lulibrary/research_metadata
82
+ documentation_uri: https://www.rubydoc.info/gems/research_metadata/2.1.0
81
83
  post_install_message:
82
84
  rdoc_options: []
83
85
  require_paths:
@@ -93,8 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
95
  - !ruby/object:Gem::Version
94
96
  version: '0'
95
97
  requirements: []
96
- rubyforge_project:
97
- rubygems_version: 2.2.2
98
+ rubygems_version: 3.0.3
98
99
  signing_key:
99
100
  specification_version: 4
100
101
  summary: Metadata extraction from the Pure Research Information System and transformation