adiwg-mdtranslator 2.18.0rc2 → 2.18.0rc3

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: ecb7704090196204491ef42a0817dd4e9980188e3e63852d61cb7f0406b57f80
4
- data.tar.gz: 396c316ebdabbbe7acccf9deacbc45cd662799bb379e2a97389ecf546d04477d
3
+ metadata.gz: 4f08fafd68b7dea4229ec4fc18db6a148cc4e99785fb042b364636ec85c15f2e
4
+ data.tar.gz: 450d585d18e84c1867252046c065847c209d32a20d53612a7face363141f012a
5
5
  SHA512:
6
- metadata.gz: 69eb88558f05db637609abe2047853a6517ce0a5ee7e85e2ad9c7fd679d52cde0d3fd4af206a73bb2ebd9cafde309e97e10dc49f02bc0e0ab0a076cfa9fc6fcb
7
- data.tar.gz: 806fcca0134b19ea6da6619eb60c1480f73ef0f4323c847d51165fd5b377741b4ce48248f57a92276d4c6a7f6c24882ea554cc95efe6eaf0cb72f9c46af2ca7d
6
+ metadata.gz: 91322e2506f598e2f6cfa26a0b11eda18b33bae4de10ca67c651e63dc7947373a4f09a261a47e86e8980cb324019da0853a3f83cab043986c594905f8a80c22e
7
+ data.tar.gz: 5851f314179dcee20d6e295c9ab5770199a2c7e59e450c5b6a7df4ba232b00d396df8c1798b8bb9232826820f5b6c73786fc3b802ec180874896a8f0c15f7e60
@@ -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.0rc2"
112
+ VERSION = "2.18.0rc3"
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
@@ -27,7 +27,7 @@ module ADIWG
27
27
  haveIndirect = false
28
28
  hResourceInfo[:spatialReferenceSystems].each do |hSystem|
29
29
  unless hSystem[:systemIdentifier].empty?
30
- unless hSystem[:systemIdentifier][:description].empty?
30
+ unless hSystem[:systemIdentifier][:description].nil? || hSystem[:systemIdentifier][:description].empty?
31
31
  @xml.tag!('indspref', hSystem[:systemIdentifier][:description])
32
32
  haveIndirect = true
33
33
  break
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.0rc2
4
+ version: 2.18.0rc3
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: 2022-08-18 00:00:00.000000000 Z
12
+ date: 2022-10-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -969,7 +969,7 @@ homepage: http://www.adiwg.org/mdTranslator
969
969
  licenses:
970
970
  - UNLICENSED
971
971
  metadata: {}
972
- post_install_message:
972
+ post_install_message:
973
973
  rdoc_options: []
974
974
  require_paths:
975
975
  - lib
@@ -985,7 +985,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
985
985
  version: 1.3.1
986
986
  requirements: []
987
987
  rubygems_version: 3.1.6
988
- signing_key:
988
+ signing_key:
989
989
  specification_version: 4
990
990
  summary: The mdtranslator (metadata translator) is a tool for translating metadata
991
991
  in one format to another. The tool is written and maintained by the Alaska Data