ropensci / datapack

An R package to handle data packages
https://docs.ropensci.org/datapack
44 stars 9 forks source link

Rename relativeFilePath and remove references from bag exporting #124

Closed ThomasThelen closed 3 years ago

ThomasThelen commented 3 years ago

This PR renames relativeFilePath to targetPath. It also removes the functionality that uses this variable to place it in a specific directory in the bag.

To Test:

  1. Build the package
  2. Note that there aren't any errors
  3. Run the unit tests.
  4. Try using targetPath and exporting to a bag.
  5. Then try without targetPath
  6. Note that the bag isn't any different

Small template for 4-6; replace filename with a file on your local computer.

pkg <- new("DataPackage")

emlObj <- new("DataObject", format="eml://ecoinformatics.org/eml-2.1.1", filename="./eml.xml") 
pkg <- addMember(pkg, emlObj)

manifestObj <- new("DataObject", format="text/plain", filename="./manifest.json", targetPath="./moreData/manifest.json")
pkg <- addMember(pkg, manifestObj, mo = emlObj)

environmentObj <- new("DataObject", format="text/plain", filename="./environment.json", targetPath="./moreData/environment.json") 
pkg <- addMember(pkg, environmentObj, mo = emlObj)

serializeToBagIt(pkg)