adiwg-mdtranslator 2.18.1 → 2.18.2

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
  SHA256:
3
- metadata.gz: 6ac1556593ab6171e10036125173a2bd97cdb8117bb498bf5f9b84a282c6e71e
4
- data.tar.gz: 12c0ed7ea97474e133a25236bff51acc24a556a0331254f704130fea6b85f03d
3
+ metadata.gz: fb462b0759a76f8884d8cefc07d1372da8a60c589a5cd49e57fce7d3f06f5c00
4
+ data.tar.gz: 99ab44ea39cede67c810cc998bcec11e447b8b438f552966ff77ea15e038c405
5
5
  SHA512:
6
- metadata.gz: 1c8524470eb708210a3080b5c078b2e159548d69e6a3abbd2a58e44d97a9d684bec354fa152954e56304ec44a2d98745827ccf54bd50e9565f3cb6d5c76a5ee0
7
- data.tar.gz: 2b9d00fea3e10cc7c0cadda0f1db04bb3e072eb38b0c3a6454640a239baa3a220b2af82017e7989e5f3c3cd544ea61b6485d1db369c9b0a7f4521ebee42c8f88
6
+ metadata.gz: 310393021fe20a36d392a870b3b4edead47f956033db8dc8f7b556bef750338758bf5cfe15d0c06f7c8097fe9a6d2dfaf65469abbc5045517f3823bd48973362
7
+ data.tar.gz: 2ad0835b09716d5fbda52c67bb4421b5bd6a29b02845c8d5ef3d18a6b89704408a42d7a2c6d7b442e1f7b92b70c7222ccf24f0db533261a813ffdb0128165f48
@@ -34,7 +34,7 @@ Gem::Specification.new do |spec|
34
34
  spec.add_runtime_dependency "thor", "~> 0.19"
35
35
  spec.add_runtime_dependency "uuidtools", "~> 2.1"
36
36
  spec.add_runtime_dependency "json-schema", "~> 2.7"
37
- spec.add_runtime_dependency "adiwg-mdjson_schemas", ">= 2.8"
37
+ spec.add_runtime_dependency "adiwg-mdjson_schemas", "~> 2.8"
38
38
  spec.add_runtime_dependency "adiwg-mdcodes", "~> 2.8"
39
39
  spec.add_runtime_dependency "jbuilder", "~> 2.5"
40
40
  spec.add_runtime_dependency "kramdown", "~> 1.13"
@@ -56,7 +56,7 @@ module ADIWG
56
56
  end
57
57
 
58
58
  # packing
59
- unless hProjection.empty?
59
+ unless hProjection.nil? || hProjection.empty?
60
60
  unless distanceUnits.nil?
61
61
  hProjection[:falseEastingNorthingUnits] = distanceUnits
62
62
  end
@@ -120,7 +120,7 @@ module ADIWG
120
120
  end
121
121
 
122
122
  # bounding box bio (altunit) - altitude unit of measure
123
- hBbox[:unitsOfAltitude] = xAltitude.xpath('./altunit').text
123
+ hBbox[:unitsOfAltitude] = xAltitude.xpath('./altunits').text
124
124
 
125
125
  end
126
126
 
@@ -47,6 +47,14 @@ module ADIWG
47
47
  end
48
48
  end
49
49
 
50
+ # there is a typo in mdEditor for liabilityStatement, handle this edge case
51
+ # https://github.com/adiwg/mdEditor/blob/f94770686df07ef76aa111f8f9734b32bbad7f21/app/pods/components/object/md-distribution/template.hbs#L22
52
+ if (intDistribution[:liabilityStatement].nil? || intDistribution.empty?) && hDistribution.has_key?('liablityStatement')
53
+ unless hDistribution['liablityStatement'] == ''
54
+ intDistribution[:liabilityStatement] = hDistribution['liablityStatement']
55
+ end
56
+ end
57
+
50
58
  # distribution - distributor [distributor]
51
59
  if hDistribution.has_key?('distributor')
52
60
  aItems = hDistribution['distributor']
@@ -109,7 +109,7 @@
109
109
  module ADIWG
110
110
  module Mdtranslator
111
111
  # current mdtranslator version
112
- VERSION = "2.18.1"
112
+ VERSION = "2.18.2"
113
113
  end
114
114
  end
115
115
 
@@ -37,6 +37,28 @@ module ADIWG
37
37
  # therefore, create a separate FGDC distribution record for each distributor
38
38
  # and repeat the distribution information
39
39
 
40
+ if hDistribution[:distributor].empty?
41
+ @xml.tag!('distinfo') do
42
+ # distribution 6.2 (resdesc) - resource description
43
+ # <- distribution.description
44
+ unless hDistribution[:description].nil?
45
+ @xml.tag!('resdesc', hDistribution[:description])
46
+ end
47
+ if hDistribution[:description].nil? && @hResponseObj[:writerShowTags]
48
+ @xml.tag!('resdesc')
49
+ end
50
+
51
+ # distribution 6.3 (distliab) - liability (required)
52
+ # <- distribution.liabilityStatement
53
+ unless hDistribution[:liabilityStatement].nil?
54
+ @xml.tag!('distliab', hDistribution[:liabilityStatement])
55
+ end
56
+ if hDistribution[:liabilityStatement].nil?
57
+ @NameSpace.issueWarning(111,'distliab')
58
+ end
59
+ end
60
+ end
61
+
40
62
  hDistribution[:distributor].each do |hDistributor|
