From 3987bdcf3462943cd0c7e55716128c26328f9612 Mon Sep 17 00:00:00 2001 From: gia-lexa <103389320+gia-lexa@users.noreply.github.com> Date: Mon, 15 May 2023 12:29:16 -0700 Subject: [PATCH] Removes 'require_dependency' From 'vba_documents' Module (#12644) * Removes unnecessary 'require_dependency' statements from vba_documents module * Updates 'require_dependency' with 'require' * Replaces 'require_depdendency' with 'require' * Replaces 'require_depdendency' with 'require' * Resolves rubocop error --------- Co-authored-by: Gia Antoniades --- .../controllers/vba_documents/docs/v1/api_controller.rb | 6 ------ .../controllers/vba_documents/docs/v2/api_controller.rb | 6 ------ .../internal/v1/upload_complete_controller.rb | 2 -- .../controllers/vba_documents/v1/reports_controller.rb | 1 - .../controllers/vba_documents/v1/uploads_controller.rb | 6 +----- .../controllers/vba_documents/v2/reports_controller.rb | 1 - .../controllers/vba_documents/v2/uploads_controller.rb | 8 ++------ .../vba_documents/app/models/vba_documents/upload_file.rb | 1 - .../app/models/vba_documents/upload_submission.rb | 4 +--- .../app/serializers/vba_documents/upload_serializer.rb | 3 +-- .../app/workers/vba_documents/upload_processor.rb | 5 +---- .../vba_documents/lib/vba_documents/payload_manager.rb | 4 +--- .../vba_documents/lib/vba_documents/upload_validator.rb | 2 -- .../vba_documents/spec/request/v1/uploads_request_spec.rb | 5 +---- .../vba_documents/spec/request/v2/uploads_request_spec.rb | 4 +--- .../spec/request/v2/uploads_request_submission_spec.rb | 3 --- 16 files changed, 9 insertions(+), 52 deletions(-) diff --git a/modules/vba_documents/app/controllers/vba_documents/docs/v1/api_controller.rb b/modules/vba_documents/app/controllers/vba_documents/docs/v1/api_controller.rb index 55049512c53..042a8d164a4 100644 --- a/modules/vba_documents/app/controllers/vba_documents/docs/v1/api_controller.rb +++ b/modules/vba_documents/app/controllers/vba_documents/docs/v1/api_controller.rb @@ -1,11 +1,5 @@ # frozen_string_literal: true -require_dependency 'vba_documents/v1/swagger_root' -require_dependency 'vba_documents/document_upload/status_report_swagger' -require_dependency 'vba_documents/document_upload/v1/status_attributes_swagger' -require_dependency 'vba_documents/document_upload/v1/pdf_upload_attributes_swagger' -require_dependency 'vba_documents/document_upload/v1/pdf_dimension_attributes_swagger' - module VBADocuments module Docs module V1 diff --git a/modules/vba_documents/app/controllers/vba_documents/docs/v2/api_controller.rb b/modules/vba_documents/app/controllers/vba_documents/docs/v2/api_controller.rb index 0bbbbc8786a..5049c0d4533 100644 --- a/modules/vba_documents/app/controllers/vba_documents/docs/v2/api_controller.rb +++ b/modules/vba_documents/app/controllers/vba_documents/docs/v2/api_controller.rb @@ -1,11 +1,5 @@ # frozen_string_literal: true -require_dependency 'vba_documents/v2/swagger_root' -require_dependency 'vba_documents/document_upload/status_report_swagger' -require_dependency 'vba_documents/document_upload/v1/status_attributes_swagger' -require_dependency 'vba_documents/document_upload/v1/pdf_upload_attributes_swagger' -require_dependency 'vba_documents/document_upload/v1/pdf_dimension_attributes_swagger' - module VBADocuments module Docs module V2 diff --git a/modules/vba_documents/app/controllers/vba_documents/internal/v1/upload_complete_controller.rb b/modules/vba_documents/app/controllers/vba_documents/internal/v1/upload_complete_controller.rb index ca179f0a430..2174601810a 100644 --- a/modules/vba_documents/app/controllers/vba_documents/internal/v1/upload_complete_controller.rb +++ b/modules/vba_documents/app/controllers/vba_documents/internal/v1/upload_complete_controller.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require_dependency 'vba_documents/application_controller' -require_dependency 'vba_documents/object_store' require 'common/exceptions' module VBADocuments diff --git a/modules/vba_documents/app/controllers/vba_documents/v1/reports_controller.rb b/modules/vba_documents/app/controllers/vba_documents/v1/reports_controller.rb index f6c8f489aab..e277bb75f4f 100644 --- a/modules/vba_documents/app/controllers/vba_documents/v1/reports_controller.rb +++ b/modules/vba_documents/app/controllers/vba_documents/v1/reports_controller.rb @@ -1,6 +1,5 @@ # frozen_string_literal: true -require_dependency 'vba_documents/application_controller' require 'common/exceptions' module VBADocuments diff --git a/modules/vba_documents/app/controllers/vba_documents/v1/uploads_controller.rb b/modules/vba_documents/app/controllers/vba_documents/v1/uploads_controller.rb index 76b1362791d..25251bf70c3 100644 --- a/modules/vba_documents/app/controllers/vba_documents/v1/uploads_controller.rb +++ b/modules/vba_documents/app/controllers/vba_documents/v1/uploads_controller.rb @@ -1,11 +1,7 @@ # frozen_string_literal: true require 'zip' - -require_dependency 'vba_documents/application_controller' -require_dependency 'vba_documents/upload_error' -require_dependency 'vba_documents/payload_manager' -require_dependency 'vba_documents/document_request_validator' +require 'vba_documents/payload_manager' require 'common/exceptions' module VBADocuments diff --git a/modules/vba_documents/app/controllers/vba_documents/v2/reports_controller.rb b/modules/vba_documents/app/controllers/vba_documents/v2/reports_controller.rb index eeaf13958c7..9af78c10f99 100644 --- a/modules/vba_documents/app/controllers/vba_documents/v2/reports_controller.rb +++ b/modules/vba_documents/app/controllers/vba_documents/v2/reports_controller.rb @@ -1,6 +1,5 @@ # frozen_string_literal: true -require_dependency 'vba_documents/application_controller' require 'common/exceptions' module VBADocuments diff --git a/modules/vba_documents/app/controllers/vba_documents/v2/uploads_controller.rb b/modules/vba_documents/app/controllers/vba_documents/v2/uploads_controller.rb index 36d2cb4122f..d9a7e320200 100644 --- a/modules/vba_documents/app/controllers/vba_documents/v2/uploads_controller.rb +++ b/modules/vba_documents/app/controllers/vba_documents/v2/uploads_controller.rb @@ -1,13 +1,9 @@ # frozen_string_literal: true require 'zip' - -require_dependency 'vba_documents/application_controller' -require_dependency 'vba_documents/upload_error' -require_dependency 'vba_documents/payload_manager' -require_dependency 'vba_documents/upload_validator' -require_dependency 'vba_documents/multipart_parser' require 'common/exceptions' +require 'vba_documents/payload_manager' +require 'vba_documents/upload_validator' require './lib/webhooks/utilities' module VBADocuments diff --git a/modules/vba_documents/app/models/vba_documents/upload_file.rb b/modules/vba_documents/app/models/vba_documents/upload_file.rb index 9d8107d7bdc..e349efdde62 100644 --- a/modules/vba_documents/app/models/vba_documents/upload_file.rb +++ b/modules/vba_documents/app/models/vba_documents/upload_file.rb @@ -1,6 +1,5 @@ # frozen_string_literal: true -require_dependency 'vba_documents/multipart_parser' module VBADocuments class UploadFile < UploadSubmission has_one_attached :multipart_file diff --git a/modules/vba_documents/app/models/vba_documents/upload_submission.rb b/modules/vba_documents/app/models/vba_documents/upload_submission.rb index c1a40bb9a12..68279ae6018 100644 --- a/modules/vba_documents/app/models/vba_documents/upload_submission.rb +++ b/modules/vba_documents/app/models/vba_documents/upload_submission.rb @@ -1,10 +1,8 @@ # frozen_string_literal: true -require_dependency 'vba_documents/upload_error' -require_dependency 'vba_documents/sql_support' +require 'vba_documents/sql_support' require 'central_mail/service' require 'common/exceptions' -require_dependency './lib/webhooks/utilities' module VBADocuments class UploadSubmission < ApplicationRecord diff --git a/modules/vba_documents/app/serializers/vba_documents/upload_serializer.rb b/modules/vba_documents/app/serializers/vba_documents/upload_serializer.rb index 61c13aac5f2..08002d1254d 100644 --- a/modules/vba_documents/app/serializers/vba_documents/upload_serializer.rb +++ b/modules/vba_documents/app/serializers/vba_documents/upload_serializer.rb @@ -1,7 +1,6 @@ # frozen_string_literal: true -require_dependency 'common/exceptions' -require_dependency 'vba_documents/pdf_inspector' +require 'vba_documents/pdf_inspector' module VBADocuments class UploadSerializer < ActiveModel::Serializer diff --git a/modules/vba_documents/app/workers/vba_documents/upload_processor.rb b/modules/vba_documents/app/workers/vba_documents/upload_processor.rb index 6c07266f4a6..f747d832b9a 100644 --- a/modules/vba_documents/app/workers/vba_documents/upload_processor.rb +++ b/modules/vba_documents/app/workers/vba_documents/upload_processor.rb @@ -1,11 +1,8 @@ # frozen_string_literal: true -require_dependency 'vba_documents/upload_validator' -require_dependency 'vba_documents/payload_manager' -require_dependency 'vba_documents/multipart_parser' - require 'sidekiq' require 'vba_documents/object_store' +require 'vba_documents/payload_manager' require 'vba_documents/upload_error' require 'central_mail/utilities' diff --git a/modules/vba_documents/lib/vba_documents/payload_manager.rb b/modules/vba_documents/lib/vba_documents/payload_manager.rb index 9df3213b5d4..7ecccf85b6f 100644 --- a/modules/vba_documents/lib/vba_documents/payload_manager.rb +++ b/modules/vba_documents/lib/vba_documents/payload_manager.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true -require_dependency 'vba_documents/multipart_parser' -require_dependency 'vba_documents/object_store' -require_dependency 'vba_documents/upload_error' +require 'vba_documents/upload_error' module VBADocuments class PayloadManager diff --git a/modules/vba_documents/lib/vba_documents/upload_validator.rb b/modules/vba_documents/lib/vba_documents/upload_validator.rb index 470aedf906b..435c2137860 100644 --- a/modules/vba_documents/lib/vba_documents/upload_validator.rb +++ b/modules/vba_documents/lib/vba_documents/upload_validator.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require_dependency 'vba_documents/pdf_inspector' - require 'central_mail/utilities' require 'central_mail/service' require 'pdf_utilities/pdf_validator' diff --git a/modules/vba_documents/spec/request/v1/uploads_request_spec.rb b/modules/vba_documents/spec/request/v1/uploads_request_spec.rb index 341148096df..2e43e05a045 100644 --- a/modules/vba_documents/spec/request/v1/uploads_request_spec.rb +++ b/modules/vba_documents/spec/request/v1/uploads_request_spec.rb @@ -1,11 +1,8 @@ # frozen_string_literal: true require 'rails_helper' +require 'vba_documents/payload_manager' require_relative '../../support/vba_document_fixtures' -require_dependency 'vba_documents/payload_manager' -require_dependency 'vba_documents/object_store' -require_dependency 'vba_documents/multipart_parser' -require_dependency 'vba_documents/document_request_validator' RSpec.describe 'VBA Document Uploads Endpoint', type: :request, retry: 3 do include VBADocuments::Fixtures diff --git a/modules/vba_documents/spec/request/v2/uploads_request_spec.rb b/modules/vba_documents/spec/request/v2/uploads_request_spec.rb index c958721f29a..80140ba9634 100644 --- a/modules/vba_documents/spec/request/v2/uploads_request_spec.rb +++ b/modules/vba_documents/spec/request/v2/uploads_request_spec.rb @@ -2,10 +2,8 @@ require 'rails_helper' require './lib/webhooks/utilities' +require 'vba_documents/payload_manager' require_relative '../../support/vba_document_fixtures' -require_dependency 'vba_documents/payload_manager' -require_dependency 'vba_documents/object_store' -require_dependency 'vba_documents/multipart_parser' RSpec.describe 'VBA Document Uploads Endpoint', type: :request, retry: 3 do include VBADocuments::Fixtures diff --git a/modules/vba_documents/spec/request/v2/uploads_request_submission_spec.rb b/modules/vba_documents/spec/request/v2/uploads_request_submission_spec.rb index 89ec2bbd67d..fa43ecea5a8 100644 --- a/modules/vba_documents/spec/request/v2/uploads_request_submission_spec.rb +++ b/modules/vba_documents/spec/request/v2/uploads_request_submission_spec.rb @@ -4,9 +4,6 @@ require './lib/central_mail/utilities' require_relative '../../support/vba_document_fixtures' -require_dependency 'vba_documents/object_store' -require_dependency 'vba_documents/multipart_parser' - # rubocop:disable Style/OptionalBooleanParameter RSpec.describe 'VBA Document Uploads Endpoint', type: :request, retry: 3 do include VBADocuments::Fixtures