1
0
Fork 0
mirror of https://github.com/fog/fog-aws.git synced 2022-11-09 13:50:52 -05:00

git grep -l "Storage::AWS" -- lib/ | xargs sed -i "" "s/Storage::AWS/AWS::Storage/g"

This commit is contained in:
sue445 2018-09-14 23:13:30 +09:00
parent 270d6f632e
commit ed087d80d9
35 changed files with 47 additions and 47 deletions

View file

@ -4,7 +4,7 @@ module Fog
module AWS
class Storage
class Directories < Fog::Collection
model Fog::Storage::AWS::Directory
model Fog::AWS::Storage::Directory
def all
data = service.get_service.body['Buckets']

View file

@ -40,7 +40,7 @@ module Fog
end
def files
@files ||= Fog::Storage::AWS::Files.new(:directory => self, :service => service)
@files ||= Fog::AWS::Storage::Files.new(:directory => self, :service => service)
end
def payer
@ -67,7 +67,7 @@ module Fog
end
def versions
@versions ||= Fog::Storage::AWS::Versions.new(:directory => self, :service => service)
@versions ||= Fog::AWS::Storage::Versions.new(:directory => self, :service => service)
end
def public=(new_public)

View file

@ -240,11 +240,11 @@ module Fog
end
# File version if exists or creates new version.
# @return [Fog::Storage::AWS::Version]
# @return [Fog::AWS::Storage::Version]
#
def versions
@versions ||= begin
Fog::Storage::AWS::Versions.new(
Fog::AWS::Storage::Versions.new(
:file => self,
:service => service
)

View file

@ -15,7 +15,7 @@ module Fog
attribute :max_keys, :aliases => ['MaxKeys', 'max-keys']
attribute :prefix, :aliases => 'Prefix'
model Fog::Storage::AWS::File
model Fog::AWS::Storage::File
def all(options = {})
requires :directory
@ -70,7 +70,7 @@ module Fog
when /<Code>NoSuchKey<\/Code>/
nil
when /<Code>NoSuchBucket<\/Code>/
raise(Fog::Storage::AWS::NotFound.new("Directory #{directory.identity} does not exist."))
raise(Fog::AWS::Storage::NotFound.new("Directory #{directory.identity} does not exist."))
else
raise(error)
end

View file

@ -7,7 +7,7 @@ module Fog
attribute :file
attribute :directory
model Fog::Storage::AWS::Version
model Fog::AWS::Storage::Version
def all(options = {})
data = if file

View file

@ -25,7 +25,7 @@ module Fog
class Mock # :nodoc:all
require 'fog/aws/requests/storage/shared_mock_methods'
include Fog::Storage::AWS::SharedMockMethods
include Fog::AWS::Storage::SharedMockMethods
def abort_multipart_upload(bucket_name, object_name, upload_id)
verify_mock_bucket_exists(bucket_name)

View file

@ -51,7 +51,7 @@ module Fog
end
def self.acl_to_hash(acl_xml)
parser = Fog::Parsers::Storage::AWS::AccessControlList.new
parser = Fog::Parsers::AWS::Storage::AccessControlList.new
Nokogiri::XML::SAX::Parser.new(parser).parse(acl_xml)
parser.response
end

View file

@ -40,7 +40,7 @@ module Fog
:bucket_name => bucket_name,
:object_name => object_name,
:method => 'POST',
:parser => Fog::Parsers::Storage::AWS::CompleteMultipartUpload.new,
:parser => Fog::Parsers::AWS::Storage::CompleteMultipartUpload.new,
:query => {'uploadId' => upload_id}
})
end
@ -48,7 +48,7 @@ module Fog
class Mock # :nodoc:all
require 'fog/aws/requests/storage/shared_mock_methods'
include Fog::Storage::AWS::SharedMockMethods
include Fog::AWS::Storage::SharedMockMethods
def complete_multipart_upload(bucket_name, object_name, upload_id, parts)
bucket = verify_mock_bucket_exists(bucket_name)

View file

@ -35,7 +35,7 @@ module Fog
:bucket_name => target_bucket_name,
:object_name => target_object_name,
:method => 'PUT',
:parser => Fog::Parsers::Storage::AWS::CopyObject.new,
:parser => Fog::Parsers::AWS::Storage::CopyObject.new,
})
end
end

