lib/adiwg/mdtranslator/readers/mdJson/modules/module_source.rb in adiwg-mdtranslator-2.9.2 vs lib/adiwg/mdtranslator/readers/mdJson/modules/module_source.rb in adiwg-mdtranslator-2.10.0

- old
+ new

@@ -1,14 +1,15 @@ # unpack source # Reader - ADIwg JSON to internal data structure # History: -# Stan Smith 2016-10-17 refactored for mdJson 2.0 -# Stan Smith 2015-07-14 refactored to remove global namespace constants -# Stan Smith 2015-06-22 replace global ($response) with passed in object (responseObj) -# Stan Smith 2014-12-15 refactored to handle namespacing readers and writers -# Stan Smith 2014-07-03 resolve require statements using Mdtranslator.reader_module +# Stan Smith 2018-02-19 refactored error and warning messaging +# Stan Smith 2016-10-17 refactored for mdJson 2.0 +# Stan Smith 2015-07-14 refactored to remove global namespace constants +# Stan Smith 2015-06-22 replace global ($response) with passed in object (responseObj) +# Stan Smith 2014-12-15 refactored to handle namespacing readers and writers +# Stan Smith 2014-07-03 resolve require statements using Mdtranslator.reader_module # Stan Smith 2013-11-26 original script require_relative 'module_citation' require_relative 'module_processStep' require_relative 'module_spatialReference' @@ -24,12 +25,11 @@ def self.unpack(hSource, responseObj) # return nil object if input is empty if hSource.empty? - responseObj[:readerExecutionMessages] << 'Source object is empty' - responseObj[:readerExecutionPass] = false + responseObj[:readerExecutionMessages] << 'WARNING: mdJson reader: source object is empty' return nil end # instance classes needed in script intMetadataClass = InternalMetadata.new @@ -45,10 +45,10 @@ # source - description (required) if hSource.has_key?('description') intSource[:description] = hSource['description'] end if intSource[:description].nil? || intSource[:description] == '' - responseObj[:readerExecutionMessages] << 'Source description is missing' + responseObj[:readerExecutionMessages] << 'ERROR: mdJson reader: source description is missing' responseObj[:readerExecutionPass] = false return nil end # source - source citation