Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't stream blob, Ruby 3+ raises exception without explicit &block in Proc.new #444

Open
ttilberg opened this issue May 26, 2023 · 0 comments · May be fixed by #445
Open

Can't stream blob, Ruby 3+ raises exception without explicit &block in Proc.new #444

ttilberg opened this issue May 26, 2023 · 0 comments · May be fixed by #445

Comments

@ttilberg
Copy link

Similar to the issue in the AWS S3 adapter: fog/fog-aws@412677c

Ruby 3 has deprecated the ability to call Proc.new without a block explicitly passed in.

The api that streams blob contents uses this move, so does not work in Ruby 3+

https://github.com/fog/fog-azure-rm/blob/68ea3f7dd14c0a524146f1e426fa2ad1f6192cc8/lib/fog/azurerm/requests/storage/get_blob.rb#LL8C15-L8C15

It's already capturing the &block in the args anyway, and is an easy patch:

        def get_blob_with_block_given(container_name, blob_name, options, &_block)

Rather than implicit Proc.new:

            Proc.new.call('', 0, 0)

Pass the block explicitly.

            Proc.new(&_block).call('', 0, 0)

Updating each of the instances has allowed me to stream blobs down.

ttilberg pushed a commit to ttilberg/fog-azure-rm that referenced this issue May 26, 2023
Fixes compatibility with Ruby 3+
Fixes fog#444
@ttilberg ttilberg linked a pull request May 26, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant