Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Template In Generators and Storage Adapter #2

Closed
12 tasks done
Tracked by #421
jeremyf opened this issue May 8, 2023 · 0 comments
Closed
12 tasks done
Tracked by #421

Implement Template In Generators and Storage Adapter #2

jeremyf opened this issue May 8, 2023 · 0 comments
Assignees

Comments

@jeremyf
Copy link
Contributor

jeremyf commented May 8, 2023

With Write the template function handling for URIs · Issue scientist-softserv/adventist-dl#1 · scientist-softserv/derivative_rodeo we introduced the idea of encoding path information in the adapter name.

  • Change the Generators::BaseGenerator and subclasses to use the template

    • base_generator.rb
    • copy_generator.rb
    • hocr_generator.rb
    • monochrome_generator.rb
    • pdf_split_generator.rb
  • Change the StorageAdapters::BaseStorage and subclasses to leverage the template

    • base_adapter.rb
    • download_adapter.rb
    • file_adapter.rb
    • s3_adapter.rb
    • sqs_adapter.rb

One of the tests for “done” is to write a test for the CopyGenerator that copies from one file adapter to another file adapter. Another test, and necessary to demonstrate the feature is to write a test confirming the PdfSplitGenerator behavior.

Related to:

@jeremyf jeremyf self-assigned this May 8, 2023
jeremyf added a commit that referenced this issue May 8, 2023
As part of prior pairing sessions, we wanted to incorporate the idea of
a template for the path.

With this change, I'm testing the behavior within the confines of the
CopyGenerator.  Mostly as a proof of concept.

The next part is to roll this out to the PdfSplitGenerator; then
generalize and finally tidy-up methods no longer used.

Related to:

- #2
jeremyf added a commit that referenced this issue May 9, 2023
jeremyf added a commit that referenced this issue May 9, 2023
jeremyf added a commit that referenced this issue May 9, 2023
jeremyf added a commit that referenced this issue May 9, 2023
Prior to this commit, for all subclasses of BaseGenerator, I had
overwritten the `#initialize` and `#destination` methods.  I did this to
step-wise iterate on each subclass.

With this commit, I've normalized all generators to use a common
initialize and destination method.

Related to:

- #2
jeremyf added a commit that referenced this issue May 9, 2023
This aligns with the concept of the output target.  Further, this commit
adds some tests.

Related to:

- #2
jeremyf added a commit that referenced this issue May 9, 2023
This also involves renaming preprocessed_target_template

Related to:

- #2
@jeremyf jeremyf closed this as completed May 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant