Add EML object as an alternative option for metadata_path #85
Add EML object as an alternative option for metadata_path #85jagoldstein merged 16 commits intoNCEAS:masterfrom
Conversation
| @@ -367,6 +367,15 @@ publish_update <- function(mn, | |||
| # Get the metadata doc | |||
| message("Getting metadata from the MN.") | |||
| eml <- EML::read_eml(rawToChar(dataone::getObject(mn, metadata_pid)), asText = TRUE) | |||
There was a problem hiding this comment.
Need to close this if statement correct? or better use else if
Added `cache: packages` back in
@isteves helpfully noted that the Travis CI builds started failing a while ago in NCEAS#86. The failures indicate issues with Ubuntu PPAs and nothing to do with our tools. Though this happened around the time R 3.5.0 was released, which is a backwards incompatible R release indue to the introduction of ALTREP. This is: 1. My attempt to fix that so all the Travis builds pass 2. Reduce the deps arcticdatautils requires to install. ncdf4 and yaml are not packages that _need_ to be installed to get started using it so they should be in Suggests
| #' @param parent_child_pids (character) Optional. Resource map identifier(s) of child packages in the parent package. \code{resource_map_pid} should not be included. Not optional if the parent package contains other child packages. | ||
| #' @param child_pids (character) Optional. Child packages resource map PIDs. | ||
| #' @param metadata_path (character) Optional. Path to a metadata file to update with. If this is not set, the existing metadata document will be used. | ||
| #' @param metadata_path (character or eml) Optional. An eml class object or a path to a metadata file to update with. If this is not set, the existing metadata document will be used. |
There was a problem hiding this comment.
Can/should this arg name get changed now that it's not just a path?
There was a problem hiding this comment.
I didn't want to change the name so that it could remain backwards-compatible. But if our preference is to make it friendlier for new users, then a name change makes sense
There was a problem hiding this comment.
Yeah that's probably more important.
Reduce dependencies on ncdf4 and yaml Also fix travis build
Added `cache: packages` back in
…tautils into publish_update2
|
Updated with @amoeba's Travis changes so that Travis is 😺 |
|
|
||
| } else if(class(metadata_path) == "eml") { | ||
| # If an eml object is provided, use it directly after validating | ||
| if(!eml_validate(metadata_path)){ |
There was a problem hiding this comment.
@isteves Maybe move this out of the call here so that eml always gets validated wether or not is an R object or from disk. Also maybe add a message so users know that eml is being validated in case it takes a non-trivial amount of time.
Add EML object as an alternative option for metadata_path
Update to publish_update to also accept EML objects