adiwg-mdtranslator 1.3.0 → 1.4.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. data/.jsbeautifyrc +8 -0
  3. data/Rakefile +1 -3
  4. data/adiwg-mdtranslator.gemspec +2 -0
  5. data/bin/mdtranslator +2 -2
  6. data/lib/adiwg/mdtranslator.rb +2 -0
  7. data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +6 -3
  8. data/lib/adiwg/mdtranslator/internal/module_geoFormat.rb +183 -190
  9. data/lib/adiwg/mdtranslator/internal/module_lineString.rb +18 -0
  10. data/lib/adiwg/mdtranslator/internal/module_point.rb +18 -0
  11. data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_contacts.rb +3 -1
  12. data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_geographicElement.rb +18 -10
  13. data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_additionalDocumentation.rb +52 -0
  14. data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_boundingBox.rb +54 -0
  15. data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_browseGraphic.rb +66 -0
  16. data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_citation.rb +125 -0
  17. data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_contacts.rb +144 -0
  18. data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_dateTime.rb +31 -0
  19. data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_distributionInfo.rb +64 -0
  20. data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_extent.rb +61 -0
  21. data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_geoCoordSystem.rb +50 -0
  22. data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_geoProperties.rb +91 -0
  23. data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_geographicElement.rb +161 -0
  24. data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_metadata.rb +70 -0
  25. data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_metadataInfo.rb +131 -0
  26. data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_onlineResource.rb +71 -0
  27. data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_resourceIdentifier.rb +73 -0
  28. data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_resourceInfo.rb +437 -0
  29. data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_responsibleParty.rb +53 -0
  30. data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_sbJson.rb +52 -0
  31. data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/version.rb +12 -0
  32. data/lib/adiwg/mdtranslator/readers/sbJson/readme.md +12 -0
  33. data/lib/adiwg/mdtranslator/readers/sbJson/sbJson_reader.rb +205 -0
  34. data/lib/adiwg/mdtranslator/readers/sbJson/sbJson_validator.rb +44 -0
  35. data/lib/adiwg/mdtranslator/version.rb +1 -2
  36. data/lib/adiwg/mdtranslator/writers/html/sections/html_browseGraphic.rb +2 -1
  37. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_multiGeometry.rb +5 -5
  38. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_responsibleParty.rb +1 -1
  39. data/lib/adiwg/mdtranslator/writers/mdJson/mdJson_writer.rb +42 -0
  40. data/lib/adiwg/mdtranslator/writers/mdJson/readme.md +19 -0
  41. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_additionalDoc.rb +19 -0
  42. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_address.rb +22 -0
  43. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_associatedResource.rb +22 -0
  44. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_attribute.rb +27 -0
  45. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_base.rb +19 -0
  46. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_citation.rb +33 -0
  47. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_constraint.rb +28 -0
  48. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_contact.rb +31 -0
  49. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_coverageInfo.rb +30 -0
  50. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_coverageItem.rb +44 -0
  51. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dataQuality.rb +32 -0
  52. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dateTime.rb +18 -0
  53. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb +33 -0
  54. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_distributionInfo.rb +31 -0
  55. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_domain.rb +25 -0
  56. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entity.rb +37 -0
  57. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_extent.rb +26 -0
  58. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_format.rb +19 -0
  59. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_geographicElement.rb +81 -0
  60. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_graphicOverview.rb +20 -0
  61. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_gridInfo.rb +27 -0
  62. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_imageInfo.rb +28 -0
  63. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_keyword.rb +20 -0
  64. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_locale.rb +19 -0
  65. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_metadata.rb +30 -0
  66. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_metadataInfo.rb +36 -0
  67. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_onlineResource.rb +21 -0
  68. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_phone.rb +19 -0
  69. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_processStep.rb +25 -0
  70. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_resourceIdentifier.rb +23 -0
  71. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_resourceInfo.rb +69 -0
  72. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_resourceMaintenance.rb +23 -0
  73. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_responsibleParty.rb +18 -0
  74. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_spatialreference.rb +19 -0
  75. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_taxon.rb +19 -0
  76. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_taxonomy.rb +32 -0
  77. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_temporalElement.rb +38 -0
  78. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_timePeriod.rb +20 -0
  79. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_transferOption.rb +33 -0
  80. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_usage.rb +23 -0
  81. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_verticalElement.rb +20 -0
  82. data/lib/adiwg/mdtranslator/writers/mdJson/version.rb +13 -0
  83. data/lib/adiwg/mdtranslator/writers/sbJson/readme.md +12 -0
  84. data/lib/adiwg/mdtranslator/writers/sbJson/sbJson_writer.rb +126 -0
  85. data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_base.rb +19 -0
  86. data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_contact.rb +42 -0
  87. data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_identifier.rb +22 -0
  88. data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_spatial.rb +49 -0
  89. data/lib/adiwg/mdtranslator/writers/sbJson/version.rb +13 -0
  90. data/test/readers/mdJson/v1/tc_reader_mdjson_translation.rb +83 -0
  91. data/test/readers/sbJson/v0/tc_reader_sbjson_translation.rb +79 -0
  92. data/test/readers/sbJson/v0/test.json +431 -0
  93. data/test/readers/sbJson/v0/test1.json +383 -0
  94. data/test/writers/mdJson/v1/tc_writer_mdJson.rb +60 -0
  95. data/test/writers/sbJson/v0/tc_writer_sbJson.rb +60 -0
  96. metadata +121 -7
  97. data/test/readers/mdJson/v1/tc_translation_19115_2.rb +0 -67
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: 1.3.0
4
+ version: 1.4.0.beta1
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: 2015-09-28 00:00:00.000000000 Z
12
+ date: 2016-06-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -157,6 +157,34 @@ dependencies:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
159
  version: '1.0'