View file

@ -30,7 +30,7 @@ module Fog
end
def self.cors_to_hash(cors_xml)
parser = Fog::Parsers::Storage::AWS::CorsConfiguration.new
parser = Fog::Parsers::AWS::Storage::CorsConfiguration.new
Nokogiri::XML::SAX::Parser.new(parser).parse(cors_xml)
parser.response
end

View file

@ -56,7 +56,7 @@ module Fog
:headers => headers,
:bucket_name => bucket_name,
:method => 'POST',
:parser => Fog::Parsers::Storage::AWS::DeleteMultipleObjects.new,
:parser => Fog::Parsers::AWS::Storage::DeleteMultipleObjects.new,
:query => {'delete' => nil}
})
end

View file

@ -46,7 +46,7 @@ module Fog
:bucket_name => bucket_name,
:idempotent => true,
:method => 'GET',
:parser => Fog::Parsers::Storage::AWS::GetBucket.new,
:parser => Fog::Parsers::AWS::Storage::GetBucket.new,
:query => options
})
end

View file

@ -35,7 +35,7 @@ module Fog
:bucket_name => bucket_name,
:idempotent => true,
:method => 'GET',
:parser => Fog::Parsers::Storage::AWS::AccessControlList.new,
:parser => Fog::Parsers::AWS::Storage::AccessControlList.new,
:query => {'acl' => nil}
})
end
@ -49,7 +49,7 @@ module Fog
if acl = self.data[:acls][:bucket][bucket_name]
response.status = 200
if acl.is_a?(String)
response.body = Fog::Storage::AWS.acl_to_hash(acl)
response.body = Fog::AWS::Storage.acl_to_hash(acl)
else
response.body = acl
end

View file

@ -31,7 +31,7 @@ module Fog
:bucket_name => bucket_name,
:idempotent => true,
:method => 'GET',
:parser => Fog::Parsers::Storage::AWS::CorsConfiguration.new,
:parser => Fog::Parsers::AWS::Storage::CorsConfiguration.new,
:query => {'cors' => nil}
})
end
@ -45,7 +45,7 @@ module Fog
if cors = self.data[:cors][:bucket][bucket_name]
response.status = 200
if cors.is_a?(String)
response.body = Fog::Storage::AWS.cors_to_hash(cors)
response.body = Fog::AWS::Storage.cors_to_hash(cors)
else
response.body = cors
end

View file

@ -25,7 +25,7 @@ module Fog
:bucket_name => bucket_name,
:idempotent => true,
:method => 'GET',
:parser => Fog::Parsers::Storage::AWS::GetBucketLifecycle.new,
:parser => Fog::Parsers::AWS::Storage::GetBucketLifecycle.new,
:query => {'lifecycle' => nil}
})
end

View file

@ -21,7 +21,7 @@ module Fog
:bucket_name => bucket_name,
:idempotent => true,
:method => 'GET',
:parser => Fog::Parsers::Storage::AWS::GetBucketLocation.new,
:parser => Fog::Parsers::AWS::Storage::GetBucketLocation.new,
:query => {'location' => nil},
:path_style => true
})

View file

@ -35,7 +35,7 @@ module Fog
:bucket_name => bucket_name,
:idempotent => true,
:method => 'GET',
:parser => Fog::Parsers::Storage::AWS::GetBucketLogging.new,
:parser => Fog::Parsers::AWS::Storage::GetBucketLogging.new,
:query => {'logging' => nil}
})
end

View file

@ -35,7 +35,7 @@ module Fog
:bucket_name => bucket_name,
:idempotent => true,
:method => 'GET',
:parser => Fog::Parsers::Storage::AWS::GetBucketNotification.new,
:parser => Fog::Parsers::AWS::Storage::GetBucketNotification.new,
:query => {'notification' => nil}
})
end

View file

@ -57,7 +57,7 @@ module Fog
:bucket_name => bucket_name,
:idempotent => true,
:method => 'GET',
:parser => Fog::Parsers::Storage::AWS::GetBucketObjectVersions.new,
:parser => Fog::Parsers::AWS::Storage::GetBucketObjectVersions.new,
:query => {'versions' => nil}.merge!(options) })
end
end

