research_metadata 1.0.0 → 1.1.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
  SHA1:
3
- metadata.gz: 2e692013c5a56d618d186d506beaa3e0583bd810
4
- data.tar.gz: 2be1115ce7b66209dcb00d1fd668293c4a8f7fa1
3
+ metadata.gz: b8d51c6b21c187226f55fd0727d29f66c8f07006
4
+ data.tar.gz: 5425e6b88a7166ab5fdfd11fba1d5f52c2719fe4
5
5
  SHA512:
6
- metadata.gz: c31990db2506a78d36f992c522df5df8740d3cda29e54e550ae6e6cb0702167c5d97d623f4fc49bc7e2850bf8778ca209a078d39c6f27d0f70a1d6ccc1233f9d
7
- data.tar.gz: f48ca4b7eb11ed554a6e14f4b7e7365c7205ff5e4016bc157d7c4f140896532a753637a6a9b3813a1157b0cef6c8650aae26d88b483c037dbc44d213718741aa
6
+ metadata.gz: 6c0ee2680982145695f98bcba3eb11fa781656da7bbc551e5a17739a4bc3cccf6e1f3cb4a5f56cc1e68a17ce215264b431e766cdb30de4e3f48bdaf5b48f4275
7
+ data.tar.gz: d4b3241ee58f9e08061d524a4f3fc11e032d493b07479bb02554ece7c1796d2a79dc954269e89ccda1715e9a9098880c3ce228388010e2f556deb8b0ee2efe58
data/CHANGELOG.md CHANGED
@@ -4,9 +4,13 @@ This project adheres to [Semantic Versioning](http://semver.org/).
4
4
 
5
5
  ## Unreleased
6
6
 
7
+ ## 1.1.0 2017-03-31
8
+ ### Added
9
+ - Transformer - thesis (Doctoral/Master's).
10
+
7
11
  ## 1.0.0 2017-03-15
8
12
  ### Added
9
- - Publications e.g. Doctoral/Master's Thesis.
13
+ - Transformer - publication.
10
14
 
11
15
  ### Changed
12
16
  - Configuration style to match Puree v1.0.0.
@@ -65,7 +65,7 @@ module ResearchMetadata
65
65
  rights = Datacite::Mapping::Rights.new value: i.license.name
66
66
  arr << rights
67
67
  else
68
- arr << 'Not specified'
68
+ arr << 'License unspecified'
69
69
  end
70
70
  end
71
71
  arr
@@ -3,8 +3,8 @@ module ResearchMetadata
3
3
  module Transformer
4
4
 
5
5
  # Extracts publication metadata from the Pure Research Information System
6
- # and converts it into the DataCite format. Example usage is for theses
7
- # (doctoral and master's).
6
+ # and converts it into the DataCite format.
7
+ # For text-based resources.
8
8
  #
9
9
  class Publication
10
10
 
@@ -49,18 +49,8 @@ module ResearchMetadata
49
49
 
50
50
  private
51
51
 
52
- def pages
53
- count = @publication.pages
54
- if count > 0
55
- return "#{count} pages"
56
- else
57
- return nil
58
- end
59
- end
60
-
61
52
  def sizes(files)
62
53
  arr = files.map { |i| "#{i.size} B" }
63
- arr << pages if pages
64
54
  arr
65
55
  end
66
56
 
@@ -183,7 +173,7 @@ module ResearchMetadata
183
173
  end
184
174
 
185
175
  def publisher
186
- @publication.publisher || 'Not specified'
176
+ @publication.publisher || 'Publisher unspecified'
187
177
  end
188
178
 
189
179
  def resource_type
@@ -0,0 +1,41 @@
1
+ module ResearchMetadata
2
+
3
+ module Transformer
4
+
5
+ # Extracts publication metadata from the Pure Research Information System
6
+ # and converts it into the DataCite format. Usage is for theses
7
+ # (doctoral and master's).
8
+ #
9
+ class Thesis < ResearchMetadata::Transformer::Publication
10
+
11
+ # @param config [Hash]
12
+ # @option config [String] :url The URL of the Pure host.
13
+ # @option config [String] :username The username of the Pure host account.
14
+ # @option config [String] :password The password of the Pure host account.
15
+ def initialize(config)
16
+ @config = config
17
+ @publication_extractor = Puree::Extractor::Thesis.new config
18
+ end
19
+
20
+ private
21
+
22
+ def pages
23
+ count = @publication.pages
24
+ if count > 0
25
+ return "#{count} pages"
26
+ else
27
+ return nil
28
+ end
29
+ end
30
+
31
+ def sizes(files)
32
+ arr = files.map { |i| "#{i.size} B" }
33
+ arr << pages if pages
34
+ arr
35
+ end
36
+
37
+ end
38
+
39
+ end
40
+
41
+ end
@@ -1,5 +1,5 @@
1
1
  module ResearchMetadata
2
2
  # Semantic version number
3
3
  #
4
- VERSION = "1.0.0"
4
+ VERSION = "1.1.0"
5
5
  end
@@ -2,6 +2,7 @@ require 'puree'
2
2
  require 'datacite/mapping'
3
3
  require 'research_metadata/transformer/dataset'
4
4
  require 'research_metadata/transformer/publication'
5
+ require 'research_metadata/transformer/thesis'
5
6
  require 'research_metadata/version'
6
7
 
7
8
  # Metadata extraction from the Pure Research Information System and
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
 
20
20
  spec.required_ruby_version = '~> 2.1'
21
21
 
22
- spec.add_runtime_dependency "puree", "~> 1.1.0"
22
+ spec.add_runtime_dependency "puree", "~> 1.2.0"
23
23
  spec.add_runtime_dependency "datacite-mapping", "~> 0.2.5"
24
24
 
25
25
  spec.add_development_dependency "rspec"
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: 1.0.0
4
+ version: 1.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-03-24 00:00:00.000000000 Z
11
+ date: 2017-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: puree
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.1.0
19
+ version: 1.2.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.1.0
26
+ version: 1.2.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: datacite-mapping
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -68,6 +68,7 @@ files:
68
68
  - lib/research_metadata.rb
69
69
  - lib/research_metadata/transformer/dataset.rb
70
70
  - lib/research_metadata/transformer/publication.rb
71
+ - lib/research_metadata/transformer/thesis.rb
71
72
  - lib/research_metadata/transformer/transformer.rb
72
73
  - lib/research_metadata/version.rb
73
74
  - research_metadata.gemspec