160
+ - !ruby/object:Gem::Dependency
161
+ name: jbuilder
162
+ requirement: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: '2.5'
167
+ type: :runtime
168
+ prerelease: false
169
+ version_requirements: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: '2.5'
174
+ - !ruby/object:Gem::Dependency
175
+ name: rgeo
176
+ requirement: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: '0.5'
181
+ type: :runtime
182
+ prerelease: false
183
+ version_requirements: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - "~>"
186
+ - !ruby/object:Gem::Version
187
+ version: '0.5'
160
188
  description: The mdtranslator was written by the Alaska Data Integration Working Group
161
189
  (ADIwg) to assist with creating ISO 19139 metadata records. Input to the mdtranslator
162
190
  is JSON conforming to the mdJson-schema. The mdtranslator architecture allows developers
@@ -172,6 +200,7 @@ extra_rdoc_files: []
172
200
  files:
173
201
  - ".gitignore"
174
202
  - ".gitmodules"
203
+ - ".jsbeautifyrc"
175
204
  - ".travis.yml"
176
205
  - Gemfile
177
206
  - LICENSE.txt
@@ -185,6 +214,8 @@ files:
185
214
  - lib/adiwg/mdtranslator/internal/module_coordinates.rb
186
215
  - lib/adiwg/mdtranslator/internal/module_dateTimeFun.rb
187
216
  - lib/adiwg/mdtranslator/internal/module_geoFormat.rb
217
+ - lib/adiwg/mdtranslator/internal/module_lineString.rb
218
+ - lib/adiwg/mdtranslator/internal/module_point.rb
188
219
  - lib/adiwg/mdtranslator/readers/mdJson/mdJson_reader.rb
189
220
  - lib/adiwg/mdtranslator/readers/mdJson/mdJson_validator.rb
190
221
  - lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_additionalDocumentation.rb
@@ -255,6 +286,28 @@ files:
255
286
  - lib/adiwg/mdtranslator/readers/mdJson/readme.md
256
287
  - lib/adiwg/mdtranslator/readers/mdJson/validator.rb
257
288
  - lib/adiwg/mdtranslator/readers/mdReaders.rb
289
+ - lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_additionalDocumentation.rb
290
+ - lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_boundingBox.rb
291
+ - lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_browseGraphic.rb
292
+ - lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_citation.rb
293
+ - lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_contacts.rb
294
+ - lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_dateTime.rb
295
+ - lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_distributionInfo.rb
296
+ - lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_extent.rb
297
+ - lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_geoCoordSystem.rb
298
+ - lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_geoProperties.rb
299
+ - lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_geographicElement.rb
300
+ - lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_metadata.rb
301
+ - lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_metadataInfo.rb
302
+ - lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_onlineResource.rb
303
+ - lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_resourceIdentifier.rb
304
+ - lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_resourceInfo.rb
305
+ - lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_responsibleParty.rb
306
+ - lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_sbJson.rb
307
+ - lib/adiwg/mdtranslator/readers/sbJson/modules_v0/version.rb
308
+ - lib/adiwg/mdtranslator/readers/sbJson/readme.md
309
+ - lib/adiwg/mdtranslator/readers/sbJson/sbJson_reader.rb
310
+ - lib/adiwg/mdtranslator/readers/sbJson/sbJson_validator.rb
258
311
  - lib/adiwg/mdtranslator/version.rb
