adiwg-mdtranslator 2.19.0.pre.beta.21 → 2.19.0.pre.beta.22

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
  SHA256:
3
- metadata.gz: a7670335ec4fa03316f66382b6851ec6734b24ce68f059c19c6a23a1a7113ede
4
- data.tar.gz: f9c6427c9748ac49befb0fd8bb1b1473143464e9ba3c826a93ce1a69e9b733eb
3
+ metadata.gz: e744e49fe2c92d3e5fa2294fa194ce8ce6859d807f526bbf13cd99986111889a
4
+ data.tar.gz: 18b42409a786e7e6f4f9a94154bd241f0fdfdc9dc1a500cdbde7935c5e59784d
5
5
  SHA512:
6
- metadata.gz: 7c13faf921127c39c294b5ddaac3b4f44a2e97e2473f35305c3d65acf65825e855a007e9a65c86cad6ff6dc2c497cf01cd0dd2d4e380959b1b414c788b7e0621
7
- data.tar.gz: 704f1b0b85756e9c1c8b306e5fbca1a0ff4ada12edadf2a21c34477c0072a3012916290afdae9c2cc35bafbf10690fcbf295aad4a179af9ba48f413451071d1f
6
+ metadata.gz: d447dbf152ff9c02d8a3dc96eb1f67f11fd81da4b262a9eb23efb0cdd60acf17e2cc6f7cf33aafe21fd3d1cf0098c4e93b9215f085f310d57671befcc9e66a6a
7
+ data.tar.gz: 599b8a0c23ded139f5682b9d4b431f8dfba947faf6e71e688fa5a50acbb89286de64e79ea3023175e4defa37bce30233c7517d377766491a0bf62b2e5572ecb1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- adiwg-mdtranslator (2.19.0.pre.beta.21)
4
+ adiwg-mdtranslator (2.19.0.pre.beta.22)
5
5
  adiwg-mdcodes (= 2.9.4.pre.beta.4)
6
6
  adiwg-mdjson_schemas (= 2.9.3.pre.beta.3)
7
7
  builder (~> 3.2)
@@ -109,7 +109,7 @@
109
109
  module ADIWG
110
110
  module Mdtranslator
111
111
  # current mdtranslator version
112
- VERSION = "2.19.0-beta.21"
112
+ VERSION = "2.19.0-beta.22"
113
113
  end
114
114
  end
115
115
 
@@ -277,6 +277,33 @@ module ADIWG
277
277
 
278
278
  # data identification - resource constraints [] {MD_Constraints}
279
279
  aConstraint = hResource[:constraints]
280
+ legalConstraint = aConstraint.find { |hCon| hCon[:type] == 'legal' }
281
+ # handle distribution liability statements - add to legal constraint -> other constraints
282
+ aDistInfo = hMetadata[:distributorInfo]
283
+ liabilityStatements = []
284
+ aDistInfo.each do |hDistribution|
285
+ unless hDistribution.empty?
286
+ unless hDistribution[:liabilityStatement].nil?
287
+ liabilityStatements << hDistribution[:liabilityStatement]
288
+ end
289
+ end
290
+ end
291
+ if liabilityStatements.any?
292
+ # Create a new legal constraint if it doesn't exist
293
+ unless legalConstraint
294
+ legalConstraint = {
295
+ type: 'legal',
296
+ legalConstraint: {
297
+ otherCons: []
298
+ }
299
+ }
300
+ aConstraint << legalConstraint
301
+ end
302
+ liabilityStatements.each do |liabilityStatement|
303
+ legalConstraint[:legalConstraint][:otherCons] << liabilityStatement
304
+ end
305
+ end
306
+
280
307
  aConstraint.each do |hCon|
281
308
  @xml.tag!('mri:resourceConstraints') do
282
309
  constraintClass.writeXML(hCon, 'resource information')
@@ -286,6 +313,8 @@ module ADIWG
286
313
  @xml.tag!('mri:resourceConstraints')
287
314
  end
288
315
 
316
+ # data identification - resource constraints {} from distribution liability statement
317
+
289
318
  # data identification - associated resource [] {MD_AssociatedResource}
290
319
  aAssocRes.each do |hAssocRes|
291
320
  @xml.tag!('mri:associatedResource') do
@@ -24,7 +24,16 @@ module ADIWG
24
24
  # date - date (required)
25
25
  unless date.nil?
26
26
  case dateRes
27
- when 'Y', 'YM', 'YMD', 'YMDh', 'YMDhm', 'YMDhms'
27
+ when 'Y'
28
+ dateStr = AdiwgDateTimeFun.stringDateFromDateTime(date, 'Y')
29
+ @xml.tag!('gco:Date', dateStr)
30
+ when 'YM'
31
+ dateStr = AdiwgDateTimeFun.stringDateFromDateTime(date, 'YM')
32
+ @xml.tag!('gco:Date', dateStr)
33
+ when 'YMD'
34
+ dateStr = AdiwgDateTimeFun.stringDateFromDateTime(date, 'YMD')
35
+ @xml.tag!('gco:Date', dateStr)
36
+ when 'YMDh', 'YMDhm', 'YMDhms'
28
37
  dateStr = AdiwgDateTimeFun.stringDateTimeFromDateTime(date, 'YMDhms')
29
38
  @xml.tag!('gco:DateTime', dateStr)
30
39
  when 'YMDhZ', 'YMDhmZ', 'YMDhmsZ'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adiwg-mdtranslator
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.19.0.pre.beta.21
4
+ version: 2.19.0.pre.beta.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stan Smith
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-05-23 00:00:00.000000000 Z
12
+ date: 2024-05-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler