-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add resultFile to coverageResult in mdJson reader
- Loading branch information
1 parent
a7c1eb2
commit 46edb39
Showing
2 changed files
with
76 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
lib/adiwg/mdtranslator/readers/mdJson/modules/module_resultFile.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
require_relative 'module_format' | ||
|
||
module ADIWG | ||
module Mdtranslator | ||
module Readers | ||
module MdJson | ||
|
||
module ResultFile | ||
|
||
def self.unpack(hContent, responseObj) | ||
require 'pp' | ||
pp hContent | ||
@MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson | ||
|
||
# return nil object if input is empty | ||
if hContent.empty? | ||
@MessagePath.issueWarning(130, responseObj) | ||
return nil | ||
end | ||
|
||
# instance classes needed in script | ||
intMetadataClass = InternalMetadata.new | ||
intContent = intMetadataClass.newCoverageDescription | ||
|
||
# content information - file name (required) | ||
if hContent.has_key?('fileName') | ||
unless hContent['fileName'] == '' | ||
intContent[:fileName] = hContent['fileName'] | ||
end | ||
end | ||
if intContent[:fileName].nil? | ||
@MessagePath.issueError(131, responseObj) | ||
end | ||
|
||
# content information - file description (required) | ||
if hContent.has_key?('fileDescription') | ||
unless hContent['fileDescription'] == '' | ||
intContent[:fileDescription] = hContent['fileDescription'] | ||
end | ||
end | ||
if intContent[:fileDescription].nil? | ||
@MessagePath.issueError(132, responseObj) | ||
end | ||
|
||
# content information - file type | ||
if hContent.has_key?('fileType') | ||
unless hContent['fileType'] == '' | ||
intContent[:fileType] = hContent['fileType'] | ||
end | ||
end | ||
if intContent[:fileType].nil? | ||
@MessagePath.issueError(131, responseObj) | ||
end | ||
|
||
if hContent.has_key?('fileFormat') | ||
hObject = hContent['fileFormat'] | ||
unless hObject.empty? | ||
hReturn = Format.unpack(hObject, responseObj) | ||
unless hReturn.nil? | ||
intContent[:fileFormat] = hReturn | ||
end | ||
end | ||
end | ||
|
||
return intContent | ||
|
||
end | ||
|
||
end | ||
|
||
end | ||
end | ||
end | ||
end |