Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions lib/fog/google/shared.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/storage/google_json/models/directories.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion lib/fog/storage/google_json/models/directory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def public_url

def save
requires :key
service.put_bucket(key, attributes)
service.put_bucket(key, **attributes)
true
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/storage/google_json/models/file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/storage/google_json/models/files.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/fog/storage/google_json/requests/get_object.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
8 changes: 4 additions & 4 deletions lib/fog/storage/google_json/requests/list_buckets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/storage/google_json/requests/list_objects.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/storage/google_json/requests/put_bucket.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/storage/google_json/requests/put_bucket_acl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/storage/google_json/requests/put_object.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/storage/google_json/requests/put_object_acl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/storage/google_xml/models/file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down