-
Notifications
You must be signed in to change notification settings - Fork 3
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
refactor: replace calls to deprecated FileSignature#signature_from_file with .from_file #141
Comments
what i found: preservation_catalog $ cd ..
software_dev_projects $
software_dev_projects $
software_dev_projects $
software_dev_projects $ grep -r signature_from_file .
./dor-services/lib/dor/services/digital_stacks_service.rb: file_signature = Moab::FileSignature.new.signature_from_file(file_pathname)
./dor-services/lib/dor/services/digital_stacks_service.rb: file_signature = Moab::FileSignature.new.signature_from_file(old_pathname)
./dor-services/lib/dor/services/digital_stacks_service.rb: file_signature = Moab::FileSignature.new.signature_from_file(stacks_pathname)
./dor-services/spec/services/digital_stacks_service_spec.rb: moab_signature = Moab::FileSignature.new.signature_from_file(file_pathname)
./dor-services/spec/services/digital_stacks_service_spec.rb: moab_signature = Moab::FileSignature.new.signature_from_file(old_pathname)
./dor-services/spec/services/digital_stacks_service_spec.rb: moab_signature = Moab::FileSignature.new.signature_from_file(workspace_pathname)
./dor-services/spec/services/digital_stacks_service_spec.rb: moab_signature = Moab::FileSignature.new.signature_from_file(stacks_pathname)
./dor-services-v4/dor-services/lib/dor/services/digital_stacks_service.rb: file_signature = Moab::FileSignature.new.signature_from_file(file_pathname)
./dor-services-v4/dor-services/lib/dor/services/digital_stacks_service.rb: file_signature = Moab::FileSignature.new.signature_from_file(old_pathname)
./dor-services-v4/dor-services/lib/dor/services/digital_stacks_service.rb: file_signature = Moab::FileSignature.new.signature_from_file(stacks_pathname)
./dor-services-v4/dor-services/spec/dor/digital_stacks_service_spec.rb: moab_signature = Moab::FileSignature.new.signature_from_file(file_pathname)
./dor-services-v4/dor-services/spec/dor/digital_stacks_service_spec.rb: moab_signature = Moab::FileSignature.new.signature_from_file(old_pathname)
./dor-services-v4/dor-services/spec/dor/digital_stacks_service_spec.rb: moab_signature = Moab::FileSignature.new.signature_from_file(workspace_pathname)
./dor-services-v4/dor-services/spec/dor/digital_stacks_service_spec.rb: moab_signature = Moab::FileSignature.new.signature_from_file(stacks_pathname)
./moab-versioning/lib/moab/bagger.rb: signature = FileSignature.new.signature_from_file(file)
./moab-versioning/lib/moab/file_group.rb: signature = FileSignature.new.signature_from_file(pathname)
./moab-versioning/lib/moab/file_signature.rb: def signature_from_file(pathname)
./moab-versioning/lib/moab/file_signature.rb: sig_from_file = FileSignature.new.signature_from_file(pathname)
./moab-versioning/spec/unit_tests/moab/file_group_spec.rb: expect(sig1).to receive(:signature_from_file).with(pathname)
./moab-versioning/spec/unit_tests/moab/file_manifestation_spec.rb: title_v1_signature = Moab::FileSignature.new.signature_from_file(title_v1_pathname)
./moab-versioning/spec/unit_tests/moab/file_signature_spec.rb: let(:title_v1_signature) { Moab::FileSignature.new.signature_from_file(title_v1_pathname) }
./moab-versioning/spec/unit_tests/moab/file_signature_spec.rb: Moab::FileSignature.new.signature_from_file(title_v2_pathname)
./moab-versioning/spec/unit_tests/moab/file_signature_spec.rb: Moab::FileSignature.new.signature_from_file(page1_v1_pathname)
./moab-versioning/spec/unit_tests/moab/file_signature_spec.rb: Moab::FileSignature.new.signature_from_file(page1_v2_pathname)
./moab-versioning/spec/unit_tests/moab/file_signature_spec.rb: specify '#signature_from_file' do
./preservation_catalog/app/services/checksum_validator.rb: Moab::FileSignature.new.signature_from_file(Pathname(file))
software_dev_projects $
software_dev_projects $ what i have cloned:
|
Currently, externally to this gem, it's a couple calls for digital_stacks_service in dor-services-app: https://github.com/search?q=org%3Asul-dlss+signature_from_file&type=code |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Replace
FileSignature#signature_from_file
withFileSignature.from_file
as @atz has pointed out,
#signature_from_file
is basically a method in the style of a factory method that produces new instances, except it actually sets values on the current instance and returns itself, but it's only (predominantly?) used chained afterFileSignature.new
, so it's being used as a de facto constructor anyway. The method comment also claims the intent is to create new instances ("Generate a FileSignature instance").Would be nice to get rid of
#signature_from_file
usage in general, both in non-test moab-versioning code, and in other applications that use moab-versioning (including once in preservation_catalog), and then ultimately from moab-versioning entirely. Joe and I both grepped all our cloned DLSS projects, and the only usage we found was of theFileSignature.new.signature_from_file
variety, which could easily be replaced byFileSignature.from_file
.Definitely not a high priority at the moment, but would be a helpful thing for understandability and maintenance of moab-versioning. And a pretty mechanical change.
The text was updated successfully, but these errors were encountered: