datacite 0.7.0 → 0.8.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.
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'active_support'
4
+ require 'active_support/core_ext/module/delegation'
5
+
6
+ module Datacite
7
+ module Validators
8
+ # Validate a Cocina object using the attributes validator
9
+ class CocinaValidator
10
+ attr_reader :attributes
11
+
12
+ delegate :valid?, :errors, to: :validator
13
+
14
+ # @param [Cocina::Models::DRO] cocina_object a Cocina object with descriptive metadata
15
+ def initialize(cocina_object:)
16
+ @attributes = Datacite::Mapping::FromCocina::Attributes.build(cocina_object:)
17
+ end
18
+
19
+ private
20
+
21
+ def validator
22
+ @validator ||= AttributesValidator.new(attributes:)
23
+ end
24
+ end
25
+ end
26
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Datacite
4
- VERSION = '0.7.0'
4
+ VERSION = '0.8.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,28 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: datacite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-10-22 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: activesupport
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: '0'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - ">="
24
+ - !ruby/object:Gem::Version
25
+ version: '0'
12
26
  - !ruby/object:Gem::Dependency
13
27
  name: dry-monads
14
28
  requirement: !ruby/object:Gem::Requirement
@@ -37,6 +51,20 @@ dependencies:
37
51
  - - "~>"
38
52
  - !ruby/object:Gem::Version
39
53
  version: '2.0'
54
+ - !ruby/object:Gem::Dependency
55
+ name: json_schemer
56
+ requirement: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ type: :runtime
62
+ prerelease: false
63
+ version_requirements: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
40
68
  - !ruby/object:Gem::Dependency
41
69
  name: zeitwerk
42
70
  requirement: !ruby/object:Gem::Requirement
@@ -74,8 +102,22 @@ files:
74
102
  - lib/datacite.rb
75
103
  - lib/datacite/autogenerate_doi_request_body.rb
76
104
  - lib/datacite/client.rb
105
+ - lib/datacite/mapping/from_cocina/alternate_identifiers.rb
106
+ - lib/datacite/mapping/from_cocina/attributes.rb
107
+ - lib/datacite/mapping/from_cocina/contributor_attributes.rb
108
+ - lib/datacite/mapping/from_cocina/date.rb
109
+ - lib/datacite/mapping/from_cocina/descriptions.rb
110
+ - lib/datacite/mapping/from_cocina/identifiers.rb
111
+ - lib/datacite/mapping/from_cocina/related_resource.rb
112
+ - lib/datacite/mapping/from_cocina/rights_list.rb
113
+ - lib/datacite/mapping/from_cocina/subject.rb
114
+ - lib/datacite/mapping/from_cocina/titles.rb
115
+ - lib/datacite/mapping/from_cocina/types.rb
77
116
  - lib/datacite/register_doi_request_body.rb
78
117
  - lib/datacite/response.rb
118
+ - lib/datacite/schema/datacite-v4.6.json
119
+ - lib/datacite/validators/attributes_validator.rb
120
+ - lib/datacite/validators/cocina_validator.rb
79
121
  - lib/datacite/version.rb
80
122
  homepage: https://github.com/sul-dlss/datacite-ruby
81
123
  licenses: []
@@ -98,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
98
140
  - !ruby/object:Gem::Version
99
141
  version: '0'
100
142
  requirements: []
101
- rubygems_version: 3.6.2
143
+ rubygems_version: 3.7.2
102
144
  specification_version: 4
103
145
  summary: A Ruby client library for the DataCite REST API
104
146
  test_files: []