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

clean up the csv import functionality #244

Merged
merged 1 commit into from
Sep 11, 2018
Merged

Conversation

jmartin-sul
Copy link
Member

  • centralize this shared functionality to a file in app/lib, move tests to corresponding spec file, have everything that needs the functionality use the app/lib method
  • give it a slighty better name
  • stop delegating unnecessarily in Bundle, and stop calling it via Bundle. remove duplicate test in bundle_spec.rb
  • excise unnecessary redefinition and tests in bundle_context_temporary and its _spec
  • switch to using the more standard ArgumentError instead of the custom BundleUsageError

@coveralls
Copy link

Pull Request Test Coverage Report for Build 747

  • 10 of 10 (100.0%) changed or added relevant lines in 4 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.5%) to 67.528%

Files with Coverage Reduction New Missed Lines %
app/lib/pre_assembly/logging.rb 2 92.31%
Totals Coverage Status
Change from base Build 745: -0.5%
Covered Lines: 601
Relevant Lines: 890

💛 - Coveralls

* centralize this shared functionality to a file in app/lib, move tests to corresponding spec file, have everything that needs the functionality use the app/lib method
* give it a slighty better name
* stop delegating unnecessarily in Bundle, and stop calling it via Bundle.  remove duplicate test in bundle_spec.rb
* excise unnecessary redefinition and tests in bundle_context_temporary and its _spec
* switch to using the more standard ArgumentError instead of the custom BundleUsageError
@atz atz merged commit c2fb5fa into master Sep 11, 2018
@atz atz deleted the cleanup-csv-import-code branch September 11, 2018 19:50
@atz atz removed the review label Sep 11, 2018
Copy link
Contributor

@ndushay ndushay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought this was going to be a private method in BundleContext, which is the only user? Is it split out because we're getting rid of BundleContextTemporary and this makes that easier?

@jmartin-sul
Copy link
Member Author

when i went to make it a private method, it turned out there was one other consumer. the consumer was not Bundle, but something else that called the import method via Bundle (which used to be its home). that might've been the reason for the delegation in the first place, not totally sure.

so my comment on the last PR was wrong, it can't be a private method since smpl.rb still uses it (via Bundle):
https://github.com/sul-dlss/pre-assembly/blob/master/app/lib/pre_assembly/smpl.rb#L49
https://github.com/sul-dlss/pre-assembly/blob/master/app/lib/pre_assembly/smpl.rb#L42
https://github.com/sul-dlss/pre-assembly/blob/master/app/lib/pre_assembly/bundle.rb#L65

@jmartin-sul
Copy link
Member Author

re: BundleContextTemporary, i just did the minimum there to not have the tests break, since the plan is to remove that anyway. but the decision to centralize to app/lib was driven by Smpl.initialize, and not BundleContextTemporary.

@ndushay
Copy link
Contributor

ndushay commented Sep 11, 2018

fair nuff.

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

Successfully merging this pull request may close these issues.

None yet

4 participants