259
312
  - lib/adiwg/mdtranslator/writers/html/html_writer.rb
260
313
  - lib/adiwg/mdtranslator/writers/html/md_html_writer.rb
@@ -402,7 +455,58 @@ files:
402
455
  - lib/adiwg/mdtranslator/writers/iso19115_2/iso19115_2_writer.rb
403
456
  - lib/adiwg/mdtranslator/writers/iso19115_2/readme.md
404
457
  - lib/adiwg/mdtranslator/writers/iso19115_2/version.rb
458
+ - lib/adiwg/mdtranslator/writers/mdJson/mdJson_writer.rb
459
+ - lib/adiwg/mdtranslator/writers/mdJson/readme.md
460
+ - lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_additionalDoc.rb
461
+ - lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_address.rb
462
+ - lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_associatedResource.rb
463
+ - lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_attribute.rb
464
+ - lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_base.rb
465
+ - lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_citation.rb
466
+ - lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_constraint.rb
467
+ - lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_contact.rb
468
+ - lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_coverageInfo.rb
469
+ - lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_coverageItem.rb
470
+ - lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dataQuality.rb
471
+ - lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dateTime.rb
472
+ - lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb
473
+ - lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_distributionInfo.rb
474
+ - lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_domain.rb
475
+ - lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entity.rb
476
+ - lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_extent.rb
477
+ - lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_format.rb
478
+ - lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_geographicElement.rb
479
+ - lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_graphicOverview.rb
480
+ - lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_gridInfo.rb
481
+ - lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_imageInfo.rb
482
+ - lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_keyword.rb
483
+ - lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_locale.rb
484
+ - lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_metadata.rb
485
+ - lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_metadataInfo.rb
486
+ - lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_onlineResource.rb
487
+ - lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_phone.rb
488
+ - lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_processStep.rb
489
+ - lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_resourceIdentifier.rb
490
+ - lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_resourceInfo.rb
491
+ - lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_resourceMaintenance.rb
492
+ - lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_responsibleParty.rb
493
+ - lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_spatialreference.rb
494
+ - lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_taxon.rb
495
+ - lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_taxonomy.rb
496
+ - lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_temporalElement.rb
497
+ - lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_timePeriod.rb
498
+ - lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_transferOption.rb
499
+ - lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_usage.rb
500
+ - lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_verticalElement.rb
501
+ - lib/adiwg/mdtranslator/writers/mdJson/version.rb
405
502
  - lib/adiwg/mdtranslator/writers/mdWriters.rb
503
+ - lib/adiwg/mdtranslator/writers/sbJson/readme.md
504
+ - lib/adiwg/mdtranslator/writers/sbJson/sbJson_writer.rb
505
+ - lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_base.rb
506
+ - lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_contact.rb
507
+ - lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_identifier.rb
508
+ - lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_spatial.rb
509
+ - lib/adiwg/mdtranslator/writers/sbJson/version.rb
406
510
  - test/readers/mdJson/v1/tc_reader_mdjson_additionalDocumentation.rb
407
511
  - test/readers/mdJson/v1/tc_reader_mdjson_address.rb
408
512
  - test/readers/mdJson/v1/tc_reader_mdjson_associatedResource.rb
@@ -430,9 +534,14 @@ files:
430
534
  - test/readers/mdJson/v1/tc_reader_mdjson_processStep.rb
431
535
  - test/readers/mdJson/v1/tc_reader_mdjson_resolution.rb
432
536
  - test/readers/mdJson/v1/tc_reader_mdjson_source.rb
537
+ - test/readers/mdJson/v1/tc_reader_mdjson_translation.rb
433
538
  - test/readers/mdJson/v1/tc_translation_19110.rb
434
- - test/readers/mdJson/v1/tc_translation_19115_2.rb
539
+ - test/readers/sbJson/v0/tc_reader_sbjson_translation.rb
540
+ - test/readers/sbJson/v0/test.json
541
+ - test/readers/sbJson/v0/test1.json
435
542
  - test/writers/iso19115_2/tc_writer_iso19115_2_address.rb
543
+ - test/writers/mdJson/v1/tc_writer_mdJson.rb
544
+ - test/writers/sbJson/v0/tc_writer_sbJson.rb
436
545
  homepage: http://www.adiwg.org/mdTranslator
437
546
  licenses:
438
547
  - UNLICENSED
@@ -448,12 +557,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
448
557
  version: '2.1'
449
558
  required_rubygems_version: !ruby/object:Gem::Requirement
450
559
  requirements:
451
- - - ">="
560
+ - - ">"
452
561
  - !ruby/object:Gem::Version