View file

@ -25,7 +25,7 @@ module Fog
:bucket_name => bucket_name,
:idempotent => true,
:method => 'GET',
:parser => Fog::Parsers::Storage::AWS::GetBucketTagging.new,
:parser => Fog::Parsers::AWS::Storage::GetBucketTagging.new,
:query => {'tagging' => nil}
})
end

View file

@ -25,7 +25,7 @@ module Fog
:bucket_name => bucket_name,
:idempotent => true,
:method => 'GET',
:parser => Fog::Parsers::Storage::AWS::GetBucketVersioning.new,
:parser => Fog::Parsers::AWS::Storage::GetBucketVersioning.new,
:query => {'versioning' => nil}
})
end

View file

@ -28,7 +28,7 @@ module Fog
:bucket_name => bucket_name,
:idempotent => true,
:method => 'GET',
:parser => Fog::Parsers::Storage::AWS::GetBucketWebsite.new,
:parser => Fog::Parsers::AWS::Storage::GetBucketWebsite.new,
:query => {'website' => nil}
})
end

View file

@ -46,7 +46,7 @@ module Fog
:object_name => object_name,
:idempotent => true,
:method => 'GET',
:parser => Fog::Parsers::Storage::AWS::AccessControlList.new,
:parser => Fog::Parsers::AWS::Storage::AccessControlList.new,
:query => query
})
end
@ -60,7 +60,7 @@ module Fog
if acl = self.data[:acls][:object][bucket_name] && self.data[:acls][:object][bucket_name][object_name]
response.status = 200
if acl.is_a?(String)
response.body = Fog::Storage::AWS.acl_to_hash(acl)
response.body = Fog::AWS::Storage.acl_to_hash(acl)
else
response.body = acl
end

View file

@ -21,7 +21,7 @@ module Fog
:bucket_name => bucket_name,
:idempotent => true,
:method => 'GET',
:parser => Fog::Parsers::Storage::AWS::GetRequestPayment.new,
:parser => Fog::Parsers::AWS::Storage::GetRequestPayment.new,
:query => {'requestPayment' => nil}
})
end

View file

@ -24,7 +24,7 @@ module Fog
:host => @host,
:idempotent => true,
:method => 'GET',
:parser => Fog::Parsers::Storage::AWS::GetService.new
:parser => Fog::Parsers::AWS::Storage::GetService.new
})
end
end

View file

@ -32,7 +32,7 @@ module Fog
:bucket_name => bucket_name,
:object_name => object_name,
:method => 'POST',
:parser => Fog::Parsers::Storage::AWS::InitiateMultipartUpload.new,
:parser => Fog::Parsers::AWS::Storage::InitiateMultipartUpload.new,
:query => {'uploads' => nil}
})
end
@ -40,7 +40,7 @@ module Fog
class Mock # :nodoc:all
require 'fog/aws/requests/storage/shared_mock_methods'
include Fog::Storage::AWS::SharedMockMethods
include Fog::AWS::Storage::SharedMockMethods
def initiate_multipart_upload(bucket_name, object_name, options = {})
verify_mock_bucket_exists(bucket_name)

View file

@ -42,7 +42,7 @@ module Fog
:bucket_name => bucket_name,
:idempotent => true,
:method => 'GET',
:parser => Fog::Parsers::Storage::AWS::ListMultipartUploads.new,
:parser => Fog::Parsers::AWS::Storage::ListMultipartUploads.new,
:query => options.merge!({'uploads' => nil})
})
end

View file

@ -43,7 +43,7 @@ module Fog
:object_name => object_name,
:idempotent => true,
:method => 'GET',
:parser => Fog::Parsers::Storage::AWS::ListParts.new,
:parser => Fog::Parsers::AWS::Storage::ListParts.new,
:query => options.merge!({'uploadId' => upload_id})
})
end

View file