41
63
 
42
64
  outContext = nil
@@ -68,7 +90,7 @@ module ADIWG
68
90
  unless hDistribution[:description].nil?
69
91
  @xml.tag!('resdesc', hDistribution[:description])
70
92
  end
71
- if hDistribution[:description].nil?
93
+ if hDistribution[:description].nil? && @hResponseObj[:writerShowTags]
72
94
  @xml.tag!('resdesc')
73
95
  end
74
96
 
@@ -140,7 +162,7 @@ module ADIWG
140
162
  unless techPre == ''
141
163
  @xml.tag!('techpreq', techPre)
142
164
  end
143
- if techPre == ''
165
+ if techPre == '' && @hResponseObj[:writerShowTags]
144
166
  @xml.tag!('techpreq')
145
167
  end
146
168
 
@@ -31,7 +31,7 @@ module ADIWG
31
31
  outContext = 'entity code ' + outContext unless outContext.nil?
32
32
 
33
33
  # entity detail 5.1.1 (enttype) - entity type
34
- @xml.tag!('enttype') do
34
+ @xml.tag!('enttyp') do
35
35
 
36
36
  # entity type 5.1.1.1 (enttypl) - entity type label (required)
37
37
  # <- entity.entityCode
@@ -57,6 +57,7 @@ module ADIWG
57
57
  hTimePeriod = hStep[:timePeriod]
58
58
  unless hTimePeriod.empty?
59
59
  hEndDT = hTimePeriod[:endDateTime]
60
+ hEndDT = hTimePeriod[:startDateTime] if hEndDT.nil? || hEndDT.empty?
60
61
  unless hEndDT.empty?
61
62
  procDate = AdiwgDateTimeFun.stringDateFromDateTime(hEndDT[:dateTime], hEndDT[:dateResolution])
62
63
  procTime = AdiwgDateTimeFun.stringTimeFromDateTime(hEndDT[:dateTime], hEndDT[:dateResolution])
@@ -135,10 +135,10 @@ module ADIWG
135
135
 
136
136
  # altitude bounding (altunit) - units of altitude
137
137
  unless hBBox[:unitsOfAltitude].nil?
138
- @xml.tag!('altunit', hBBox[:unitsOfAltitude])
138
+ @xml.tag!('altunits', hBBox[:unitsOfAltitude])
139
139
  end
140
140
  if hBBox[:unitsOfAltitude].nil? && @hResponseObj[:writerShowTags]
141
- @xml.tag!('altunit')
141
+ @xml.tag!('altunits')
142
142
  end
143
143
 
144
144
  end
@@ -66,6 +66,26 @@ module ADIWG
66
66
  @xml.tag!('cit:contactInfo')
67
67
  end
68
68
 
69
+ # organization - party identifier
70
+ if hContact[:externalIdentifier] && hContact[:externalIdentifier].length > 0
71
+ hContact[:externalIdentifier].each do |identifier|
72
+ @xml.tag!('cit:partyIdentifier') do
73
+ identifierClass.writeXML(identifier);
74
+ end
75
+ end
76
+ else
77
+ if hContact[:contactId] &&
78
+ hContact[:contactId].is_a?(Hash)
79
+ @xml.tag!('cit:partyIdentifier') do
80
+ identifierClass.writeXML(hContact[:contactId]);
81
+ end
82
+ elsif hContact[:contactId].is_a?(String)
83
+ @xml.tag!('cit:partyIdentifier') do
84
+ identifierClass.writeXML({ identifier: hContact[:contactId] })
85
+ end
86
+ end
87
+ end
88
+
69
89
  # organization - logo [] {MD_BrowseGraphic}
70
90
  aLogos = hContact[:logos]
71
91
  aLogos.each do |hLogo|
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adiwg-mdtranslator
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.18.1
4
+ version: 2.18.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stan Smith
8
8
  - Josh Bradley
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-02-08 00:00:00.000000000 Z
12
+ date: 2023-08-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -127,14 +127,14 @@ dependencies:
127
127
  name: adiwg-mdjson_schemas
128
128
  requirement: !ruby/object:Gem::Requirement
129
129
  requirements:
130
- - - ">="
130
+ - - "~>"
131
131
  - !ruby/object:Gem::Version
132
132
  version: '2.8'
133
133
  type: :runtime
134
134
  prerelease: false
135
135
  version_requirements: !ruby/object:Gem::Requirement
136
136
  requirements:
137
- - - ">="
137
+ - - "~>"
138
138
  - !ruby/object:Gem::Version
139
139
  version: '2.8'
140
140
  - !ruby/object:Gem::Dependency
@@ -987,7 +987,7 @@ homepage: http://www.adiwg.org/mdTranslator
987
987
  licenses:
988
988
  - UNLICENSED
989
989
  metadata: {}
990
- post_install_message:
990
+ post_install_message:
991
991
  rdoc_options: []
992
992
  require_paths:
993
993
  - lib
@@ -1002,8 +1002,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1002
1002
  - !ruby/object:Gem::Version
1003
1003
  version: '0'
1004
1004
  requirements: []
1005
- rubygems_version: 3.1.6
1006
- signing_key:
1005
+ rubygems_version: 3.4.12
1006
+ signing_key:
1007
1007
  specification_version: 4
1008
1008
  summary: The mdtranslator (metadata translator) is a tool for translating metadata
1009
1009
  in one format to another. The tool is written and maintained by the Alaska Data