Skip to content

Commit

Permalink
Merge branch 'master' into fix_dns_deprecation_warning
Browse files Browse the repository at this point in the history
  • Loading branch information
geemus authored Sep 17, 2018
2 parents dc81906 + daa50bb commit d6aa7f4
Show file tree
Hide file tree
Showing 90 changed files with 271 additions and 261 deletions.
5 changes: 1 addition & 4 deletions lib/fog/aws.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ module CDN
autoload :AWS, File.expand_path('../aws/cdn', __FILE__)
end

module Storage
autoload :AWS, File.expand_path('../aws/storage', __FILE__)
end

module AWS
extend Fog::Provider

Expand Down Expand Up @@ -48,6 +44,7 @@ module AWS
autoload :SNS, File.expand_path('../aws/sns', __FILE__)
autoload :SQS, File.expand_path('../aws/sqs', __FILE__)
autoload :STS, File.expand_path('../aws/sts', __FILE__)
autoload :Storage, File.expand_path('../aws/storage', __FILE__)
autoload :Support, File.expand_path('../aws/support', __FILE__)
autoload :SimpleDB, File.expand_path('../aws/simpledb', __FILE__)

Expand Down
6 changes: 3 additions & 3 deletions lib/fog/aws/models/storage/directories.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
require 'fog/aws/models/storage/directory'

module Fog
module Storage
class AWS
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']
Expand Down
10 changes: 5 additions & 5 deletions lib/fog/aws/models/storage/directory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
require 'fog/aws/models/storage/versions'

module Fog
module Storage
class AWS
module AWS
class Storage
class Directory < Fog::Model
VALID_ACLS = ['private', 'public-read', 'public-read-write', 'authenticated-read']

Expand Down Expand Up @@ -31,7 +31,7 @@ def destroy
end

def location
@location ||= (bucket_location || AWS::DEFAULT_REGION)
@location ||= (bucket_location || Storage::DEFAULT_REGION)
end

# NOTE: you can't change the region once the bucket is created
Expand All @@ -40,7 +40,7 @@ def location=(new_location)
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
Expand All @@ -67,7 +67,7 @@ def versioning=(new_versioning)
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)
Expand Down
8 changes: 4 additions & 4 deletions lib/fog/aws/models/storage/file.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
require 'fog/aws/models/storage/versions'

module Fog
module Storage
class AWS
module AWS
class Storage
class File < Fog::Model
# @see AWS Object docs http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectOps.html

Expand Down Expand Up @@ -240,11 +240,11 @@ def url(expires, options = {})
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
)
Expand Down
8 changes: 4 additions & 4 deletions lib/fog/aws/models/storage/files.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
require 'fog/aws/models/storage/file'

module Fog
module Storage
class AWS
module AWS
class Storage
class Files < Fog::Collection
extend Fog::Deprecation
deprecate :get_url, :get_https_url
Expand All @@ -15,7 +15,7 @@ class Files < Fog::Collection
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
Expand Down Expand Up @@ -70,7 +70,7 @@ def get(key, options = {}, &block)
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
Expand Down
4 changes: 2 additions & 2 deletions lib/fog/aws/models/storage/version.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Fog
module Storage
class AWS
module AWS
class Storage
class Version < Fog::Model
identity :version, :aliases => 'VersionId'

Expand Down
6 changes: 3 additions & 3 deletions lib/fog/aws/models/storage/versions.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
require 'fog/aws/models/storage/version'

module Fog
module Storage
class AWS
module AWS
class Storage
class Versions < Fog::Collection
attribute :file
attribute :directory

model Fog::Storage::AWS::Version
model Fog::AWS::Storage::Version

