mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Rename Azure to AzureStorage (#30057)
This commit is contained in:
parent
b9f0eb24ed
commit
3179f089be
6 changed files with 8 additions and 8 deletions
|
@ -7,7 +7,7 @@ require "active_storage/log_subscriber"
|
||||||
# * +Disk+, to manage attachments saved directly on the hard drive.
|
# * +Disk+, to manage attachments saved directly on the hard drive.
|
||||||
# * +GCS+, to manage attachments through Google Cloud Storage.
|
# * +GCS+, to manage attachments through Google Cloud Storage.
|
||||||
# * +S3+, to manage attachments through Amazon S3.
|
# * +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.
|
# * +Mirror+, to be able to use several services to manage attachments.
|
||||||
#
|
#
|
||||||
# Inside a Rails application, you can set-up your services through the
|
# Inside a Rails application, you can set-up your services through the
|
||||||
|
|
|
@ -4,7 +4,7 @@ require "azure/storage/core/auth/shared_access_signature"
|
||||||
|
|
||||||
# Wraps the Microsoft Azure Storage Blob Service as a Active Storage service.
|
# 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.
|
# 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
|
attr_reader :client, :path, :blobs, :container, :signer
|
||||||
|
|
||||||
def initialize(path:, storage_account_name:, storage_access_key:, container:)
|
def initialize(path:, storage_account_name:, storage_access_key:, container:)
|
|
@ -22,7 +22,7 @@ class ActiveStorage::Service::Configurator #:nodoc:
|
||||||
end
|
end
|
||||||
|
|
||||||
def resolve(class_name)
|
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")
|
ActiveStorage::Service.const_get(:"#{class_name}Service")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -69,7 +69,7 @@ else
|
||||||
end
|
end
|
||||||
|
|
||||||
if SERVICE_CONFIGURATIONS[:azure]
|
if SERVICE_CONFIGURATIONS[:azure]
|
||||||
class ActiveStorage::AzureDirectUploadsControllerTest < ActionDispatch::IntegrationTest
|
class ActiveStorage::AzureStorageDirectUploadsControllerTest < ActionDispatch::IntegrationTest
|
||||||
setup do
|
setup do
|
||||||
@config = SERVICE_CONFIGURATIONS[:azure]
|
@config = SERVICE_CONFIGURATIONS[:azure]
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ if SERVICE_CONFIGURATIONS[:azure]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
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
|
end
|
||||||
|
|
||||||
class ActiveStorage::DiskDirectUploadsControllerTest < ActionDispatch::IntegrationTest
|
class ActiveStorage::DiskDirectUploadsControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
|
|
@ -2,7 +2,7 @@ require "service/shared_service_tests"
|
||||||
require "uri"
|
require "uri"
|
||||||
|
|
||||||
if SERVICE_CONFIGURATIONS[:azure]
|
if SERVICE_CONFIGURATIONS[:azure]
|
||||||
class ActiveStorage::Service::AzureServiceTest < ActiveSupport::TestCase
|
class ActiveStorage::Service::AzureStorageServiceTest < ActiveSupport::TestCase
|
||||||
SERVICE = ActiveStorage::Service.configure(:azure, SERVICE_CONFIGURATIONS)
|
SERVICE = ActiveStorage::Service.configure(:azure, SERVICE_CONFIGURATIONS)
|
||||||
|
|
||||||
include ActiveStorage::Service::SharedServiceTests
|
include ActiveStorage::Service::SharedServiceTests
|
|
@ -21,9 +21,9 @@ s3:
|
||||||
# }
|
# }
|
||||||
# project:
|
# project:
|
||||||
# bucket:
|
# bucket:
|
||||||
#
|
#
|
||||||
# azure:
|
# azure:
|
||||||
# service: Azure
|
# service: AzureStorage
|
||||||
# path: ""
|
# path: ""
|
||||||
# storage_account_name: ""
|
# storage_account_name: ""
|
||||||
# storage_access_key: ""
|
# storage_access_key: ""
|
||||||
|
|
Loading…
Reference in a new issue