scientist-softserv / derivative_rodeo

An ETL Ecosystem for Derivative Processing.
Other
0 stars 0 forks source link

Write the template function handling for URIs #1

Closed jeremyf closed 1 year ago

jeremyf commented 1 year ago

Given the following initialization:

DerivativeRodeo::Generators::BaseGenerator.new(
  input_uris: ["file:///path1/A/file.pdf", "file:///path2/B/file.pdf"],
  output_uri_template: "file:///dest1/{{path_parts[-2..-1]}}",
  preprocess_uri_template: "s3://bucket_name/{{path_parts[-2..-1]}}"
)

We want the templates to evaluate to the following:

{
  output_uris: ["file:///dest1/A/file.pdf", "file:///dest1/B/file.pdf"],
  preprocess_uris: ["s3://bucket_name/A/file.pdf", "s3://bucket_name/B/file.pdf"]
}