Skip to content

Commit

Permalink
Ruby 3 does not support Proc.new without arguments
Browse files Browse the repository at this point in the history
Co-authored-by: Seth Boyles <[email protected]>
Co-authored-by: Merric de Launey <[email protected]>
  • Loading branch information
sethboyles and MerricdeLauney committed Jul 11, 2022
1 parent fcc776b commit 83a4ddb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .fog.example
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ my_google_credentials:
#google_storage_access_key_id: GOOGXXXXXXXXXXXXXXXX
#google_storage_secret_access_key: XXXX+XXX/XXXXXXXX+XXXXXXXXXXXXXXXXXXXXX
# /END GOOGLE CONFIG
#################################################################
#################################################################
4 changes: 2 additions & 2 deletions lib/fog/storage/google_xml/requests/get_object.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Real
# * 'ETag'<~String> - Etag of object
# * 'Last-Modified'<~String> - Last modified timestamp for object
#
def get_object(bucket_name, object_name, options = {}, &_block)
def get_object(bucket_name, object_name, options = {}, &block)
raise ArgumentError.new("bucket_name is required") unless bucket_name
raise ArgumentError.new("object_name is required") unless object_name

Expand All @@ -40,7 +40,7 @@ def get_object(bucket_name, object_name, options = {}, &_block)
params[:headers]["If-Unmodified-Since"] = Fog::Time.at(options["If-Unmodified-Since"].to_i).to_date_header
end

params[:response_block] = Proc.new if block_given?
params[:response_block] = block if block_given?

request(params.merge!(:expects => [200, 206],
:host => "#{bucket_name}.#{@host}",
Expand Down

0 comments on commit 83a4ddb

Please sign in to comment.