def all(options = {})
data = if file
Expand Down
4 changes: 2 additions & 2 deletions lib/fog/aws/parsers/storage/access_control_list.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Fog
module Parsers
module Storage
module AWS
module AWS
module Storage
class AccessControlList < Fog::Parsers::Base
def reset
@in_access_control_list = false
Expand Down
4 changes: 2 additions & 2 deletions lib/fog/aws/parsers/storage/complete_multipart_upload.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Fog
module Parsers
module Storage
module AWS
module AWS
module Storage
class CompleteMultipartUpload < Fog::Parsers::Base
def reset
@response = {}
Expand Down
4 changes: 2 additions & 2 deletions lib/fog/aws/parsers/storage/copy_object.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Fog
module Parsers
module Storage
module AWS
module AWS
module Storage
class CopyObject < Fog::Parsers::Base
def end_element(name)
case name
Expand Down
4 changes: 2 additions & 2 deletions lib/fog/aws/parsers/storage/cors_configuration.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Fog
module Parsers
module Storage
module AWS
module AWS
module Storage
class CorsConfiguration < Fog::Parsers::Base
def reset
@in_cors_configuration_list = false
Expand Down
4 changes: 2 additions & 2 deletions lib/fog/aws/parsers/storage/delete_multiple_objects.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Fog
module Parsers
module Storage
module AWS
module AWS
module Storage
class DeleteMultipleObjects < Fog::Parsers::Base
def reset
@deleted = { 'Deleted' => {} }
Expand Down
4 changes: 2 additions & 2 deletions lib/fog/aws/parsers/storage/get_bucket.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Fog
module Parsers
module Storage
module AWS
module AWS
module Storage
class GetBucket < Fog::Parsers::Base
def reset
@object = { 'Owner' => {} }
Expand Down
4 changes: 2 additions & 2 deletions lib/fog/aws/parsers/storage/get_bucket_lifecycle.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Fog
module Parsers
module Storage
module AWS
module AWS
module Storage
class GetBucketLifecycle < Fog::Parsers::Base
def reset
@expiration = {}
Expand Down
4 changes: 2 additions & 2 deletions lib/fog/aws/parsers/storage/get_bucket_location.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Fog
module Parsers
module Storage
module AWS
module AWS
module Storage
class GetBucketLocation < Fog::Parsers::Base
def end_element(name)
case name
Expand Down
4 changes: 2 additions & 2 deletions lib/fog/aws/parsers/storage/get_bucket_logging.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Fog
module Parsers
module Storage
module AWS
module AWS
module Storage
class GetBucketLogging < Fog::Parsers::Base
def reset
@grant = { 'Grantee' => {} }
Expand Down
4 changes: 2 additions & 2 deletions lib/fog/aws/parsers/storage/get_bucket_notification.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Fog
module Parsers
module Storage
module AWS
module AWS
module Storage
class GetBucketNotification < Fog::Parsers::Base
def reset
@func = {}
Expand Down
4 changes: 2 additions & 2 deletions lib/fog/aws/parsers/storage/get_bucket_object_versions.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Fog
module Parsers
module Storage
module AWS
module AWS
module Storage
class GetBucketObjectVersions < Fog::Parsers::Base
def reset
@delete_marker = { 'Owner' => {} }
Expand Down
4 changes: 2 additions & 2 deletions lib/fog/aws/parsers/storage/get_bucket_tagging.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Fog
module Parsers
module Storage
module AWS
module AWS
module Storage
class GetBucketTagging < Fog::Parsers::Base
def reset
@in_tag = {}
Expand Down
4 changes: 2 additions & 2 deletions lib/fog/aws/parsers/storage/get_bucket_versioning.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Fog
module Parsers
module Storage
module AWS
module AWS
module Storage
class GetBucketVersioning < Fog::Parsers::Base
def reset
@response = { 'VersioningConfiguration' => {} }
Expand Down
4 changes: 2 additions & 2 deletions lib/fog/aws/parsers/storage/get_bucket_website.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Fog
module Parsers
module Storage
module AWS
module AWS
module Storage

# http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETwebsite.html
class GetBucketWebsite < Fog::Parsers::Base
Expand Down
4 changes: 2 additions & 2 deletions lib/fog/aws/parsers/storage/get_request_payment.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Fog
module Parsers
module Storage
module AWS
module AWS
module Storage
class GetRequestPayment < Fog::Parsers::Base
def end_element(name)
case name
Expand Down
4 changes: 2 additions & 2 deletions lib/fog/aws/parsers/storage/get_service.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Fog
module Parsers
module Storage
module AWS
module AWS
module Storage
class GetService < Fog::Parsers::Base
def reset
@bucket = {}
Expand Down
4 changes: 2 additions & 2 deletions lib/fog/aws/parsers/storage/initiate_multipart_upload.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Fog
module Parsers
module Storage
module AWS
module AWS
module Storage
class InitiateMultipartUpload < Fog::Parsers::Base
def reset
@response = {}
Expand Down
4 changes: 2 additions & 2 deletions lib/fog/aws/parsers/storage/list_multipart_uploads.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Fog
module Parsers
module Storage
module AWS
module AWS
module Storage
class ListMultipartUploads < Fog::Parsers::Base
def reset
@upload = { 'Initiator' => {}, 'Owner' => {} }
Expand Down
4 changes: 2 additions & 2 deletions lib/fog/aws/parsers/storage/list_parts.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Fog
module Parsers
module Storage
module AWS
module AWS
module Storage
class ListParts < Fog::Parsers::Base
def reset
@part = {}
Expand Down
6 changes: 3 additions & 3 deletions lib/fog/aws/requests/storage/abort_multipart_upload.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Fog
module Storage
class AWS
module AWS
class Storage
class Real
#
# Abort a multipart upload
Expand All @@ -25,7 +25,7 @@ def abort_multipart_upload(bucket_name, object_name, upload_id)

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)
Expand Down
6 changes: 3 additions & 3 deletions lib/fog/aws/requests/storage/acl_utils.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Fog
module Storage
class AWS
module AWS
class Storage
require 'fog/aws/parsers/storage/access_control_list'

private
Expand Down Expand Up @@ -51,7 +51,7 @@ def self.hash_to_acl(acl)
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
Expand Down
Loading

0 comments on commit d6aa7f4

Please sign in to comment.