samvera / hydra-works

A ruby gem implementation of the PCDM Works domain model based on the Samvera software stack
Other
24 stars 14 forks source link

Fix #334 - Add a cleanup phase to CharacterizationService #335

Closed botimer closed 6 years ago

botimer commented 6 years ago

This is a little suboptimal because OM exposes all of the terms on the top level of the instance, so the method is named cleanup. The parsers also do not have a base class to ensure that a given cleanup method is available, so we use a respond_to? check. The last ugly bit is that calling file_mime_type = ... did not update the value, so the send("filetype=", ...) was the only way I could get this to pass.

There is a new test with FITS output from running against a sample netCDF file. There may be other types that report multiple mimetypes in this way, so the cleanup implementation is general (split on comma, pick the first). It's possible that using an array would be better, but there are other expectations in the service that enforce a single value.

mjgiarlo commented 6 years ago

Thanks for working on this, @botimer!

botimer commented 6 years ago

Thanks for the review, @mjgiarlo. I've updated the PR with a bit of commentary and a style change. Definitely better now. See what you think!

mjgiarlo commented 6 years ago

Thanks, @botimer!