453
- version: '0'
562
+ version: 1.3.1
454
563
  requirements: []
455
564
  rubyforge_project:
456
- rubygems_version: 2.4.5
565
+ rubygems_version: 2.6.4
457
566
  signing_key:
458
567
  specification_version: 4
459
568
  summary: The mdtranslator (metadata translator) is a tool for translating metadata
@@ -487,6 +596,11 @@ test_files:
487
596
  - test/readers/mdJson/v1/tc_reader_mdjson_processStep.rb
488
597
  - test/readers/mdJson/v1/tc_reader_mdjson_resolution.rb
489
598
  - test/readers/mdJson/v1/tc_reader_mdjson_source.rb
599
+ - test/readers/mdJson/v1/tc_reader_mdjson_translation.rb
490
600
  - test/readers/mdJson/v1/tc_translation_19110.rb
491
- - test/readers/mdJson/v1/tc_translation_19115_2.rb
601
+ - test/readers/sbJson/v0/tc_reader_sbjson_translation.rb
602
+ - test/readers/sbJson/v0/test.json
603
+ - test/readers/sbJson/v0/test1.json
492
604
  - test/writers/iso19115_2/tc_writer_iso19115_2_address.rb
605
+ - test/writers/mdJson/v1/tc_writer_mdJson.rb
606
+ - test/writers/sbJson/v0/tc_writer_sbJson.rb
@@ -1,67 +0,0 @@
1
- # MdTranslator - code to test mdtranslator from Ruby Terminal during development
2
-
3
- # History:
4
- # Stan Smith 2014-07-02 original script
5
- # Josh Bradley 2014-09-28 updated to use test/unit
6
- # Stan Smith 2015-01-16 changed ADIWG::Mdtranslator.translate() to keyword parameters
7
- # Stan Smith 2015-06-22 refactored setup to after removal of globals
8
-
9
- require 'minitest/autorun'
10
- require 'json'
11
- require 'adiwg-mdtranslator'
12
-
13
- class TestTranslation_v1 < MiniTest::Test
14
-
15
- @@reader = 'mdJson'
16
- @@writer = 'iso19115_2'
17
-
18
- def test_full_success
19
-
20
- # get json file for tests from examples folder
21
- file = File.join(File.dirname(__FILE__), '../../../', 'schemas/v1_0/examples', 'full_example.json')
22
- file = File.open(file, 'r')
23
- jsonObj = file.read
24
- file.close
25
-
26
- # call opening module in mdTranslator
27
- metadata = ADIWG::Mdtranslator.translate(
28
- file: jsonObj, reader: @@reader, validate: 'normal',
29
- writer: @@writer, showAllTags: 'true')
30
- version = JSON.parse(jsonObj)['version']['version'].split('.')
31
-
32
- assert_equal('json', metadata[:readerFormat], 'Check reader name')
33
- assert metadata[:readerStructurePass], metadata[:readerStructureMessages].join(',')
34
- assert_equal(@@reader, metadata[:readerRequested])
35
-
36
- # major version
37
- assert_equal(version[0], metadata[:readerVersionUsed].split('.')[0])
38
-
39
- assert metadata[:readerValidationPass], "reader validation failed: \n" + metadata[:readerValidationMessages].join(',')
40
- assert_equal(@@writer, metadata[:writerName])
41
- assert metadata[:writerPass], "writer validation failed: \n" + metadata[:writerMessages].join(',')
42
- refute_nil metadata[:writerOutput]
43
- end
44
-
45
- def test_minimum_success
46
-
47
- # get json file for tests from examples folder
48
- file = File.join(File.dirname(__FILE__), '../../../', 'schemas/v1_0/examples', 'minimum_example.json')
49
- file = File.open(file, 'r')
50
- jsonObj = file.read
51
- file.close
52
-
53
- # call opening module in mdTranslator
54
- metadata = ADIWG::Mdtranslator.translate(
55
- file: jsonObj, reader: @@reader, validate: 'normal',
56
- writer: @@writer, showAllTags: 'true')
57
-
58
- assert_equal('json', metadata[:readerFormat], 'Check reader name')
59
- assert metadata[:readerStructurePass], metadata[:readerStructureMessages].join(',')
60
- assert_equal(@@reader, metadata[:readerRequested])
61
- assert metadata[:readerValidationPass], "reader validation failed: \n" + metadata[:readerValidationMessages].join(',')
62
- assert_equal(@@writer, metadata[:writerName])
63
- assert metadata[:writerPass], "writer validation failed: \n" + metadata[:writerMessages].join(',')
64
- refute_nil metadata[:writerOutput]
65
- end
66
-
67
- end