From 3179f089be4f631b9c0f8b431567992164f2bdb4 Mon Sep 17 00:00:00 2001 From: Dino Maric Date: Sat, 5 Aug 2017 00:57:02 +0200 Subject: [PATCH] Rename Azure to AzureStorage (#30057) --- activestorage/lib/active_storage/service.rb | 2 +- .../service/{azure_service.rb => azure_storage_service.rb} | 2 +- activestorage/lib/active_storage/service/configurator.rb | 2 +- .../test/controllers/direct_uploads_controller_test.rb | 4 ++-- .../{azure_service_test.rb => azure_storage_service_test.rb} | 2 +- activestorage/test/service/configurations.yml | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) rename activestorage/lib/active_storage/service/{azure_service.rb => azure_storage_service.rb} (97%) rename activestorage/test/service/{azure_service_test.rb => azure_storage_service_test.rb} (80%) diff --git a/activestorage/lib/active_storage/service.rb b/activestorage/lib/active_storage/service.rb index f6b4877759..4223295ed8 100644 --- a/activestorage/lib/active_storage/service.rb +++ b/activestorage/lib/active_storage/service.rb @@ -7,7 +7,7 @@ require "active_storage/log_subscriber" # * +Disk+, to manage attachments saved directly on the hard drive. # * +GCS+, to manage attachments through Google Cloud Storage. # * +S3+, to manage attachments through Amazon S3. -# * +Azure+, to manage attachments through Microsoft Azure Storage. +# * +AzureStorage+, to manage attachments through Microsoft Azure Storage. # * +Mirror+, to be able to use several services to manage attachments. # # Inside a Rails application, you can set-up your services through the diff --git a/activestorage/lib/active_storage/service/azure_service.rb b/activestorage/lib/active_storage/service/azure_storage_service.rb similarity index 97% rename from activestorage/lib/active_storage/service/azure_service.rb rename to activestorage/lib/active_storage/service/azure_storage_service.rb index a505b9a0ee..527dc57eeb 100644 --- a/activestorage/lib/active_storage/service/azure_service.rb +++ b/activestorage/lib/active_storage/service/azure_storage_service.rb @@ -4,7 +4,7 @@ require "azure/storage/core/auth/shared_access_signature" # Wraps the Microsoft Azure Storage Blob Service as a Active Storage service. # See `ActiveStorage::Service` for the generic API documentation that applies to all services. -class ActiveStorage::Service::AzureService < ActiveStorage::Service +class ActiveStorage::Service::AzureStorageService < ActiveStorage::Service attr_reader :client, :path, :blobs, :container, :signer def initialize(path:, storage_account_name:, storage_access_key:, container:) diff --git a/activestorage/lib/active_storage/service/configurator.rb b/activestorage/lib/active_storage/service/configurator.rb index 00ae24d251..a0afdaa912 100644 --- a/activestorage/lib/active_storage/service/configurator.rb +++ b/activestorage/lib/active_storage/service/configurator.rb @@ -22,7 +22,7 @@ class ActiveStorage::Service::Configurator #:nodoc: end def resolve(class_name) - require "active_storage/service/#{class_name.to_s.downcase}_service" + require "active_storage/service/#{class_name.to_s.underscore}_service" ActiveStorage::Service.const_get(:"#{class_name}Service") end end diff --git a/activestorage/test/controllers/direct_uploads_controller_test.rb b/activestorage/test/controllers/direct_uploads_controller_test.rb index b9f9bd8cb4..e056b629bb 100644 --- a/activestorage/test/controllers/direct_uploads_controller_test.rb +++ b/activestorage/test/controllers/direct_uploads_controller_test.rb @@ -69,7 +69,7 @@ else end if SERVICE_CONFIGURATIONS[:azure] - class ActiveStorage::AzureDirectUploadsControllerTest < ActionDispatch::IntegrationTest + class ActiveStorage::AzureStorageDirectUploadsControllerTest < ActionDispatch::IntegrationTest setup do @config = SERVICE_CONFIGURATIONS[:azure] @@ -99,7 +99,7 @@ if SERVICE_CONFIGURATIONS[:azure] end end else - puts "Skipping Azure Direct Upload tests because no Azure configuration was supplied" + puts "Skipping Azure Storage Direct Upload tests because no Azure Storage configuration was supplied" end class ActiveStorage::DiskDirectUploadsControllerTest < ActionDispatch::IntegrationTest diff --git a/activestorage/test/service/azure_service_test.rb b/activestorage/test/service/azure_storage_service_test.rb similarity index 80% rename from activestorage/test/service/azure_service_test.rb rename to activestorage/test/service/azure_storage_service_test.rb index fb617db019..e2be510b60 100644 --- a/activestorage/test/service/azure_service_test.rb +++ b/activestorage/test/service/azure_storage_service_test.rb @@ -2,7 +2,7 @@ require "service/shared_service_tests" require "uri" if SERVICE_CONFIGURATIONS[:azure] - class ActiveStorage::Service::AzureServiceTest < ActiveSupport::TestCase + class ActiveStorage::Service::AzureStorageServiceTest < ActiveSupport::TestCase SERVICE = ActiveStorage::Service.configure(:azure, SERVICE_CONFIGURATIONS) include ActiveStorage::Service::SharedServiceTests diff --git a/activestorage/test/service/configurations.yml b/activestorage/test/service/configurations.yml index 90b6baf0db..d7aa672573 100644 --- a/activestorage/test/service/configurations.yml +++ b/activestorage/test/service/configurations.yml @@ -21,9 +21,9 @@ s3: # } # project: # bucket: -# +# # azure: -# service: Azure +# service: AzureStorage # path: "" # storage_account_name: "" # storage_access_key: ""