diff --git a/lib/fog/google/shared.rb b/lib/fog/google/shared.rb index 54b23ebf15..0520a695bf 100644 --- a/lib/fog/google/shared.rb +++ b/lib/fog/google/shared.rb @@ -87,8 +87,7 @@ def initialize_google_client(options) # Applies given options to the client instance # # @param [Google::Apis::Core::BaseService] service API service client instance - # @param [Hash] google_client_options Service client options to apply - # @param [Hash] _ignored Rest of the options (for convenience, ignored) + # @param [Hash] options (all ignored a.t.m., except :google_client_options) # @return [void] def apply_client_options(service, options = {}) google_client_options = options[:google_client_options] diff --git a/lib/fog/storage/google_json/models/directories.rb b/lib/fog/storage/google_json/models/directories.rb index 46260668a2..319e9d0f89 100644 --- a/lib/fog/storage/google_json/models/directories.rb +++ b/lib/fog/storage/google_json/models/directories.rb @@ -5,7 +5,7 @@ class Directories < Fog::Collection model Fog::Storage::GoogleJSON::Directory def all(opts = {}) - data = service.list_buckets(opts).to_h[:items] || [] + data = service.list_buckets(**opts).to_h[:items] || [] load(data) end diff --git a/lib/fog/storage/google_json/models/directory.rb b/lib/fog/storage/google_json/models/directory.rb index 35bd28f87d..71b2499204 100644 --- a/lib/fog/storage/google_json/models/directory.rb +++ b/lib/fog/storage/google_json/models/directory.rb @@ -52,7 +52,7 @@ def public_url def save requires :key - service.put_bucket(key, attributes) + service.put_bucket(key, **attributes) true end end diff --git a/lib/fog/storage/google_json/models/file.rb b/lib/fog/storage/google_json/models/file.rb index b9f49e7249..ea61311f0e 100644 --- a/lib/fog/storage/google_json/models/file.rb +++ b/lib/fog/storage/google_json/models/file.rb @@ -105,7 +105,7 @@ def save options[:predefined_acl] ||= @predefined_acl - service.put_object(directory.key, key, body, options) + service.put_object(directory.key, key, body, **options) self.content_length = Fog::Storage.get_body_size(body) self.content_type ||= Fog::Storage.get_content_type(body) true diff --git a/lib/fog/storage/google_json/models/files.rb b/lib/fog/storage/google_json/models/files.rb index 91909465a6..b76704ad53 100644 --- a/lib/fog/storage/google_json/models/files.rb +++ b/lib/fog/storage/google_json/models/files.rb @@ -33,7 +33,7 @@ def each def get(key, options = {}, &block) requires :directory - data = service.get_object(directory.key, key, options, &block).to_h + data = service.get_object(directory.key, key, **options, &block).to_h new(data) rescue ::Google::Apis::ClientError => e raise e unless e.status_code == 404 diff --git a/lib/fog/storage/google_json/requests/get_object.rb b/lib/fog/storage/google_json/requests/get_object.rb index b2e045abb5..39e9d025ea 100644 --- a/lib/fog/storage/google_json/requests/get_object.rb +++ b/lib/fog/storage/google_json/requests/get_object.rb @@ -53,11 +53,11 @@ def get_object(bucket_name, object_name, :options => request_options } - object = @storage_json.get_object(bucket_name, object_name, all_opts).to_h + object = @storage_json.get_object(bucket_name, object_name, **all_opts).to_h @storage_json.get_object( bucket_name, object_name, - all_opts.merge(:download_dest => buf.path) + **all_opts.merge(:download_dest => buf.path) ) if block_given? diff --git a/lib/fog/storage/google_json/requests/list_buckets.rb b/lib/fog/storage/google_json/requests/list_buckets.rb index 47eae5dbe2..bc94cc48be 100644 --- a/lib/fog/storage/google_json/requests/list_buckets.rb +++ b/lib/fog/storage/google_json/requests/list_buckets.rb @@ -11,10 +11,10 @@ def list_buckets(max_results: nil, page_token: nil, prefix: nil, projection: nil) @storage_json.list_buckets( @project, - :max_results => max_results, - :page_token => page_token, - :prefix => prefix, - :projection => projection + max_results: max_results, + page_token: page_token, + prefix: prefix, + projection: projection ) end end diff --git a/lib/fog/storage/google_json/requests/list_objects.rb b/lib/fog/storage/google_json/requests/list_objects.rb index 5b009532c3..d059e15cc2 100644 --- a/lib/fog/storage/google_json/requests/list_objects.rb +++ b/lib/fog/storage/google_json/requests/list_objects.rb @@ -31,7 +31,7 @@ def list_objects(bucket, options = {}) @storage_json.list_objects( bucket, - options.select { |k, _| allowed_opts.include? k } + **options.select { |k, _| allowed_opts.include? k } ) end end diff --git a/lib/fog/storage/google_json/requests/put_bucket.rb b/lib/fog/storage/google_json/requests/put_bucket.rb index 0a312747d1..04d88a2a4b 100644 --- a/lib/fog/storage/google_json/requests/put_bucket.rb +++ b/lib/fog/storage/google_json/requests/put_bucket.rb @@ -19,7 +19,7 @@ def put_bucket(bucket_name, predefined_default_object_acl: nil, **options) bucket = ::Google::Apis::StorageV1::Bucket.new( - options.merge(:name => bucket_name) + **options.merge(:name => bucket_name) ) @storage_json.insert_bucket( diff --git a/lib/fog/storage/google_json/requests/put_bucket_acl.rb b/lib/fog/storage/google_json/requests/put_bucket_acl.rb index 741ca827e1..eca7386fbb 100644 --- a/lib/fog/storage/google_json/requests/put_bucket_acl.rb +++ b/lib/fog/storage/google_json/requests/put_bucket_acl.rb @@ -12,7 +12,7 @@ def put_bucket_acl(bucket_name, acl = {}) raise ArgumentError.new("bucket_name is required") unless bucket_name raise ArgumentError.new("acl is required") unless acl - acl_update = ::Google::Apis::StorageV1::BucketAccessControl.new(acl) + acl_update = ::Google::Apis::StorageV1::BucketAccessControl.new(**acl) @storage_json.insert_bucket_access_control(bucket_name, acl_update) end end diff --git a/lib/fog/storage/google_json/requests/put_object.rb b/lib/fog/storage/google_json/requests/put_object.rb index 0746406bd1..a396689966 100644 --- a/lib/fog/storage/google_json/requests/put_object.rb +++ b/lib/fog/storage/google_json/requests/put_object.rb @@ -51,7 +51,7 @@ def put_object(bucket_name, data, options = normalize_data(data, options) object_config = ::Google::Apis::StorageV1::Object.new( - options.merge(:name => object_name) + **options.merge(:name => object_name) ) @storage_json.insert_object( diff --git a/lib/fog/storage/google_json/requests/put_object_acl.rb b/lib/fog/storage/google_json/requests/put_object_acl.rb index 34fbacb475..53a7f6843c 100644 --- a/lib/fog/storage/google_json/requests/put_object_acl.rb +++ b/lib/fog/storage/google_json/requests/put_object_acl.rb @@ -15,7 +15,7 @@ def put_object_acl(bucket_name, object_name, acl) raise ArgumentError.new("object_name is required") unless object_name raise ArgumentError.new("acl is required") unless acl - acl_object = ::Google::Apis::StorageV1::ObjectAccessControl.new(acl) + acl_object = ::Google::Apis::StorageV1::ObjectAccessControl.new(**acl) @storage_json.insert_object_access_control( bucket_name, object_name, acl_object diff --git a/lib/fog/storage/google_xml/models/file.rb b/lib/fog/storage/google_xml/models/file.rb index 9f7b805c9c..6d8e61d753 100644 --- a/lib/fog/storage/google_xml/models/file.rb +++ b/lib/fog/storage/google_xml/models/file.rb @@ -109,7 +109,7 @@ def save(options = {}) options["Expires"] = expires if expires options.merge!(metadata) - data = service.put_object(directory.key, key, body, options) + data = service.put_object(directory.key, key, body, **options) merge_attributes(data.headers.reject { |key, _value| ["Content-Length", "Content-Type"].include?(key) }) self.content_length = Fog::Storage.get_body_size(body) self.content_type ||= Fog::Storage.get_content_type(body)