@ -29,7 +29,7 @@ module Fog
headers = {}
if acl.is_a?(Hash)
data = Fog::Storage::AWS.hash_to_acl(acl)
data = Fog::AWS::Storage.hash_to_acl(acl)
else
if !['private', 'public-read', 'public-read-write', 'authenticated-read'].include?(acl)
raise Excon::Errors::BadRequest.new('invalid x-amz-acl')
@ -55,7 +55,7 @@ module Fog
class Mock
def put_bucket_acl(bucket_name, acl)
if acl.is_a?(Hash)
self.data[:acls][:bucket][bucket_name] = Fog::Storage::AWS.hash_to_acl(acl)
self.data[:acls][:bucket][bucket_name] = Fog::AWS::Storage.hash_to_acl(acl)
else
if !['private', 'public-read', 'public-read-write', 'authenticated-read'].include?(acl)
raise Excon::Errors::BadRequest.new('invalid x-amz-acl')

View file

@ -19,7 +19,7 @@ module Fog
# @see http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketPUTcors.html
def put_bucket_cors(bucket_name, cors)
data = Fog::Storage::AWS.hash_to_cors(cors)
data = Fog::AWS::Storage.hash_to_cors(cors)
headers = {}
headers['Content-MD5'] = Base64.encode64(OpenSSL::Digest::MD5.digest(data)).strip
@ -39,7 +39,7 @@ module Fog
class Mock
def put_bucket_cors(bucket_name, cors)
self.data[:cors][:bucket][bucket_name] = Fog::Storage::AWS.hash_to_cors(cors)
self.data[:cors][:bucket][bucket_name] = Fog::AWS::Storage.hash_to_cors(cors)
end
end
end

View file

@ -57,14 +57,14 @@ module Fog
class Mock # :nodoc:all
require 'fog/aws/requests/storage/shared_mock_methods'
include Fog::Storage::AWS::SharedMockMethods
include Fog::AWS::Storage::SharedMockMethods
def put_object(bucket_name, object_name, data, options = {})
define_mock_acl(bucket_name, object_name, options)
data = parse_mock_data(data)
headers = data[:headers].merge!(options)
Fog::Storage::AWS::Real.conforming_to_us_ascii! headers.keys.grep(/^x-amz-meta-/), headers
Fog::AWS::Storage::Real.conforming_to_us_ascii! headers.keys.grep(/^x-amz-meta-/), headers
bucket = verify_mock_bucket_exists(bucket_name)
options['Content-Type'] ||= data[:headers]['Content-Type']

View file

@ -37,7 +37,7 @@ module Fog
headers = {}
if acl.is_a?(Hash)
data = Fog::Storage::AWS.hash_to_acl(acl)
data = Fog::AWS::Storage.hash_to_acl(acl)
else
if !['private', 'public-read', 'public-read-write', 'authenticated-read'].include?(acl)
raise Excon::Errors::BadRequest.new('invalid x-amz-acl')
@ -64,7 +64,7 @@ module Fog
class Mock
def put_object_acl(bucket_name, object_name, acl, options = {})
if acl.is_a?(Hash)
self.data[:acls][:object][bucket_name][object_name] = Fog::Storage::AWS.hash_to_acl(acl)
self.data[:acls][:object][bucket_name][object_name] = Fog::AWS::Storage.hash_to_acl(acl)
else
if !['private', 'public-read', 'public-read-write', 'authenticated-read'].include?(acl)
raise Excon::Errors::BadRequest.new('invalid x-amz-acl')

View file

@ -37,7 +37,7 @@ module Fog
class Mock # :nodoc:all
require 'fog/aws/requests/storage/shared_mock_methods'
include Fog::Storage::AWS::SharedMockMethods
include Fog::AWS::Storage::SharedMockMethods
def upload_part(bucket_name, object_name, upload_id, part_number, data, options = {})
data = parse_mock_data(data)

View file

@ -46,7 +46,7 @@ module Fog
when :sqs
Fog::AWS::SQS
when :eu_storage, :storage
Fog::Storage::AWS
Fog::AWS::Storage
when :rds
Fog::AWS::RDS
when :sns

View file

@ -130,7 +130,7 @@ module Fog
end
def url(params, expires)
Fog::Logger.deprecation("Fog::Storage::AWS => #url is deprecated, use #https_url instead [light_black](#{caller.first})[/]")
Fog::Logger.deprecation("Fog::AWS::Storage => #url is deprecated, use #https_url instead [light_black](#{caller.first})[/]")
https_url(params, expires)
end